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

Side by Side Diff: content/renderer/categorized_worker_pool.h

Issue 2664953004: Do not block in SimpleThread::Start(). (Closed)
Patch Set: HasBeenStarted() Created 3 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 CONTENT_RENDERER_CATEGORIZED_WORKER_POOL_H_ 5 #ifndef CONTENT_RENDERER_CATEGORIZED_WORKER_POOL_H_
6 #define CONTENT_RENDERER_CATEGORIZED_WORKER_POOL_H_ 6 #define CONTENT_RENDERER_CATEGORIZED_WORKER_POOL_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // of all the associated task runners. 62 // of all the associated task runners.
63 // Once all the tasks are executed the method blocks until the threads are 63 // Once all the tasks are executed the method blocks until the threads are
64 // terminated. 64 // terminated.
65 void Shutdown(); 65 void Shutdown();
66 66
67 cc::TaskGraphRunner* GetTaskGraphRunner() { return this; } 67 cc::TaskGraphRunner* GetTaskGraphRunner() { return this; }
68 68
69 // Create a new sequenced task graph runner. 69 // Create a new sequenced task graph runner.
70 scoped_refptr<base::SequencedTaskRunner> CreateSequencedTaskRunner(); 70 scoped_refptr<base::SequencedTaskRunner> CreateSequencedTaskRunner();
71 71
72 base::PlatformThreadId background_worker_thread_id() const { 72 base::PlatformThreadId GetBackgroundWorkerThreadId() const;
gab 2017/02/06 20:29:11 Comment that this may block until the background w
fdoray 2017/02/06 20:46:48 Done.
73 return threads_.back()->tid();
74 }
75 73
76 protected: 74 protected:
77 ~CategorizedWorkerPool() override; 75 ~CategorizedWorkerPool() override;
78 76
79 private: 77 private:
80 class CategorizedWorkerPoolSequencedTaskRunner; 78 class CategorizedWorkerPoolSequencedTaskRunner;
81 friend class CategorizedWorkerPoolSequencedTaskRunner; 79 friend class CategorizedWorkerPoolSequencedTaskRunner;
82 80
83 // Simple Task for the TaskGraphRunner that wraps a closure. 81 // Simple Task for the TaskGraphRunner that wraps a closure.
84 // This class is used to schedule TaskRunner tasks on the 82 // This class is used to schedule TaskRunner tasks on the
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 // Condition variable that is waited on by origin threads until a namespace 141 // Condition variable that is waited on by origin threads until a namespace
144 // has finished running all associated tasks. 142 // has finished running all associated tasks.
145 base::ConditionVariable has_namespaces_with_finished_running_tasks_cv_; 143 base::ConditionVariable has_namespaces_with_finished_running_tasks_cv_;
146 // Set during shutdown. Tells Run() to return when no more tasks are pending. 144 // Set during shutdown. Tells Run() to return when no more tasks are pending.
147 bool shutdown_; 145 bool shutdown_;
148 }; 146 };
149 147
150 } // namespace content 148 } // namespace content
151 149
152 #endif // CONTENT_RENDERER_CATEGORIZED_WORKER_POOL_H_ 150 #endif // CONTENT_RENDERER_CATEGORIZED_WORKER_POOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698