summaryrefslogtreecommitdiffstats
path: root/base/threading/sequenced_worker_pool_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* Add RetainedRef uses where needed.vmpstr2016-03-211-15/+17
| | | | | | | | | | | | | | | This patch adds RetainedRef uses where they are required. These changes will be required when we remove automatic unwrapping of scoped_refptrs in Bind. Please see the bug for more context. R=tzik@chromium.org, thakis@chromium.org, danakj@chromium.org BUG=589048 Review URL: https://codereview.chromium.org/1815363002 Cr-Commit-Position: refs/heads/master@{#382371}
* base: Remove some unnecessary const scoped_refptr<>&.vmpstr2016-03-181-3/+2
| | | | | | | | | | | | | This patch removes some unnecessary const scoped_refptr<>&. It replaces some instances with a copy of scoped_refptr, followed by a move. Other instances, it passes a raw non-owning pointer. R=danakj BUG=589044 Review URL: https://codereview.chromium.org/1800743003 Cr-Commit-Position: refs/heads/master@{#382043}
* Allow SequencedTaskRunnerHandle::Get() while running unsequenced tasks.bauerb2016-01-071-31/+124
| | | | | | | | | | If the SequencedWorkerPool is running an unsequenced task, it will assign a new sequence token to it and use that for the returned SequencedTaskRunner. Review URL: https://codereview.chromium.org/1414793009 Cr-Commit-Position: refs/heads/master@{#368078}
* Switch to standard integer types in base/threading/.avi2015-12-241-0/+3
| | | | | | | | | BUG=138542 TBR=mark@chromium.org Review URL: https://codereview.chromium.org/1550503002 Cr-Commit-Position: refs/heads/master@{#366837}
* Cleanup: Use ContainsValue() instead of std::find() in base/thestig2015-12-071-14/+10
| | | | | | | | BUG=561800 Review URL: https://codereview.chromium.org/1473983004 Cr-Commit-Position: refs/heads/master@{#363519}
* Reland of Tests: Simplify SequencedWorkerPoolOwner, call Shutdown on ↵tapted2015-12-031-28/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | destructor. (patchset #1 id:1 of https://codereview.chromium.org/1496493004/ ) Reason for revert: Relanding, no recovery in https://build.chromium.org/p/chromium.mac/builders/iOS_Simulator_%28dbg%29/builds/32878 Original issue's description: > Revert of Tests: Simplify SequencedWorkerPoolOwner, call Shutdown on destructor. (patchset #4 id:60001 of https://codereview.chromium.org/1417353006/ ) > > Reason for revert: > Suspected for persistent failures on ios_net_unittests > > - RoundTripTestCookieStore/CookieStoreTest/0.TestNonDottedAndTLD > - CookieStoreIOS/CookieStoreTest/0.TestNonDottedAndTLD > > Failing since https://build.chromium.org/p/chromium.mac/builders/iOS_Simulator_%28dbg%29/builds/32876 > > Errors like > > ../../net/cookies/cookie_store_unittest.h:536: Failure > Value of: this->SetCookie(cs.get(), url, "a=1; domain=com") > Actual: false > Expected: true > > (It's a tricky one! Sorry if this is not it) > > Original issue's description: > > Tests: Simplify SequencedWorkerPoolOwner, call Shutdown on destructor. > > > > Also ports remaining tests using raw SWPs to use SWPOwner. > > > > BUG=450228 > > > > Committed: https://crrev.com/fc939726c283e34112d9bc845a39460410fe9cd9 > > Cr-Commit-Position: refs/heads/master@{#362805} > > TBR=phajdan.jr@chromium.org,jam@chromium.org,brettw@chromium.org,tommycli@chromium.org > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=450228 > > Committed: https://crrev.com/d7365d9aaa55e88d9ecca49eb2158b62d1190f09 > Cr-Commit-Position: refs/heads/master@{#362890} TBR=phajdan.jr@chromium.org,jam@chromium.org,brettw@chromium.org,tommycli@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=450228 Review URL: https://codereview.chromium.org/1500503002 Cr-Commit-Position: refs/heads/master@{#362907}
* Revert of Tests: Simplify SequencedWorkerPoolOwner, call Shutdown on ↵tapted2015-12-031-17/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | destructor. (patchset #4 id:60001 of https://codereview.chromium.org/1417353006/ ) Reason for revert: Suspected for persistent failures on ios_net_unittests - RoundTripTestCookieStore/CookieStoreTest/0.TestNonDottedAndTLD - CookieStoreIOS/CookieStoreTest/0.TestNonDottedAndTLD Failing since https://build.chromium.org/p/chromium.mac/builders/iOS_Simulator_%28dbg%29/builds/32876 Errors like ../../net/cookies/cookie_store_unittest.h:536: Failure Value of: this->SetCookie(cs.get(), url, "a=1; domain=com") Actual: false Expected: true (It's a tricky one! Sorry if this is not it) Original issue's description: > Tests: Simplify SequencedWorkerPoolOwner, call Shutdown on destructor. > > Also ports remaining tests using raw SWPs to use SWPOwner. > > BUG=450228 > > Committed: https://crrev.com/fc939726c283e34112d9bc845a39460410fe9cd9 > Cr-Commit-Position: refs/heads/master@{#362805} TBR=phajdan.jr@chromium.org,jam@chromium.org,brettw@chromium.org,tommycli@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=450228 Review URL: https://codereview.chromium.org/1496493004 Cr-Commit-Position: refs/heads/master@{#362890}
* Tests: Simplify SequencedWorkerPoolOwner, call Shutdown on destructor.tommycli2015-12-021-28/+17
| | | | | | | | | | Also ports remaining tests using raw SWPs to use SWPOwner. BUG=450228 Review URL: https://codereview.chromium.org/1417353006 Cr-Commit-Position: refs/heads/master@{#362805}
* Add SequencedTaskRunnerHandle to get a SequencedTaskRunner for the current ↵bauerb2015-10-301-0/+43
| | | | | | | | | | thread / sequence. BUG=546596 Review URL: https://codereview.chromium.org/1423773003 Cr-Commit-Position: refs/heads/master@{#357067}
* base: Move DelayedTaskBasic out of TaskRunnerTest.dcastagna2015-07-311-0/+4
| | | | | | | | | | | | | | | | | For a SequencedTaskRunner implementation it should be valid to ignore the delay in PostDelayedTask. SequencedTaskRunnerTest was testing that a task posted with a delay is executed after delay milliseconds have elapsed. This CL moves that specific test out of SequencedTaskRunnerTest to a new SequencedTaskRunnerDelayedTest. BUG=513897 Review URL: https://codereview.chromium.org/1249123002 Cr-Commit-Position: refs/heads/master@{#341434}
* base: Move RunsTasksOnCurrentThread out of TaskRunnerTest.dcastagna2015-07-241-0/+8
| | | | | | | | | | | | | | | | | | | | For a TaskRunner implementation it should be valid to have RunsTasksOnCurrentThread always return true. TaskRunnerTest was testing that if RunsTasksOnCurrentThread is called on a thread not related to the TaskRunner, the method would return false. This could make conformant TaskRunner implementations fail the test. This CL moves that specific test out of TaskRunnerTest to a new TaskRunnerAffinityTest. In this way a TaskRunner implementations can always return true in RunsTasksOnCurrentThread and still be conformant according to TaskRunnerTest. BUG=513897 Review URL: https://codereview.chromium.org/1252023003 Cr-Commit-Position: refs/heads/master@{#340375}
* base: Remove most uses of MessageLoopProxyskyostil2015-04-301-1/+0
| | | | | | | | | | | | | | | | | | Replace most usage of MessageLoopProxy under base/ with SingleThreadTaskRunner and ThreadTaskRunnerHandle (excluding the implementation of MessageLoopProxy itself which will removed later). This patch was mostly autogenerated with https://codereview.chromium.org/1010073002. Depends on https://codereview.chromium.org/1086733002/. BUG=465354 TBR=nkostylev@chromium.org,pkasting@chromium.org,pauljensen@chromium.org Review URL: https://codereview.chromium.org/1100773004 Cr-Commit-Position: refs/heads/master@{#327755}
* Revert of base: Remove use of MessageLoopProxy (patchset #6 id:100001 of ↵stevenjb2015-04-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1100773004/) Reason for revert: This CL caused this failure: http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%281%29/builds/2126 I would strongly recommend doing this in smaller pieces since it combines mechanical changes with more subtle ones (base/prefs, base/task). Original issue's description: > base: Remove use of MessageLoopProxy > > Replace usage of MessageLoopProxy under base/ with SingleThreadTaskRunner > and ThreadTaskRunnerHandle (excluding the implementation of MessageLoopProxy > itself which will removed later). > > This patch was mostly autogenerated with > https://codereview.chromium.org/1010073002. > > Depends on https://codereview.chromium.org/1086733002/. > > BUG=465354 > TBR=nkostylev@chromium.org,pkasting@chromium.org,pauljensen@chromium.org > > Committed: https://crrev.com/62aa5ca413e15738ebebbb9acd271138ec808739 > Cr-Commit-Position: refs/heads/master@{#327512} TBR=danakj@chromium.org,skyostil@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=465354 Review URL: https://codereview.chromium.org/1113953002 Cr-Commit-Position: refs/heads/master@{#327573}
* base: Remove use of MessageLoopProxyskyostil2015-04-291-1/+0
| | | | | | | | | | | | | | | | | | Replace usage of MessageLoopProxy under base/ with SingleThreadTaskRunner and ThreadTaskRunnerHandle (excluding the implementation of MessageLoopProxy itself which will removed later). This patch was mostly autogenerated with https://codereview.chromium.org/1010073002. Depends on https://codereview.chromium.org/1086733002/. BUG=465354 TBR=nkostylev@chromium.org,pkasting@chromium.org,pauljensen@chromium.org Review URL: https://codereview.chromium.org/1100773004 Cr-Commit-Position: refs/heads/master@{#327512}
* Base: Change task posting logic to SequencedWorkerPool during shutdown.erikchen2015-03-311-1/+39
| | | | | | | | | | | | | | | | This CL allows consumers to post blocking tasks to SequencedWorkerPool during shutdown. Previously, tasks could only be posted from within the context of an already running task whose shutdown behavior was BLOCKING_SHUTDOWN. The previous logic didn't fit the use case of all consumers of SequencedWorkerPools. To give one example: the SQLitePersistentCookieStore needs to post some cleanup to the task queue during shutdown. BUG= Review URL: https://codereview.chromium.org/1006423006 Cr-Commit-Position: refs/heads/master@{#322936}
* Base: Fix another deadlock during shutdown of SequencedWorkerPool.erikchen2015-03-131-0/+31
| | | | | | | | | | | | This CL is very similar to https://codereview.chromium.org/956583004/. There is yet another code path that causes SequencedWorkerPool to destroy some tasks without releasing its global lock. BUG=465271 Review URL: https://codereview.chromium.org/994483005 Cr-Commit-Position: refs/heads/master@{#320600}
* base: Use more specific CHECK macros for comparisons.danakj2015-03-091-1/+1
| | | | | | | | | | | | | | | Prefer DCHECK_EQ(a, b) over DCHECK(a == b) when possible as this provides more data on a failure. Similar for other operators such as >=, <, !=, etc. This also applies to CHECK, EXPECT, and ASSERT macros. R=Nico BUG=464816 Review URL: https://codereview.chromium.org/985723003 Cr-Commit-Position: refs/heads/master@{#319751}
* Base: Fix a deadlock during shutdown of SequencedWorkerPool.erikchen2015-02-261-0/+46
| | | | | | | | | | | | During shutdown, the SequencedWorkerPool was destroying some tasks without releasing its global lock. Any task whose destruction implicitly triggered a lock access would deadlock. BUG=448910 Review URL: https://codereview.chromium.org/956583004 Cr-Commit-Position: refs/heads/master@{#318283}
* Standardize usage of virtual/override/final specifiers in base/.dcheng2014-12-231-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Several formatting edits by clang-format were manually reverted, due to mangling of some of the more complicate IPC macros. BUG=417463 Review URL: https://codereview.chromium.org/804533005 Cr-Commit-Position: refs/heads/master@{#309527}
* replace OVERRIDE and FINAL with override and final in base/mostynb2014-10-071-2/+2
| | | | | | | | BUG=417463 Review URL: https://codereview.chromium.org/611153004 Cr-Commit-Position: refs/heads/master@{#298520}
* Threading: Remove TaskRunnerHandlesNonZeroDelays from TaskRunnerTestDelegatenhiroki@chromium.org2014-01-281-12/+0
| | | | | | | | | | | | This is no longer necessary (always returns true). BUG=149144 TEST=n/a (no behavioral changes) Review URL: https://codereview.chromium.org/146833008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247393 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of the message_loop header in base/.avi@chromium.org2013-07-181-1/+1
| | | | | | | | | | BUG=260807 TEST=none TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/19224003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212281 0039d316-1c4b-4281-b951-d872f2087c98
* base: Re-commit SequencedWorkerPool globally unique tokens with unused ↵tommycli@chromium.org2013-07-091-2/+0
| | | | | | | | | | | | | variable fix Original CL: https://codereview.chromium.org/18650006/ BUG=165590 TBR=akalin,darin,fischman@chromium.org Review URL: https://chromiumcodereview.appspot.com/18292012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210526 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 210434 "Revert 210433 "Revert 210423 "base: Make Sequence..."ajwong@chromium.org2013-07-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SequencedWorkerPool change broke CrOs (daisy) builder due to unused variable: threading/sequenced_worker_pool.cc:682:13: error: variable 'shutdown_wait_begin' reverting until that is fixed. > Revert 210433 "Revert 210423 "base: Make SequencedWorkerPool iss..." > > Undoing speculative revert. Still failed after revert. > > > Revert 210423 "base: Make SequencedWorkerPool issue globally uni..." > > > > Speculative revert for failing PageCyclerTest.FailProvisionalLoads on > > linux_clang. > > > > > base: Make SequencedWorkerPool issue globally unique SequenceTokens. > > > > > > SequencedWorkerPool currently issues SequenceTokens out of an internal member counter. This means that two different SequencedWorkerPool instances can issue identical SequenceTokens, which mucks up any attempt to distinguish sequences using only SequenceTokens. > > > > > > This change makes the SequenceTokens issued from an StaticAtomicSequenceNumber, which is globally shared amongst all SequencedWorkerPools. > > > > > > This change also makes the SequencedWorkerPool included in the nacl_untrusted builds, as it is needed for SequenceChecker and WeakPtr to work correctly. It previously was excluded because it used base/metrics. I've #ifdefed the base/metrics usage out for nacl. > > > > > > This issue is a spinoff and pre-requisite of issue 18501008: Make WeakPtr use SequenceChecker instead of ThreadChecker. > > > > > > R=akalin,darin > > > BUG=165590 > > > > > > Review URL: https://chromiumcodereview.appspot.com/18650006 > > > > TBR=tommycli@chromium.org > > > > Review URL: https://codereview.chromium.org/18271011 > > TBR=scottmg@chromium.org > > Review URL: https://codereview.chromium.org/18242008 TBR=scottmg@chromium.org Review URL: https://codereview.chromium.org/18861008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210462 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 210433 "Revert 210423 "base: Make SequencedWorkerPool iss..."scottmg@chromium.org2013-07-081-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Undoing speculative revert. Still failed after revert. > Revert 210423 "base: Make SequencedWorkerPool issue globally uni..." > > Speculative revert for failing PageCyclerTest.FailProvisionalLoads on > linux_clang. > > > base: Make SequencedWorkerPool issue globally unique SequenceTokens. > > > > SequencedWorkerPool currently issues SequenceTokens out of an internal member counter. This means that two different SequencedWorkerPool instances can issue identical SequenceTokens, which mucks up any attempt to distinguish sequences using only SequenceTokens. > > > > This change makes the SequenceTokens issued from an StaticAtomicSequenceNumber, which is globally shared amongst all SequencedWorkerPools. > > > > This change also makes the SequencedWorkerPool included in the nacl_untrusted builds, as it is needed for SequenceChecker and WeakPtr to work correctly. It previously was excluded because it used base/metrics. I've #ifdefed the base/metrics usage out for nacl. > > > > This issue is a spinoff and pre-requisite of issue 18501008: Make WeakPtr use SequenceChecker instead of ThreadChecker. > > > > R=akalin,darin > > BUG=165590 > > > > Review URL: https://chromiumcodereview.appspot.com/18650006 > > TBR=tommycli@chromium.org > > Review URL: https://codereview.chromium.org/18271011 TBR=scottmg@chromium.org Review URL: https://codereview.chromium.org/18242008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210434 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 210423 "base: Make SequencedWorkerPool issue globally uni..."scottmg@chromium.org2013-07-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Speculative revert for failing PageCyclerTest.FailProvisionalLoads on linux_clang. > base: Make SequencedWorkerPool issue globally unique SequenceTokens. > > SequencedWorkerPool currently issues SequenceTokens out of an internal member counter. This means that two different SequencedWorkerPool instances can issue identical SequenceTokens, which mucks up any attempt to distinguish sequences using only SequenceTokens. > > This change makes the SequenceTokens issued from an StaticAtomicSequenceNumber, which is globally shared amongst all SequencedWorkerPools. > > This change also makes the SequencedWorkerPool included in the nacl_untrusted builds, as it is needed for SequenceChecker and WeakPtr to work correctly. It previously was excluded because it used base/metrics. I've #ifdefed the base/metrics usage out for nacl. > > This issue is a spinoff and pre-requisite of issue 18501008: Make WeakPtr use SequenceChecker instead of ThreadChecker. > > R=akalin,darin > BUG=165590 > > Review URL: https://chromiumcodereview.appspot.com/18650006 TBR=tommycli@chromium.org Review URL: https://codereview.chromium.org/18271011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210433 0039d316-1c4b-4281-b951-d872f2087c98
* base: Make SequencedWorkerPool issue globally unique SequenceTokens.tommycli@chromium.org2013-07-081-2/+0
| | | | | | | | | | | | | | | | | SequencedWorkerPool currently issues SequenceTokens out of an internal member counter. This means that two different SequencedWorkerPool instances can issue identical SequenceTokens, which mucks up any attempt to distinguish sequences using only SequenceTokens. This change makes the SequenceTokens issued from an StaticAtomicSequenceNumber, which is globally shared amongst all SequencedWorkerPools. This change also makes the SequencedWorkerPool included in the nacl_untrusted builds, as it is needed for SequenceChecker and WeakPtr to work correctly. It previously was excluded because it used base/metrics. I've #ifdefed the base/metrics usage out for nacl. This issue is a spinoff and pre-requisite of issue 18501008: Make WeakPtr use SequenceChecker instead of ThreadChecker. R=akalin,darin BUG=165590 Review URL: https://chromiumcodereview.appspot.com/18650006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210423 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of time headers in base/, part 2.avi@chromium.org2013-06-281-2/+2
| | | | | | | | | | BUG=254986 TEST=none TBR=ben@chromium.org Review URL: https://codereview.chromium.org/18119002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209144 0039d316-1c4b-4281-b951-d872f2087c98
* Update includes of message_loop_proxy.brettw@chromium.org2013-06-101-1/+1
| | | | | | | | | | | This keeps the forwarding header, just updates all current callers. BUG= R=avi@chromium.org Review URL: https://codereview.chromium.org/16514006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205306 0039d316-1c4b-4281-b951-d872f2087c98
* Regularize storage monitor creation in Windows.gbillock@chromium.org2013-04-181-2/+14
| | | | | | | | BUG=None Review URL: https://chromiumcodereview.appspot.com/12647013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194784 0039d316-1c4b-4281-b951-d872f2087c98
* Flush SequenceWorkerPool tasks after each test. Applies to unit_test, ↵michaeln@google.com2013-03-071-16/+65
| | | | | | | | | | | | | | | | | | interactive_ui test, browser_tests... pretty much all gtest based content library test harnesses are affected. The CL changes semantics and implementation of the existing FlushForTesting method (which wasn't suitable for this usage). * The old method would wait for delayed tasks prior to continuing, the new method will not run them but will delete them prior to continuing. * The old method would deadlock if called after Shutdown had been called, the new method returns immediately in that case. A few SWP unittests relied on the waiting for delayed task completion behavior. Those have been modified to explicitly wait thru other means. BUG=168415,166470 Review URL: https://codereview.chromium.org/11649032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186578 0039d316-1c4b-4281-b951-d872f2087c98
* Delete delayed tasks upon worker pool shutdown.erikwright@chromium.org2013-02-261-6/+69
| | | | | | | | | | | | | Without this change, a delayed task that (directly or indirectly) holds a reference to the worker pool will prevent the worker pool from being destroyed. R=jar@chromium.org BUG=177119 Review URL: https://chromiumcodereview.appspot.com/12301041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184754 0039d316-1c4b-4281-b951-d872f2087c98
* Disable flaky SequencedWorkerPoolTest.IgnoresAfterShutdown test.creis@chromium.org2013-01-151-1/+2
| | | | | | | | | BUG=166451 TBR=michaeln Review URL: https://codereview.chromium.org/11915002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176943 0039d316-1c4b-4281-b951-d872f2087c98
* SharedWorkerPool.Shutdown(int max_new_blocking_tasks)michaeln@chromium.org2012-12-191-4/+65
| | | | | | | | BUG=158934,163096 Review URL: https://chromiumcodereview.appspot.com/11415246 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173829 0039d316-1c4b-4281-b951-d872f2087c98
* - Implement delayed task posting for SequencedWorkerPool.nhiroki@chromium.org2012-10-021-9/+10
| | | | | | | | | | | - Copy unit tests from MessageLoop. BUG=119657 TEST=base_unittests Review URL: https://chromiumcodereview.appspot.com/10828299 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159657 0039d316-1c4b-4281-b951-d872f2087c98
* Ensure SequencedWorkerPool::Shutdown() blocks for already-started ↵rsleevi@chromium.org2012-07-211-3/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | SKIP_ON_SHUTDOWN tasks SequencedWorkerPool tasks with explicit shutdown behaviours should have the following semantics: For tasks posted, but not started, before Shutdown is called: BLOCK_: MUST run SKIP_: MUST NOT run CONTINUE_: MUST NOT run For tasks started, but not completed, when Shutdown is called: BLOCK_: MUST block Shutdown SKIP_ MUST block Shutdown CONTINUE_: MUST NOT block Shutdown For tasks posted *AFTER* Shutdown is called, for all three cases, the new tasks MUST NOT be run. BUG=138120 TEST=base_unittests:SequencedWorkerPoolTest.SkipOnShutdown Review URL: https://chromiumcodereview.appspot.com/10807045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147776 0039d316-1c4b-4281-b951-d872f2087c98
* RefCounted types should not have public destructors, base/ editionrsleevi@chromium.org2012-04-251-3/+7
| | | | | | | | | | BUG=123295 TEST=none Review URL: http://codereview.chromium.org/10065037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133825 0039d316-1c4b-4281-b951-d872f2087c98
* Add SequencedWorkerPoolTaskRunner which lets you specify the shutdown behavior.mattm@chromium.org2012-04-111-5/+65
| | | | | | | | | | | | Update SequencedWorkerPoolSequencedTaskRunner to allow specifying the shutdown behavior too. BUG=122458 TEST=trybots Review URL: http://codereview.chromium.org/10021002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131860 0039d316-1c4b-4281-b951-d872f2087c98
* Rename SequencedWorkerPoolTaskRunner to SequencedWorkerPoolSequencedTaskRunner.mattm@chromium.org2012-04-111-1/+48
| | | | | | | | | | | Move it into anonymous namespace in sequenced_worker_pool.cc. BUG=122458 TEST=trybots Review URL: http://codereview.chromium.org/10005054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131733 0039d316-1c4b-4281-b951-d872f2087c98
* Add virtual and OVERRIDE to base/ implementation filesrsleevi@chromium.org2012-04-061-3/+3
| | | | | | | | | | BUG=none TEST=compiles Review URL: http://codereview.chromium.org/10004001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131098 0039d316-1c4b-4281-b951-d872f2087c98
* Implementation of SequencedTaskRunner based on SequencedWorkerPool.francoisk777@gmail.com2012-04-021-66/+1
| | | | | | | | | | | Also includes specification tests for SequencedTaskRunner. BUG=114330,114327 TEST=--gtest_filter=SequencedWorkerPoolTaskRunner* Review URL: http://codereview.chromium.org/9663075 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130113 0039d316-1c4b-4281-b951-d872f2087c98
* Add SequencedWorkerPool.IsRunningSequenceOnCurrentThread so callers can make ↵michaeln@google.com2012-03-301-0/+52
| | | | | | | | stronger assertions about where methods are being called. Review URL: https://chromiumcodereview.appspot.com/9845037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129979 0039d316-1c4b-4281-b951-d872f2087c98
* Move work signal count tracking from SequencedWorkerPool to the test fileakalin@chromium.org2012-03-141-6/+24
| | | | | | | | | | | | | | | Add OnHasWork() method to TestingObserver. Make TestingObserver a constructor parameter, so it can be read outside the lock. BUG=117469 TEST= Review URL: http://codereview.chromium.org/9689028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126780 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up condition variable usage in SequencedWorkerPoolakalin@chromium.org2012-03-121-0/+12
| | | | | | | | | | | | | | | | | | Add unit test for spurious work signal behavior. Split cond_var_ into multiple condition variables; one for each distinct condition. Document exactly when each condition variable is waited on. Restrict the thread that SWP::Shutdown() can be called from. Fix brace usage in destructor. BUG=117469 TEST= Review URL: https://chromiumcodereview.appspot.com/9651026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126241 0039d316-1c4b-4281-b951-d872f2087c98
* Move task_runner_test_template.* into base/test and test_support_baseakalin@chromium.org2012-03-091-1/+1
| | | | | | | | | BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/9657025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125808 0039d316-1c4b-4281-b951-d872f2087c98
* Ensure that SequencedWorkerPools in tests don't outlive their testsakalin@chromium.org2012-03-061-36/+89
| | | | | | | | | | | | | | | | | | | This prevents strange races with other tests. Add an OnDestroy() method to SequencedWorkerPool::TestingObserver(). Fix a bug where one test wasn't calling Shutdown() on its WorkerPools. Fix a deadlock if a Worker object releases the last ref to the WorkerPool. BUG=115987 TEST= Review URL: http://codereview.chromium.org/9558007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125152 0039d316-1c4b-4281-b951-d872f2087c98
* Move tsan suppression for SequencedWorkerPool to benign sectionakalin@chromium.org2012-02-291-0/+27
| | | | | | | | | | | Add unit test to consistently reproduce (benign) histogram race. BUG=115987 TEST= Review URL: https://chromiumcodereview.appspot.com/9522009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124250 0039d316-1c4b-4281-b951-d872f2087c98
* Make SequencedWorkerPool a TaskRunnerakalin@chromium.org2012-02-291-2/+37
| | | | | | | | | | | | Add basic tests for TaskRunner implementations, and instantiate it for SequencedWorkerPool. BUG=114329,114327 TEST= Review URL: https://chromiumcodereview.appspot.com/9401032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124087 0039d316-1c4b-4281-b951-d872f2087c98
* Fix up SequencedWorkerPool in preparation for making it a TaskRunnerakalin@chromium.org2012-02-271-37/+38
| | | | | | | | | | | | | | | | | | | | | | | | | Make SequencedWorkerPool ref-counted, merge it with ::Inner, and make its destructor private. Make users hold a scoped_refptr. Fix bug where SequencedWorkerPool::Worker wasn't taking a reference to the worker pool. Rename SequencedWorkerPool::PostTask to PostTaskHelper. Clean up includes and use forward declarations when possible. Make SequencedWorkerPool::Shutdown completely thread-safe by merging the terminating_ and shutdown_called_ flag. (Now that it's ref-counted, it can be passed around multiple threads.) Clean up includes and params in webkit/dom_storage a bit. BUG=114329,114330 TEST= Review URL: https://chromiumcodereview.appspot.com/9347056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123823 0039d316-1c4b-4281-b951-d872f2087c98
* Fix calls in base and net unit tests to use TimeDelta.tedvessenes@gmail.com2012-02-041-2/+2
| | | | | | | | | | | | | | | | I found another batch of unit tests that needed their Sleep() and PostDelayedTask() interfaces updated. As far as I know, this is the last batch of changes required before the deprecated integer interfaces to these functions can be removed. R=jar@chromium.org BUG=108171 TEST= Review URL: http://codereview.chromium.org/9316036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120480 0039d316-1c4b-4281-b951-d872f2087c98