1. 01 Mar, 2017 1 commit
    • vmpstr's avatar
      Remove auto raw pointer deduction from non-linux specific code. · 843b41a2
      vmpstr authored
      This patch removes the rest of the auto raw pointer deduction as
      detected the a clang plugin. This should be enough to enable the check
      for all platforms.
      
      R=danakj@chromium.org
      TBR=cschuet@chromium.org
      BUG=554600
      CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
      
      Review-Url: https://codereview.chromium.org/2721553004
      Cr-Commit-Position: refs/heads/master@{#454029}
      843b41a2
  2. 17 Feb, 2017 1 commit
  3. 13 Feb, 2017 1 commit
  4. 07 Feb, 2017 1 commit
    • michaeln's avatar
      Change how the quota system computes the poolsize for temporary storage. · 10e5fc35
      michaeln authored
      Adds a QuotaSettings datastructure and changes how the total poolsize
      for temporary storage is determined. This CL adds a public content API
      that the embedder must use to inform the quota system of the desired
      QuotaSettings.
      
      The old computation: [available_space + current_temp_usage] / 3
      The new computation: [total_volume_size - os_overhead] / 3
      
      The new computation is simplified to be a function of the size of the
      volume, and no longer takes as input how much chrome is currently using.
      This also reduces the time take to initialize the quota system.
      
      To defend against filling the drive, as available space gets "too low",
      as it approaches |must_remain_available|, the calculated per-host quota is
      clamped to the hosts current usage. This prevents the writing of new data
      because quota clients query GetUsageAndQuota() prior to performing a write.
      Also the eviction logic deletes existing data to keep
      |should_remain_available| disk space free.
      
      Settings.must_remain_available = 1% of total_volume_size
      Settings.should_remain_available = 10%
      
      BUG=520318
      
      Review-Url: https://codereview.chromium.org/1782053004
      Cr-Commit-Position: refs/heads/master@{#448510}
      10e5fc35
  5. 01 Feb, 2017 1 commit
  6. 26 Jan, 2017 1 commit
    • majidvp's avatar
      Revert of base::Time should correctly handle -epoch time values from... · 7ff9ceb9
      majidvp authored
      Revert of base::Time should correctly handle -epoch time values from Javascript (patchset #1 id:1 of https://codereview.chromium.org/2593073002/ )
      
      Reason for revert:
      The patched broke EME player which was relying on null time being converted to 0 in FromJsTime.
      
      After discussing this, we agreed to try to change all conversion methods together to ensure consistency. A precursor to doing this will be to get stop treating zero as null.
      
      For more info see:  https://bugs.chromium.org/p/chromium/issues/detail?id=679079#c13
      
      Original issue's description:
      > Correctly handle -epoch time values when converting from JS time to base::Time
      >
      > -11644473600 seconds (which represents windows epoch time of
      > |1601-01-01 00:00:00 UTC|) is a valid time value in Javascript. Incidentally
      > this value is internally represented by 0 which is mistakenly confused with a
      > null time value.
      >
      > FromJsTime is meant to be used to convert time values coming from Javascript
      > for which 0 or -epoch do not represent null values. So the extra check was
      > incorrect.
      >
      > * In fact there is a comment in FromJsTime method making it clear that 0 is a
      > valid value but this was missed in ToJsTime method.
      >
      > TEST=./base_unittests --gtest_filter=TimeTest.JsTime
      >
      > BUG=625680
      >
      > Committed: https://crrev.com/6650abf280f2987af809b0111ad00e5dba5723e4
      > Cr-Commit-Position: refs/heads/master@{#440304}
      
      TBR=miu@chromium.org
      # Not skipping CQ checks because original CL landed more than 1 days ago.
      BUG=625680
      
      Review-Url: https://codereview.chromium.org/2655233003
      Cr-Commit-Position: refs/heads/master@{#446340}
      7ff9ceb9
  7. 12 Jan, 2017 1 commit
    • digit's avatar
      Add WARN_UNUSED_RESULT to base::Time methods that return bool. · 2c8eed34
      digit authored
      base::Time::FromString() and base::Time::FromUTCString() might fail
      at runtime on bad input. This adds a WARN_UNUSED_RESULT to their
      declarations to ensure that all callers properly handle the result.
      
      Apart from unit-tests, this changes two things:
      
      - DataUseTracker::RemoveExpiredEntriesForPref() will also
        remove any entries with an invalid date string.
      
        This doesn't change the runtime behaviour though, because
        a failure in base::Time::FromUTCString() would keep the
        local |key_date| variable to 0, which would have been
        considered too old anyway.
      
      - VariationsSeedStore::ImportFirstRunJavaSeed() has
        a new failure mode triggered by an invalid response
        date |FIRST_RUN_SEED_IMPORT_FAIL_INVALID_RESPONSE_DATE|
      
        It looks like the FirstRunResult enum values are only
        used on Android to report UMA metrics, so ensure that
        the new constant is added at the end of the list to
        avoid generating confusing histograms.
      
      - PexeDownloader::didReceiveResponse() still ignores
        invalid HTTP response 'last-modified' header dates.
        As with RemoveExpiredEntriesForPref() this doesn't
        change the runtime behaviour, but it is hard to see
        whether this is desirable or dangerous.
      
      - ConvertRequestValueToFileInfo() still ignores
        invalid date strings, as mentioned by the comment
        above the base::Time::FromString() line.
      
      BUG=669625
      
      Review-Url: https://codereview.chromium.org/2605293002
      Cr-Commit-Position: refs/heads/master@{#443353}
      2c8eed34
  8. 22 Dec, 2016 1 commit
    • majidvp's avatar
      Correctly handle -epoch time values when converting from JS time to base::Time · 6650abf2
      majidvp authored
      -11644473600 seconds (which represents windows epoch time of
      |1601-01-01 00:00:00 UTC|) is a valid time value in Javascript. Incidentally
      this value is internally represented by 0 which is mistakenly confused with a
      null time value.
      
      FromJsTime is meant to be used to convert time values coming from Javascript
      for which 0 or -epoch do not represent null values. So the extra check was
      incorrect.
      
      * In fact there is a comment in FromJsTime method making it clear that 0 is a
      valid value but this was missed in ToJsTime method.
      
      TEST=./base_unittests --gtest_filter=TimeTest.JsTime
      
      BUG=625680
      
      Review-Url: https://codereview.chromium.org/2593073002
      Cr-Commit-Position: refs/heads/master@{#440304}
      6650abf2
  9. 21 Dec, 2016 2 commits
  10. 15 Dec, 2016 1 commit
    • michaeln's avatar
      Change how the quota system computes the poolsize for temporary storage. · db78e67f
      michaeln authored
      Adds a QuotaSettings datastructure and changes how the total poolsize
      for temporary storage is determined. This CL adds a public content API
      that the embedder must use to inform the quota system of the desired
      QuotaSettings.
      
      The old computation: [available_space + current_temp_usage] / 3
      The new computation: [total_volume_size - os_overhead] / 3
      
      The new computation is simplified to be a function of the size of the
      volume, and no longer takes as input how much chrome is currently using.
      This also reduces the time take to initialize the quota system.
      
      To defend against filling the drive, as available space gets "too low",
      the calculated per-host quota is clamped to the hosts current usage. This
      prevents the writing of new data because quota clients query
      GetUsageAndQuota() prior to performing a write. Also the eviction logic
      deletes existing data to keep |must_remain_available| disk space free.
      
      BUG=520318
      
      Review-Url: https://codereview.chromium.org/1782053004
      Cr-Commit-Position: refs/heads/master@{#438741}
      db78e67f
  11. 07 Dec, 2016 1 commit
  12. 06 Dec, 2016 1 commit
  13. 29 Nov, 2016 1 commit
  14. 23 Nov, 2016 1 commit
    • jschuh's avatar
      Remove remaining base dependencies from base/numerics · 56e74941
      jschuh authored
      All that was left was base/logging.h. And since this gets pulled in for
      a lot of other projects, it's best to make it dependency clean.
      It also necessitated several IWYU fixes for the missing header.
      
      TBR=jam@chromium.org,
      CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
      
      Review-Url: https://codereview.chromium.org/2523663002
      Cr-Commit-Position: refs/heads/master@{#434057}
      56e74941
  15. 04 Nov, 2016 1 commit
  16. 24 Oct, 2016 1 commit
    • maksim.sisov's avatar
      Fix Integer-overflow in base::Time::FromExploded. · eebbdeca
      maksim.sisov authored
      The old implementation doesn't handle possible overflows,
      when year is too large, for example. It makes a result
      to be larger than 2^63 - 1, which results in overflow.
      
      Fix Posix: use safe_math.h for multiplication and addition. If
      overflow occurs, return possibly maximum platform dependent
      value.
      
      Fix Mac and Win: if safe cast is impossible, return Time(0).
      
      Fix media and components: use day of week as well, as long
      as unused variable results in undefined behavior and overflow
      
      BUG=653445
      
      Review-Url: https://codereview.chromium.org/2405453002
      Cr-Commit-Position: refs/heads/master@{#427064}
      eebbdeca
  17. 11 Oct, 2016 1 commit
    • bcwhite's avatar
      Go lock-free for RolloverProtectedNow() · fdf17e08
      bcwhite authored
      This turns a global lock acquisition with every TimeTicks::Now()
      into a single 32-bit atomic load in most cases, with a 32-bit CAS
      about once every 4.5 hours.
      
      It also allows code that tracks locks (for hang detection) to
      not cause a recursive loop when recording the time at which a
      lock is being acquired.
      
      BUG=652432
      
      Review-Url: https://codereview.chromium.org/2393953003
      Cr-Commit-Position: refs/heads/master@{#424495}
      fdf17e08
  18. 03 Oct, 2016 1 commit
  19. 30 Sep, 2016 2 commits
  20. 23 Sep, 2016 1 commit
    • brettw's avatar
      Clean up my TODO comments in SmallMap and Time. · 6b0d29ef
      brettw authored
      The TODO in time.h was about removing time_t functions. When I wrote this I was optimistically thinking we wouldn't use time_t any more now that we have the awesome new Time class. This was fantasy so the TODO is removed.
      
      SmallMap uses ManualConstructor. The TODO was that these could be removed when we have C++11 unions. This is true, but the syntax looked worse. There was a use in ConvertToRealMap that still required ManualConstructor for optimum allocations, so it seemed best to just keep using ManualConstructor.
      
      However, the necessity of having the dummy value in the union due to an MSVC error seems no longer applicable. The dummy value is removed.
      
      Review-Url: https://codereview.chromium.org/2363023002
      Cr-Commit-Position: refs/heads/master@{#420626}
      6b0d29ef
  21. 12 Aug, 2016 1 commit
  22. 22 Jul, 2016 1 commit
  23. 29 Jun, 2016 2 commits
  24. 16 Jun, 2016 1 commit
  25. 14 Jun, 2016 1 commit
    • maksim.sisov's avatar
      Add: check exploded time is properly converted. · 558f1680
      maksim.sisov authored
      This cl introduces time checking in posix-like and mac systems.
      base::Time::FromUTCExploded() and
      base::Time::FromLocalExplode() can fail without returning
      a proper error.
      
      This fix does the following:
      1) After calculations are done, create UTC or local time.
      2) Convert UTC or local time back to exploded
      3) Compare original exploded with converted one
      4) If times are not equal, then return Time(0) indicating
      an error.
      
      Windows implementation already returns Time(0) on error.
      
      BUG=601900
      
      Committed: https://crrev.com/ceba9fb480269695775191d14e98ab23b5918382
      Review-Url: https://codereview.chromium.org/1988663002
      Cr-Original-Commit-Position: refs/heads/master@{#396638}
      Cr-Commit-Position: refs/heads/master@{#399794}
      558f1680
  26. 09 Jun, 2016 1 commit
    • majidvp's avatar
      Change ui::Event::time_stamp from TimeDelta to TimeTicks · 9b3bda8e
      majidvp authored
      Event timestamp values are now consistently coming from the same clock as
      base::TimeTicks. Historically this was not the case in particular on Windows
      platform which is why we were using  base::TimeDelta instead.
      
      Now that this has been addressed we should use base::TimeTicks to make it clear
      that these values are expected to come from the same clock and remove some
      crufty code.
      
      The changes in the CL are pretty simple and mechanical:
      - Introduce a pair of conversion functions in ui/events/base_event_utils.h to
      convert between  WebInputEvent::timeStampSeconds (double) and
      ui::Event::timeStamp (TimeTicks)
      - TimeDelta() =>TimeTicks()
      - TimeDelta::FromMilliseconds(0) => base::TimeTicks()
      - TimeDelta::FromInternalValue(TimeTicks::Now().ToInternalValue())  => TimeTicks::Now()
      - TimeDelta::FromMilliseconds(Time::Now().ToDoubleT() * 1000) => TimeTicks::Now()
      - Time::NowFromSystemTime() - base::Time() => TimeTicks::Now()
      
      BUG=453559
      
      Review-Url: https://codereview.chromium.org/1975533002
      Cr-Commit-Position: refs/heads/master@{#398947}
      9b3bda8e
  27. 31 May, 2016 1 commit
  28. 28 May, 2016 1 commit
    • maksim.sisov's avatar
      Add: check exploded time is properly converted. · ceba9fb4
      maksim.sisov authored
      This cl introduces time checking in posix-like and mac systems.
      base::Time::FromUTCExploded() and
      base::Time::FromLocalExplode() can fail without returning
      a proper error.
      
      This fix does the following:
      1) After calculations are done, create UTC or local time.
      2) Convert UTC or local time back to exploded
      3) Compare original exploded with converted one
      4) If times are not equal, then return Time(0) indicating
      an error.
      
      Windows implementation already returns Time(0) on error.
      
      BUG=601900
      
      Review-Url: https://codereview.chromium.org/1988663002
      Cr-Commit-Position: refs/heads/master@{#396638}
      ceba9fb4
  29. 18 May, 2016 2 commits
  30. 05 May, 2016 1 commit
  31. 22 Apr, 2016 1 commit
    • stanisc's avatar
      More accurate implementation of watched thread time for Gpu Watchdog. · f5173e22
      stanisc authored
      This change leverages an accurate implementation of ThreadTicks to
      allow GPU Watchdog thread report watched thread specific CPU time
      deltas to help with GPU hang crash dump analysis.
      
      This includes a small refactoring of ThreadTicks class that adds an
      overload of ThreadTicks::Now that accepts an arbitrary thread handle
      as an argument. That is limited to Windows OS only but if necessary we
      could extend it to other platforms.
      
      BUG=596190
      
      Review URL: https://codereview.chromium.org/1910063003
      
      Cr-Commit-Position: refs/heads/master@{#389210}
      f5173e22
  32. 31 Mar, 2016 2 commits
  33. 18 Feb, 2016 1 commit
  34. 15 Feb, 2016 1 commit
    • pkl's avatar
      Replaces deprecated CFGregorianDate with CFCalendar. · 46687ab4
      pkl authored
      Several CFGregorianDate APIs have been deprecated starting in iOS8.
      Use CFCalendar APIs instead.
      
      Keep separate implementation on Mac and iOS as base/time/time_posix.cc
      does not work on 32-bit architecture on Mac or iOS, and even though Mac
      is only build in 64-bit, iOS still support both architectures.
      
      BUG=567983
      
      Review URL: https://codereview.chromium.org/1494083005
      
      Cr-Commit-Position: refs/heads/master@{#375438}
      46687ab4
  35. 14 Jan, 2016 1 commit
    • tapted's avatar
      Move bit_cast from base/macros.h to its own header · 174fde33
      tapted authored
      There isn't much that uses bit_cast. bit_cast requires memcpy which
      requires <string.h>
      
      On Mac, <string.h> includes AvailabilityInternal.h which is half a
      megabyte and defines dozens of macros. Providing <string.h> in
      base/macros.h also tempts IWYU violations. Try to avoid it.
      
      Add base/bit_cast.h and include it from the 17 files that need it. Then
      remove the <string.h> #include from base/macros.h and IWYU.
      
      BUG=395001
      
      Review URL: https://codereview.chromium.org/399313006
      
      Cr-Commit-Position: refs/heads/master@{#369348}
      174fde33