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

Unified Diff: content/common/child_thread.cc

Issue 8785013: Track webcore worker message loops in chromium. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: lazy-init and leak worker task runner Created 9 years 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 side-by-side diff with in-line comments
Download patch
Index: content/common/child_thread.cc
diff --git a/content/common/child_thread.cc b/content/common/child_thread.cc
index fedd88ecbd7564ac9b684448b36a1b20284d1f3f..492a5e4c94d1a70cc874651ecca0a2530b685c3e 100644
--- a/content/common/child_thread.cc
+++ b/content/common/child_thread.cc
@@ -17,6 +17,7 @@
#include "content/common/quota_dispatcher.h"
#include "content/common/resource_dispatcher.h"
#include "content/common/socket_stream_dispatcher.h"
+#include "content/common/worker_task_runner.h"
#include "content/public/common/content_switches.h"
#include "ipc/ipc_logging.h"
#include "ipc/ipc_sync_channel.h"
@@ -28,6 +29,10 @@
#include "content/common/handle_enumerator_win.h"
#endif
+base::LazyInstance<WorkerTaskRunner,
+ base::LeakyLazyInstanceTraits<WorkerTaskRunner> >
+ ChildThread::worker_task_runner_= LAZY_INSTANCE_INITIALIZER;
+
ChildThread::ChildThread() {
channel_name_ = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kProcessChannelID);
@@ -270,3 +275,7 @@ void ChildThread::OnProcessFinalRelease() {
// The browser then sends back a response if it's ok to shutdown.
Send(new ChildProcessHostMsg_ShutdownRequest);
}
+
+WorkerTaskRunner* ChildThread::worker_task_runner() const {
+ return worker_task_runner_.Pointer();
+}

Powered by Google App Engine
This is Rietveld 408576698