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

Side by Side Diff: base/threading/sequenced_worker_pool.h

Issue 9065009: Hook up the SequencedWorkerPool to the browser thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef BASE_THREADING_SEQUENCED_WORKER_POOL_H_ 5 #ifndef BASE_THREADING_SEQUENCED_WORKER_POOL_H_
6 #define BASE_THREADING_SEQUENCED_WORKER_POOL_H_ 6 #define BASE_THREADING_SEQUENCED_WORKER_POOL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 BLOCK_SHUTDOWN, 86 BLOCK_SHUTDOWN,
87 }; 87 };
88 88
89 // Opaque identifier that defines sequencing of tasks posted to the worker 89 // Opaque identifier that defines sequencing of tasks posted to the worker
90 // pool. See NewSequenceToken(). 90 // pool. See NewSequenceToken().
91 class SequenceToken { 91 class SequenceToken {
92 public: 92 public:
93 explicit SequenceToken() : id_(0) {} 93 explicit SequenceToken() : id_(0) {}
94 ~SequenceToken() {} 94 ~SequenceToken() {}
95 95
96 // Returns true if this is a null sequence token. The null sequence token
97 // has not been initialized.
98 bool is_null() const { return id_ == 0; }
99
96 bool Equals(const SequenceToken& other) const { 100 bool Equals(const SequenceToken& other) const {
97 return id_ == other.id_; 101 return id_ == other.id_;
98 } 102 }
99 103
100 private: 104 private:
101 friend class SequencedWorkerPool; 105 friend class SequencedWorkerPool;
102 106
103 SequenceToken(int id) : id_(id) {} 107 SequenceToken(int id) : id_(id) {}
104 108
105 int id_; 109 int id_;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 friend class Worker; 201 friend class Worker;
198 202
199 scoped_refptr<Inner> inner_; 203 scoped_refptr<Inner> inner_;
200 204
201 DISALLOW_COPY_AND_ASSIGN(SequencedWorkerPool); 205 DISALLOW_COPY_AND_ASSIGN(SequencedWorkerPool);
202 }; 206 };
203 207
204 } // namespace base 208 } // namespace base
205 209
206 #endif // BASE_THREADING_SEQUENCED_WORKER_POOL_H_ 210 #endif // BASE_THREADING_SEQUENCED_WORKER_POOL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/visitedlink/visitedlink_master.h » ('j') | content/public/browser/browser_thread.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698