Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: base/test/sequenced_worker_pool_owner.cc

Issue 1124763003: Update from https://crrev.com/327068 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: update nacl, buildtools, fix display_change_notifier_unittest Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/test/sequenced_worker_pool_owner.h" 5 #include "base/test/sequenced_worker_pool_owner.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 9
10 namespace base { 10 namespace base {
(...skipping 25 matching lines...) Expand all
36 } 36 }
37 37
38 void SequencedWorkerPoolOwner::OnHasWork() { 38 void SequencedWorkerPoolOwner::OnHasWork() {
39 AutoLock lock(has_work_lock_); 39 AutoLock lock(has_work_lock_);
40 ++has_work_call_count_; 40 ++has_work_call_count_;
41 } 41 }
42 42
43 void SequencedWorkerPoolOwner::WillWaitForShutdown() { 43 void SequencedWorkerPoolOwner::WillWaitForShutdown() {
44 if (!will_wait_for_shutdown_callback_.is_null()) { 44 if (!will_wait_for_shutdown_callback_.is_null()) {
45 will_wait_for_shutdown_callback_.Run(); 45 will_wait_for_shutdown_callback_.Run();
46
47 // Release the reference to the callback to prevent retain cycles.
48 will_wait_for_shutdown_callback_ = Closure();
46 } 49 }
47 } 50 }
48 51
49 void SequencedWorkerPoolOwner::OnDestruct() { 52 void SequencedWorkerPoolOwner::OnDestruct() {
50 constructor_message_loop_->PostTask( 53 constructor_message_loop_->PostTask(
51 FROM_HERE, 54 FROM_HERE,
52 constructor_message_loop_->QuitWhenIdleClosure()); 55 constructor_message_loop_->QuitWhenIdleClosure());
53 } 56 }
54 57
55 } // namespace base 58 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698