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

Unified Diff: content/public/child/child_thread.h

Issue 977573002: content: Add an overridable task runner to ChildThreadImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Work around MSVC bug. Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: content/public/child/child_thread.h
diff --git a/content/public/child/child_thread.h b/content/public/child/child_thread.h
index 6293ed164d8443dbd474ce35934a3235c0337943..fc931b9f3810aa3073b0087c59a62e73aaf7cd9c 100644
--- a/content/public/child/child_thread.h
+++ b/content/public/child/child_thread.h
@@ -5,6 +5,7 @@
#ifndef CONTENT_PUBLIC_CHILD_CHILD_THREAD_H_
#define CONTENT_PUBLIC_CHILD_CHILD_THREAD_H_
+#include "base/memory/ref_counted.h"
#include "content/common/content_export.h"
#include "ipc/ipc_sender.h"
@@ -12,6 +13,10 @@
#include <windows.h>
#endif
+namespace base {
+class SingleThreadTaskRunner;
+}
+
namespace content {
class CONTENT_EXPORT ChildThread : public IPC::Sender {
@@ -22,6 +27,12 @@ class CONTENT_EXPORT ChildThread : public IPC::Sender {
~ChildThread() override {}
+ // Returns the task runner which should be used to post tasks to be executed
+ // on this child thread. Note that this may be different from the underlying
+ // message loop for this thread, and should therefore be used instead of
+ // going to the message loop directly.
jabdelmalek 2015/03/06 18:06:13 this seems like quite a large change, as there are
Sami 2015/03/06 18:41:46 Yes, it's unfortunate that a lot of code is hard c
Ryan Sleevi 2015/03/06 19:00:31 Then you really should have been having this desig
+ virtual scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() = 0;
jabdelmalek 2015/03/06 18:06:13 why is this in the public interface, if only conte
Sami 2015/03/06 18:41:46 Good point, I've now moved GetTaskRunner() back to
+
#if defined(OS_WIN)
// Request that the given font be loaded by the browser so it's cached by the
// OS. Please see ChildProcessHost::PreCacheFont for details.

Powered by Google App Engine
This is Rietveld 408576698