| 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_RENDERER_RENDER_THREAD_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
| 6 #define CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 class CONTENT_EXPORT RenderThreadImpl : public RenderThread, | 114 class CONTENT_EXPORT RenderThreadImpl : public RenderThread, |
| 115 public ChildThread, | 115 public ChildThread, |
| 116 public GpuChannelHostFactory { | 116 public GpuChannelHostFactory { |
| 117 public: | 117 public: |
| 118 static RenderThreadImpl* current(); | 118 static RenderThreadImpl* current(); |
| 119 | 119 |
| 120 RenderThreadImpl(); | 120 RenderThreadImpl(); |
| 121 // Constructor that's used when running in single process mode. | 121 // Constructor that's used when running in single process mode. |
| 122 explicit RenderThreadImpl(const std::string& channel_name); | 122 explicit RenderThreadImpl(const std::string& channel_name); |
| 123 virtual ~RenderThreadImpl(); | 123 virtual ~RenderThreadImpl(); |
| 124 virtual void Shutdown() OVERRIDE; | 124 virtual void Shutdown() override; |
| 125 | 125 |
| 126 // When initializing WebKit, ensure that any schemes needed for the content | 126 // When initializing WebKit, ensure that any schemes needed for the content |
| 127 // module are registered properly. Static to allow sharing with tests. | 127 // module are registered properly. Static to allow sharing with tests. |
| 128 static void RegisterSchemes(); | 128 static void RegisterSchemes(); |
| 129 | 129 |
| 130 // Notify V8 that the date/time configuration of the system might have | 130 // Notify V8 that the date/time configuration of the system might have |
| 131 // changed. | 131 // changed. |
| 132 static void NotifyTimezoneChange(); | 132 static void NotifyTimezoneChange(); |
| 133 | 133 |
| 134 // RenderThread implementation: | 134 // RenderThread implementation: |
| 135 virtual bool Send(IPC::Message* msg) OVERRIDE; | 135 virtual bool Send(IPC::Message* msg) override; |
| 136 virtual base::MessageLoop* GetMessageLoop() OVERRIDE; | 136 virtual base::MessageLoop* GetMessageLoop() override; |
| 137 virtual IPC::SyncChannel* GetChannel() OVERRIDE; | 137 virtual IPC::SyncChannel* GetChannel() override; |
| 138 virtual std::string GetLocale() OVERRIDE; | 138 virtual std::string GetLocale() override; |
| 139 virtual IPC::SyncMessageFilter* GetSyncMessageFilter() OVERRIDE; | 139 virtual IPC::SyncMessageFilter* GetSyncMessageFilter() override; |
| 140 virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() | 140 virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() |
| 141 OVERRIDE; | 141 override; |
| 142 virtual void AddRoute(int32 routing_id, IPC::Listener* listener) OVERRIDE; | 142 virtual void AddRoute(int32 routing_id, IPC::Listener* listener) override; |
| 143 virtual void RemoveRoute(int32 routing_id) OVERRIDE; | 143 virtual void RemoveRoute(int32 routing_id) override; |
| 144 virtual int GenerateRoutingID() OVERRIDE; | 144 virtual int GenerateRoutingID() override; |
| 145 virtual void AddFilter(IPC::MessageFilter* filter) OVERRIDE; | 145 virtual void AddFilter(IPC::MessageFilter* filter) override; |
| 146 virtual void RemoveFilter(IPC::MessageFilter* filter) OVERRIDE; | 146 virtual void RemoveFilter(IPC::MessageFilter* filter) override; |
| 147 virtual void AddObserver(RenderProcessObserver* observer) OVERRIDE; | 147 virtual void AddObserver(RenderProcessObserver* observer) override; |
| 148 virtual void RemoveObserver(RenderProcessObserver* observer) OVERRIDE; | 148 virtual void RemoveObserver(RenderProcessObserver* observer) override; |
| 149 virtual void SetResourceDispatcherDelegate( | 149 virtual void SetResourceDispatcherDelegate( |
| 150 ResourceDispatcherDelegate* delegate) OVERRIDE; | 150 ResourceDispatcherDelegate* delegate) override; |
| 151 virtual void EnsureWebKitInitialized() OVERRIDE; | 151 virtual void EnsureWebKitInitialized() override; |
| 152 virtual void RecordAction(const base::UserMetricsAction& action) OVERRIDE; | 152 virtual void RecordAction(const base::UserMetricsAction& action) override; |
| 153 virtual void RecordComputedAction(const std::string& action) OVERRIDE; | 153 virtual void RecordComputedAction(const std::string& action) override; |
| 154 virtual scoped_ptr<base::SharedMemory> HostAllocateSharedMemoryBuffer( | 154 virtual scoped_ptr<base::SharedMemory> HostAllocateSharedMemoryBuffer( |
| 155 size_t buffer_size) OVERRIDE; | 155 size_t buffer_size) override; |
| 156 virtual void RegisterExtension(v8::Extension* extension) OVERRIDE; | 156 virtual void RegisterExtension(v8::Extension* extension) override; |
| 157 virtual void ScheduleIdleHandler(int64 initial_delay_ms) OVERRIDE; | 157 virtual void ScheduleIdleHandler(int64 initial_delay_ms) override; |
| 158 virtual void IdleHandler() OVERRIDE; | 158 virtual void IdleHandler() override; |
| 159 virtual int64 GetIdleNotificationDelayInMs() const OVERRIDE; | 159 virtual int64 GetIdleNotificationDelayInMs() const override; |
| 160 virtual void SetIdleNotificationDelayInMs( | 160 virtual void SetIdleNotificationDelayInMs( |
| 161 int64 idle_notification_delay_in_ms) OVERRIDE; | 161 int64 idle_notification_delay_in_ms) override; |
| 162 virtual void UpdateHistograms(int sequence_number) OVERRIDE; | 162 virtual void UpdateHistograms(int sequence_number) override; |
| 163 virtual int PostTaskToAllWebWorkers(const base::Closure& closure) OVERRIDE; | 163 virtual int PostTaskToAllWebWorkers(const base::Closure& closure) override; |
| 164 virtual bool ResolveProxy(const GURL& url, std::string* proxy_list) OVERRIDE; | 164 virtual bool ResolveProxy(const GURL& url, std::string* proxy_list) override; |
| 165 virtual base::WaitableEvent* GetShutdownEvent() OVERRIDE; | 165 virtual base::WaitableEvent* GetShutdownEvent() override; |
| 166 #if defined(OS_WIN) | 166 #if defined(OS_WIN) |
| 167 virtual void PreCacheFont(const LOGFONT& log_font) OVERRIDE; | 167 virtual void PreCacheFont(const LOGFONT& log_font) override; |
| 168 virtual void ReleaseCachedFonts() OVERRIDE; | 168 virtual void ReleaseCachedFonts() override; |
| 169 #endif | 169 #endif |
| 170 virtual ServiceRegistry* GetServiceRegistry() OVERRIDE; | 170 virtual ServiceRegistry* GetServiceRegistry() override; |
| 171 | 171 |
| 172 // Synchronously establish a channel to the GPU plugin if not previously | 172 // Synchronously establish a channel to the GPU plugin if not previously |
| 173 // established or if it has been lost (for example if the GPU plugin crashed). | 173 // established or if it has been lost (for example if the GPU plugin crashed). |
| 174 // If there is a pending asynchronous request, it will be completed by the | 174 // If there is a pending asynchronous request, it will be completed by the |
| 175 // time this routine returns. | 175 // time this routine returns. |
| 176 GpuChannelHost* EstablishGpuChannelSync(CauseForGpuLaunch); | 176 GpuChannelHost* EstablishGpuChannelSync(CauseForGpuLaunch); |
| 177 | 177 |
| 178 | 178 |
| 179 // These methods modify how the next message is sent. Normally, when sending | 179 // These methods modify how the next message is sent. Normally, when sending |
| 180 // a synchronous message that runs a nested message loop, we need to suspend | 180 // a synchronous message that runs a nested message loop, we need to suspend |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 void WidgetRestored(); | 394 void WidgetRestored(); |
| 395 | 395 |
| 396 void AddEmbeddedWorkerRoute(int32 routing_id, IPC::Listener* listener); | 396 void AddEmbeddedWorkerRoute(int32 routing_id, IPC::Listener* listener); |
| 397 void RemoveEmbeddedWorkerRoute(int32 routing_id); | 397 void RemoveEmbeddedWorkerRoute(int32 routing_id); |
| 398 | 398 |
| 399 void RegisterPendingRenderFrameConnect(int routing_id, | 399 void RegisterPendingRenderFrameConnect(int routing_id, |
| 400 mojo::ScopedMessagePipeHandle handle); | 400 mojo::ScopedMessagePipeHandle handle); |
| 401 | 401 |
| 402 private: | 402 private: |
| 403 // ChildThread | 403 // ChildThread |
| 404 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; | 404 virtual bool OnControlMessageReceived(const IPC::Message& msg) override; |
| 405 | 405 |
| 406 // GpuChannelHostFactory implementation: | 406 // GpuChannelHostFactory implementation: |
| 407 virtual bool IsMainThread() OVERRIDE; | 407 virtual bool IsMainThread() override; |
| 408 virtual base::MessageLoop* GetMainLoop() OVERRIDE; | 408 virtual base::MessageLoop* GetMainLoop() override; |
| 409 virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() OVERRIDE; | 409 virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() override; |
| 410 virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory( | 410 virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory( |
| 411 size_t size) OVERRIDE; | 411 size_t size) override; |
| 412 virtual CreateCommandBufferResult CreateViewCommandBuffer( | 412 virtual CreateCommandBufferResult CreateViewCommandBuffer( |
| 413 int32 surface_id, | 413 int32 surface_id, |
| 414 const GPUCreateCommandBufferConfig& init_params, | 414 const GPUCreateCommandBufferConfig& init_params, |
| 415 int32 route_id) OVERRIDE; | 415 int32 route_id) override; |
| 416 virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( | 416 virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( |
| 417 size_t width, | 417 size_t width, |
| 418 size_t height, | 418 size_t height, |
| 419 unsigned internalformat, | 419 unsigned internalformat, |
| 420 unsigned usage) OVERRIDE; | 420 unsigned usage) override; |
| 421 | 421 |
| 422 void Init(); | 422 void Init(); |
| 423 | 423 |
| 424 void OnCreateNewFrame(int routing_id, int parent_routing_id); | 424 void OnCreateNewFrame(int routing_id, int parent_routing_id); |
| 425 void OnCreateNewFrameProxy(int routing_id, | 425 void OnCreateNewFrameProxy(int routing_id, |
| 426 int parent_routing_id, | 426 int parent_routing_id, |
| 427 int render_view_routing_id); | 427 int render_view_routing_id); |
| 428 void OnSetZoomLevelForCurrentURL(const std::string& scheme, | 428 void OnSetZoomLevelForCurrentURL(const std::string& scheme, |
| 429 const std::string& host, | 429 const std::string& host, |
| 430 double zoom_level); | 430 double zoom_level); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 bool is_one_copy_enabled_; | 579 bool is_one_copy_enabled_; |
| 580 | 580 |
| 581 std::map<int, mojo::MessagePipeHandle> pending_render_frame_connects_; | 581 std::map<int, mojo::MessagePipeHandle> pending_render_frame_connects_; |
| 582 | 582 |
| 583 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); | 583 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); |
| 584 }; | 584 }; |
| 585 | 585 |
| 586 } // namespace content | 586 } // namespace content |
| 587 | 587 |
| 588 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 588 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
| OLD | NEW |