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

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.h

Issue 599333002: ChannelMojo: Handle when ChannelMojo outlives ChannelMojoHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
OLDNEW
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/dom_storage/session_storage_namespace_impl.h" 17 #include "content/browser/dom_storage/session_storage_namespace_impl.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/common/mojo/service_registry_impl.h" 20 #include "content/common/mojo/service_registry_impl.h"
21 #include "content/public/browser/gpu_data_manager_observer.h" 21 #include "content/public/browser/gpu_data_manager_observer.h"
22 #include "content/public/browser/render_process_host.h" 22 #include "content/public/browser/render_process_host.h"
23 #include "ipc/ipc_channel_proxy.h" 23 #include "ipc/ipc_channel_proxy.h"
24 #include "ipc/ipc_platform_file.h" 24 #include "ipc/ipc_platform_file.h"
25 #include "ipc/mojo/ipc_channel_mojo_host.h"
25 #include "mojo/public/cpp/bindings/interface_ptr.h" 26 #include "mojo/public/cpp/bindings/interface_ptr.h"
26 #include "ui/gfx/gpu_memory_buffer.h" 27 #include "ui/gfx/gpu_memory_buffer.h"
27 28
28 namespace base { 29 namespace base {
29 class CommandLine; 30 class CommandLine;
30 class MessageLoop; 31 class MessageLoop;
31 } 32 }
32 33
33 namespace gfx { 34 namespace gfx {
34 class Size; 35 class Size;
35 } 36 }
36 37
37 namespace IPC {
38 class ChannelMojoHost;
39 }
40
41 namespace content { 38 namespace content {
42 class AudioRendererHost; 39 class AudioRendererHost;
43 class BrowserCdmManager; 40 class BrowserCdmManager;
44 class BrowserDemuxerAndroid; 41 class BrowserDemuxerAndroid;
45 class GpuMessageFilter; 42 class GpuMessageFilter;
46 class MessagePortMessageFilter; 43 class MessagePortMessageFilter;
47 class MojoApplicationHost; 44 class MojoApplicationHost;
48 #if defined(ENABLE_WEBRTC) 45 #if defined(ENABLE_WEBRTC)
49 class P2PSocketDispatcherHost; 46 class P2PSocketDispatcherHost;
50 #endif 47 #endif
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 // Activates Mojo for this process. Does nothing if Mojo is already activated. 256 // Activates Mojo for this process. Does nothing if Mojo is already activated.
260 void EnsureMojoActivated(); 257 void EnsureMojoActivated();
261 258
262 protected: 259 protected:
263 // A proxy for our IPC::Channel that lives on the IO thread (see 260 // A proxy for our IPC::Channel that lives on the IO thread (see
264 // browser_process.h) 261 // browser_process.h)
265 scoped_ptr<IPC::ChannelProxy> channel_; 262 scoped_ptr<IPC::ChannelProxy> channel_;
266 263
267 // A host object ChannelMojo needs. The lifetime is bound to 264 // A host object ChannelMojo needs. The lifetime is bound to
268 // the RenderProcessHostImpl, not the channel. 265 // the RenderProcessHostImpl, not the channel.
269 scoped_ptr<IPC::ChannelMojoHost> channel_mojo_host_; 266 scoped_ptr<IPC::ChannelMojoHost, IPC::ChannelMojoHostDeleter>
viettrungluu 2014/09/25 19:38:34 In general, this seems fragile/awkward to me. It
Hajime Morrita 2014/09/25 22:00:03 Thanks for the suggestion! This totally makes sens
267 channel_mojo_host_;
270 268
271 // True if fast shutdown has been performed on this RPH. 269 // True if fast shutdown has been performed on this RPH.
272 bool fast_shutdown_started_; 270 bool fast_shutdown_started_;
273 271
274 // True if we've posted a DeleteTask and will be deleted soon. 272 // True if we've posted a DeleteTask and will be deleted soon.
275 bool deleting_soon_; 273 bool deleting_soon_;
276 274
277 #ifndef NDEBUG 275 #ifndef NDEBUG
278 // True if this object has deleted itself. 276 // True if this object has deleted itself.
279 bool is_self_deleted_; 277 bool is_self_deleted_;
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 base::TimeTicks survive_for_worker_start_time_; 454 base::TimeTicks survive_for_worker_start_time_;
457 455
458 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; 456 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_;
459 457
460 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); 458 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl);
461 }; 459 };
462 460
463 } // namespace content 461 } // namespace content
464 462
465 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ 463 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698