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_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
14 #include "base/process/process.h" | 14 #include "base/process/process.h" |
15 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
16 #include "content/browser/child_process_launcher.h" | 16 #include "content/browser/child_process_launcher.h" |
17 #include "content/browser/geolocation/geolocation_dispatcher_host.h" | 17 #include "content/browser/geolocation/geolocation_dispatcher_host.h" |
18 #include "content/browser/power_monitor_message_broadcaster.h" | 18 #include "content/browser/power_monitor_message_broadcaster.h" |
19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
20 #include "content/public/browser/gpu_data_manager_observer.h" | 20 #include "content/public/browser/gpu_data_manager_observer.h" |
21 #include "content/public/browser/render_process_host.h" | 21 #include "content/public/browser/render_process_host.h" |
22 #include "ipc/ipc_channel_proxy.h" | 22 #include "ipc/ipc_channel_proxy.h" |
23 #include "ipc/ipc_platform_file.h" | 23 #include "ipc/ipc_platform_file.h" |
24 #include "mojo/public/cpp/system/core.h" | 24 #include "mojo/public/cpp/system/core.h" |
25 #include "ui/surface/transport_dib.h" | |
26 | 25 |
27 struct ViewHostMsg_CompositorSurfaceBuffersSwapped_Params; | 26 struct ViewHostMsg_CompositorSurfaceBuffersSwapped_Params; |
28 | 27 |
29 namespace base { | 28 namespace base { |
30 class CommandLine; | 29 class CommandLine; |
31 class MessageLoop; | 30 class MessageLoop; |
32 } | 31 } |
33 | 32 |
34 namespace gfx { | 33 namespace gfx { |
35 class Size; | 34 class Size; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 IPC::Message* msg) OVERRIDE; | 96 IPC::Message* msg) OVERRIDE; |
98 virtual void ReceivedBadMessage() OVERRIDE; | 97 virtual void ReceivedBadMessage() OVERRIDE; |
99 virtual void WidgetRestored() OVERRIDE; | 98 virtual void WidgetRestored() OVERRIDE; |
100 virtual void WidgetHidden() OVERRIDE; | 99 virtual void WidgetHidden() OVERRIDE; |
101 virtual int VisibleWidgetCount() const OVERRIDE; | 100 virtual int VisibleWidgetCount() const OVERRIDE; |
102 virtual bool IsGuest() const OVERRIDE; | 101 virtual bool IsGuest() const OVERRIDE; |
103 virtual StoragePartition* GetStoragePartition() const OVERRIDE; | 102 virtual StoragePartition* GetStoragePartition() const OVERRIDE; |
104 virtual bool FastShutdownIfPossible() OVERRIDE; | 103 virtual bool FastShutdownIfPossible() OVERRIDE; |
105 virtual void DumpHandles() OVERRIDE; | 104 virtual void DumpHandles() OVERRIDE; |
106 virtual base::ProcessHandle GetHandle() const OVERRIDE; | 105 virtual base::ProcessHandle GetHandle() const OVERRIDE; |
107 virtual TransportDIB* GetTransportDIB(TransportDIB::Id dib_id) OVERRIDE; | |
108 virtual TransportDIB* MapTransportDIB(TransportDIB::Id dib_id) OVERRIDE; | |
109 virtual BrowserContext* GetBrowserContext() const OVERRIDE; | 106 virtual BrowserContext* GetBrowserContext() const OVERRIDE; |
110 virtual bool InSameStoragePartition( | 107 virtual bool InSameStoragePartition( |
111 StoragePartition* partition) const OVERRIDE; | 108 StoragePartition* partition) const OVERRIDE; |
112 virtual int GetID() const OVERRIDE; | 109 virtual int GetID() const OVERRIDE; |
113 virtual bool HasConnection() const OVERRIDE; | 110 virtual bool HasConnection() const OVERRIDE; |
114 virtual void SetIgnoreInputEvents(bool ignore_input_events) OVERRIDE; | 111 virtual void SetIgnoreInputEvents(bool ignore_input_events) OVERRIDE; |
115 virtual bool IgnoreInputEvents() const OVERRIDE; | 112 virtual bool IgnoreInputEvents() const OVERRIDE; |
116 virtual void Cleanup() OVERRIDE; | 113 virtual void Cleanup() OVERRIDE; |
117 virtual void AddPendingView() OVERRIDE; | 114 virtual void AddPendingView() OVERRIDE; |
118 virtual void RemovePendingView() OVERRIDE; | 115 virtual void RemovePendingView() OVERRIDE; |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 // Thread safety note: this field is to be accessed from the UI thread. | 323 // Thread safety note: this field is to be accessed from the UI thread. |
327 // We don't keep a reference to it, to avoid it being destroyed on the UI | 324 // We don't keep a reference to it, to avoid it being destroyed on the UI |
328 // thread, but we clear this field when we clear channel_. When channel_ goes | 325 // thread, but we clear this field when we clear channel_. When channel_ goes |
329 // away, it posts a task to the IO thread to destroy it there, so we know that | 326 // away, it posts a task to the IO thread to destroy it there, so we know that |
330 // it's valid if non-NULL. | 327 // it's valid if non-NULL. |
331 GpuMessageFilter* gpu_message_filter_; | 328 GpuMessageFilter* gpu_message_filter_; |
332 | 329 |
333 // The filter for MessagePort messages coming from the renderer. | 330 // The filter for MessagePort messages coming from the renderer. |
334 scoped_refptr<MessagePortMessageFilter> message_port_message_filter_; | 331 scoped_refptr<MessagePortMessageFilter> message_port_message_filter_; |
335 | 332 |
336 // A map of transport DIB ids to cached TransportDIBs | |
337 std::map<TransportDIB::Id, TransportDIB*> cached_dibs_; | |
338 | |
339 enum { | |
340 // This is the maximum size of |cached_dibs_| | |
341 MAX_MAPPED_TRANSPORT_DIBS = 3, | |
342 }; | |
343 | |
344 void ClearTransportDIBCache(); | |
345 // This is used to clear our cache five seconds after the last use. | |
346 base::DelayTimer<RenderProcessHostImpl> cached_dibs_cleaner_; | |
347 | |
348 // Used in single-process mode. | 333 // Used in single-process mode. |
349 scoped_ptr<base::Thread> in_process_renderer_; | 334 scoped_ptr<base::Thread> in_process_renderer_; |
350 | 335 |
351 // True after Init() has been called. We can't just check channel_ because we | 336 // True after Init() has been called. We can't just check channel_ because we |
352 // also reset that in the case of process termination. | 337 // also reset that in the case of process termination. |
353 bool is_initialized_; | 338 bool is_initialized_; |
354 | 339 |
355 // Used to launch and terminate the process without blocking the UI thread. | 340 // Used to launch and terminate the process without blocking the UI thread. |
356 scoped_ptr<ChildProcessLauncher> child_process_launcher_; | 341 scoped_ptr<ChildProcessLauncher> child_process_launcher_; |
357 | 342 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 scoped_ptr<RenderProcessHostMojoImpl> render_process_host_mojo_; | 419 scoped_ptr<RenderProcessHostMojoImpl> render_process_host_mojo_; |
435 | 420 |
436 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; | 421 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; |
437 | 422 |
438 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 423 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
439 }; | 424 }; |
440 | 425 |
441 } // namespace content | 426 } // namespace content |
442 | 427 |
443 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 428 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
OLD | NEW |