1. 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
  2. 15 Sep, 2016 1 commit
    • vabr's avatar
      c/browser, c/common, components M-N: Change ScopedTempDir::path() to GetPath() · 6c5aae89
      vabr authored
      path() is being deprecated, GetPath() has better checking against wrong use.
      
      For more context, see https://codereview.chromium.org/2275553005/.
      
      This CL does two non-trivial changes in addition to the mechanical renaming and reformatting:
      * In components/nacl/browser/pnacl_translation_cache_unittest.cc, and
      * in chrome/browser/media_galleries/fileapi/itunes_data_provider_browsertest.cc
      the CL modifies the test code to keep track whether the ScopedTempDir was initialised and can vend the path, or whether it was not, and cannot be asked for the path. In both cases, before this CL, ScopedTempDir needed to trust the test code to not to store any files under the uninitialised path. After the CL, ScopedTempDir can assume that whenever it vends the path, files may be written under it, and the contract of not touching the uninitialised path stays limited to the test and the tested code.
      
      BUG=640599
      R=mseaborn@chromium.org, reillyg@chromium.org
      TBR=rsesek@chromium.org, blundell@chromium.org, sergeyu@chromium.org
      
      Review-Url: https://codereview.chromium.org/2318033002
      Cr-Commit-Position: refs/heads/master@{#418798}
      6c5aae89
  3. 22 Apr, 2016 1 commit
  4. 01 Mar, 2016 1 commit
  5. 26 Dec, 2015 1 commit
  6. 31 Mar, 2015 1 commit
  7. 19 Mar, 2015 1 commit
  8. 29 Oct, 2014 1 commit
    • dcheng's avatar
      Standardize usage of virtual/override/final specifiers. · 30a1b154
      dcheng authored
      The Google C++ style guide states:
      
        Explicitly annotate overrides of virtual functions or virtual
        destructors with an override or (less frequently) final specifier.
        Older (pre-C++11) code will use the virtual keyword as an inferior
        alternative annotation. For clarity, use exactly one of override,
        final, or virtual when declaring an override.
      
      To better conform to these guidelines, the following constructs have
      been rewritten:
      
      - if a base class has a virtual destructor, then:
          virtual ~Foo();                   ->  ~Foo() override;
      - virtual void Foo() override;        ->  void Foo() override;
      - virtual void Foo() override final;  ->  void Foo() final;
      
      This patch was automatically generated. The clang plugin can generate
      fixit hints, which are suggested edits when it is 100% sure it knows how
      to fix a problem. The hints from the clang plugin were applied to the
      source tree using the tool in https://codereview.chromium.org/598073004.
      
      BUG=417463
      R=caitkp@chromium.org
      
      Review URL: https://codereview.chromium.org/684513002
      
      Cr-Commit-Position: refs/heads/master@{#301931}
      30a1b154
  9. 26 Aug, 2014 1 commit
  10. 18 Feb, 2014 1 commit
    • dschuff@chromium.org's avatar
      Add sandbox ISA and extra compile flag fields to PNaCl translation cache key · c70916d6
      dschuff@chromium.org authored
      Previously there was no indication to the translation cache of what
      architecture the translated nexes were compiled for. This was not a
      problem in a world where the architecture of chrome (or Windows) did
      not change, but this will shortly happen on OSX, and we may support
      multiple sandboxes in the future.
      
      This adds 2 fields to the translation cache info, so that we can
      differentiate the architectures and retrieve nexes that will actually
      work. The field for extra compile flags is not being used yet, but
      may be in the future if we start using machine-specific optimizations.
      
      R=jvoung@chromium.org,teravest@chromium.org
      BUG=316912
      
      Review URL: https://codereview.chromium.org/163433015
      
      git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251835 0039d316-1c4b-4281-b951-d872f2087c98
      c70916d6
  11. 18 Nov, 2013 1 commit
  12. 25 Oct, 2013 1 commit
    • dschuff@chromium.org's avatar
      Delete PNaCl translation cache backend object when no longer needed · 779dc178
      dschuff@chromium.org authored
      Deleting a disk cache backend causes it to post tasks to its cache thread to sync the files, and block the IO thread waiting for completion. Because PnaclHost is a singleton, it is not destroyed until the browser threads have gone away, which results in hangs on shutdown.
      Previously the cache backend was deleted on renderer closing if it was unneeded, which worked when there was actual use of PNaCl, but did not work when it was a cache clear request that caused the backend to be initialized.
      This CL makes PnaclHost also try to free the backend when entries are doomed, and when a nexe finishes storing.
      
      R=jvoung@chromium.org
      BUG=270948
      TEST=unit_tests PnaclHostTest.*, PnaclTranslationCacheTest.*
      
      Review URL: https://codereview.chromium.org/28933003
      
      git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231128 0039d316-1c4b-4281-b951-d872f2087c98
      779dc178
  13. 19 Sep, 2013 1 commit
  14. 18 Sep, 2013 1 commit
  15. 10 Sep, 2013 1 commit
  16. 31 Jul, 2013 3 commits
  17. 21 Jul, 2013 1 commit
  18. 18 Jul, 2013 1 commit
  19. 12 Jul, 2013 1 commit
  20. 07 Jun, 2013 1 commit
  21. 06 Jun, 2013 2 commits
    • ajwong@chromium.org's avatar
      Add TestBrowserThreadBundle into RenderViewHostTestHarness. Kill some unnecessary real threads. · ec04d3f5
      ajwong@chromium.org authored
      This CL creates a new class, TestBrowserThreadBundle, that creates a TestBrowserThread for the most commonly needed BrowserThreads. It also adds this thread bundle into RenderViewHostTestHarness because most tests that use this harness need these threads in order to run.  To support TestBrowserThreadBundle, BrowserThreadImpl's test construction was also modified to understand a NULL message_loop.
      
      Aside from introducing the new class, this CL also removes:
        (1) unnecessary constructors in test
        (2) DISALLOW_COPY_AND_ASSIGNS in test fixtures*
        (3) now redundant TestBrowserThreads from tests
        (4) bad access-level changes for SetUp() and TearDown()
        (5) using declarations that root off the global scope
        (6) uses of MessageLoop's RunUntilIdle() and Quit()
        (7) as many real threads as possible
      
      There are also a changes to MediaCaptureDevicesDispatcher and OneClickSigninHelper that allow unittests to cut dependencies on IO thread activity.  DesktopNotificationServiceTest (and a couple of others) were also made single threaded because the synchronization logic required for a non-flaky test meant the parallelism only really exercised the extra code in the test that forced the serialization.
      
      * DISALLOW_COPY_AND_ASSIGN does not serve much purpose in GTest fixture types. However, using it removes the compile-provided default constructor which forces the fixture writer to provide an empty default constructor. Since GTest recommends the default constructor as the preferred method to do setup for a test (as opposed to the SetUp() method), it's confusing to have bunch of classes with both SetUp() and a default constructor. It's simpler and uses less code to just remove the DISALLOW_COPY_AND_ASSIGN. An alternative would be to use the default constructor for initialization, but this is not possible because of our test harnesses are inheritance based which means it is impossible for a derived fixture to perform initialization before the harness if we use the GTest preferred default constructor initialization pattern.
      
      TBR=avi,battre,ben,benwells,brettw,dbeam,dimich,joi,joth,mad,marja,markusheintz,noelallen,phajdan,rdsmith,satorux,scherkus,sky,stevenjb,stuartmorgan,timsteele
      BUG=159193
      
      Review URL: https://chromiumcodereview.appspot.com/14197014
      
      git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204603 0039d316-1c4b-4281-b951-d872f2087c98
      ec04d3f5
    • thestig@chromium.org's avatar
      Revert 204354 "Add read support to PNaClTranslationCache" · 9346fb5c
      thestig@chromium.org authored
      > Add read support to PNaClTranslationCache
      > 
      > Uses most of the same logic from PNaClTranslationCacheWriteEntry (now renamed PNaClTranslationCacheEntry). There is a little ugliness because of the asymmetry in the string type (const ref for write vs pointer for read) but I'm not 100% sure yet that it will stay as strings.
      > R=jvoung@chromium.org
      > BUG= https://code.google.com/p/nativeclient/issues/detail?id=3372
      > 
      > Review URL: https://chromiumcodereview.appspot.com/15647018
      
      TBR=dschuff@chromium.org
      
      Review URL: https://codereview.chromium.org/16279009
      
      git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204382 0039d316-1c4b-4281-b951-d872f2087c98
      9346fb5c
  22. 05 Jun, 2013 1 commit
  23. 04 Jun, 2013 1 commit
  24. 01 Jun, 2013 1 commit