| OLD | NEW |
| 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 #ifndef CONTENT_PUBLIC_RENDERER_RENDER_THREAD_H_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_RENDER_THREAD_H_ |
| 6 #define CONTENT_PUBLIC_RENDERER_RENDER_THREAD_H_ | 6 #define CONTENT_PUBLIC_RENDERER_RENDER_THREAD_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| 11 #include "base/metrics/user_metrics_action.h" | 11 #include "base/metrics/user_metrics_action.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "content/public/child/child_thread.h" |
| 13 #include "ipc/ipc_channel_proxy.h" | 14 #include "ipc/ipc_channel_proxy.h" |
| 14 #include "ipc/ipc_sender.h" | |
| 15 | |
| 16 #if defined(OS_WIN) | |
| 17 #include <windows.h> | |
| 18 #endif | |
| 19 | 15 |
| 20 class GURL; | 16 class GURL; |
| 21 | 17 |
| 22 namespace base { | 18 namespace base { |
| 23 class MessageLoop; | 19 class MessageLoop; |
| 24 class MessageLoopProxy; | 20 class MessageLoopProxy; |
| 25 class WaitableEvent; | 21 class WaitableEvent; |
| 26 } | 22 } |
| 27 | 23 |
| 28 namespace cc { | 24 namespace cc { |
| 29 class SharedBitmapManager; | 25 class SharedBitmapManager; |
| 30 } | 26 } |
| 31 | 27 |
| 32 namespace IPC { | 28 namespace IPC { |
| 33 class MessageFilter; | 29 class MessageFilter; |
| 34 class SyncChannel; | 30 class SyncChannel; |
| 35 class SyncMessageFilter; | 31 class SyncMessageFilter; |
| 36 } | 32 } |
| 37 | 33 |
| 38 namespace v8 { | 34 namespace v8 { |
| 39 class Extension; | 35 class Extension; |
| 40 } | 36 } |
| 41 | 37 |
| 42 namespace content { | 38 namespace content { |
| 43 | 39 |
| 44 class RenderProcessObserver; | 40 class RenderProcessObserver; |
| 45 class ResourceDispatcherDelegate; | 41 class ResourceDispatcherDelegate; |
| 46 class ServiceRegistry; | 42 class ServiceRegistry; |
| 47 | 43 |
| 48 class CONTENT_EXPORT RenderThread : public IPC::Sender { | 44 class CONTENT_EXPORT RenderThread : virtual public ChildThread { |
| 49 public: | 45 public: |
| 50 // Returns the one render thread for this process. Note that this can only | 46 // Returns the one render thread for this process. Note that this can only |
| 51 // be accessed when running on the render thread itself. | 47 // be accessed when running on the render thread itself. |
| 52 static RenderThread* Get(); | 48 static RenderThread* Get(); |
| 53 | 49 |
| 54 RenderThread(); | 50 RenderThread(); |
| 55 ~RenderThread() override; | 51 ~RenderThread() override; |
| 56 | 52 |
| 57 virtual scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() = 0; | 53 virtual scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() = 0; |
| 58 virtual IPC::SyncChannel* GetChannel() = 0; | 54 virtual IPC::SyncChannel* GetChannel() = 0; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 virtual int PostTaskToAllWebWorkers(const base::Closure& closure) = 0; | 124 virtual int PostTaskToAllWebWorkers(const base::Closure& closure) = 0; |
| 129 | 125 |
| 130 // Resolve the proxy servers to use for a given url. On success true is | 126 // Resolve the proxy servers to use for a given url. On success true is |
| 131 // returned and |proxy_list| is set to a PAC string containing a list of | 127 // returned and |proxy_list| is set to a PAC string containing a list of |
| 132 // proxy servers. | 128 // proxy servers. |
| 133 virtual bool ResolveProxy(const GURL& url, std::string* proxy_list) = 0; | 129 virtual bool ResolveProxy(const GURL& url, std::string* proxy_list) = 0; |
| 134 | 130 |
| 135 // Gets the shutdown event for the process. | 131 // Gets the shutdown event for the process. |
| 136 virtual base::WaitableEvent* GetShutdownEvent() = 0; | 132 virtual base::WaitableEvent* GetShutdownEvent() = 0; |
| 137 | 133 |
| 138 #if defined(OS_WIN) | |
| 139 // Request that the given font be loaded by the browser so it's cached by the | |
| 140 // OS. Please see ChildProcessHost::PreCacheFont for details. | |
| 141 virtual void PreCacheFont(const LOGFONT& log_font) = 0; | |
| 142 | |
| 143 // Release cached font. | |
| 144 virtual void ReleaseCachedFonts() = 0; | |
| 145 #endif | |
| 146 | |
| 147 // Returns the ServiceRegistry for this thread. | 134 // Returns the ServiceRegistry for this thread. |
| 148 virtual ServiceRegistry* GetServiceRegistry() = 0; | 135 virtual ServiceRegistry* GetServiceRegistry() = 0; |
| 149 }; | 136 }; |
| 150 | 137 |
| 151 } // namespace content | 138 } // namespace content |
| 152 | 139 |
| 153 #endif // CONTENT_PUBLIC_RENDERER_RENDER_THREAD_H_ | 140 #endif // CONTENT_PUBLIC_RENDERER_RENDER_THREAD_H_ |
| OLD | NEW |