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

Side by Side Diff: trunk/src/base/threading/sequenced_worker_pool.cc

Issue 20771002: Revert 213906 "base: Re-apply WeakPtr support for SequencedWorke..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
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/threading/sequenced_worker_pool.h" 5 #include "base/threading/sequenced_worker_pool.h"
6 6
7 #include <list> 7 #include <list>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 } 1117 }
1118 1118
1119 base::StaticAtomicSequenceNumber 1119 base::StaticAtomicSequenceNumber
1120 SequencedWorkerPool::Inner::g_last_sequence_number_; 1120 SequencedWorkerPool::Inner::g_last_sequence_number_;
1121 1121
1122 // SequencedWorkerPool -------------------------------------------------------- 1122 // SequencedWorkerPool --------------------------------------------------------
1123 1123
1124 // static 1124 // static
1125 SequencedWorkerPool::SequenceToken 1125 SequencedWorkerPool::SequenceToken
1126 SequencedWorkerPool::GetSequenceTokenForCurrentThread() { 1126 SequencedWorkerPool::GetSequenceTokenForCurrentThread() {
1127 // Don't construct lazy instance on check.
1128 if (g_lazy_tls_ptr == NULL)
1129 return SequenceToken();
1130
1131 SequencedWorkerPool::SequenceToken* token = g_lazy_tls_ptr.Get().Get(); 1127 SequencedWorkerPool::SequenceToken* token = g_lazy_tls_ptr.Get().Get();
1132 if (!token) 1128 if (!token)
1133 return SequenceToken(); 1129 return SequenceToken();
1134 return *token; 1130 return *token;
1135 } 1131 }
1136 1132
1137 SequencedWorkerPool::SequencedWorkerPool( 1133 SequencedWorkerPool::SequencedWorkerPool(
1138 size_t max_threads, 1134 size_t max_threads,
1139 const std::string& thread_name_prefix) 1135 const std::string& thread_name_prefix)
1140 : constructor_message_loop_(MessageLoopProxy::current()), 1136 : constructor_message_loop_(MessageLoopProxy::current()),
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1278 void SequencedWorkerPool::Shutdown(int max_new_blocking_tasks_after_shutdown) { 1274 void SequencedWorkerPool::Shutdown(int max_new_blocking_tasks_after_shutdown) {
1279 DCHECK(constructor_message_loop_->BelongsToCurrentThread()); 1275 DCHECK(constructor_message_loop_->BelongsToCurrentThread());
1280 inner_->Shutdown(max_new_blocking_tasks_after_shutdown); 1276 inner_->Shutdown(max_new_blocking_tasks_after_shutdown);
1281 } 1277 }
1282 1278
1283 bool SequencedWorkerPool::IsShutdownInProgress() { 1279 bool SequencedWorkerPool::IsShutdownInProgress() {
1284 return inner_->IsShutdownInProgress(); 1280 return inner_->IsShutdownInProgress();
1285 } 1281 }
1286 1282
1287 } // namespace base 1283 } // namespace base
OLDNEW
« no previous file with comments | « trunk/src/base/sequence_checker_unittest.cc ('k') | trunk/src/chrome/browser/storage_monitor/storage_monitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698