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

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

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 // Represents the browser side of the browser <--> renderer communication 5 // Represents the browser side of the browser <--> renderer communication
6 // channel. There will be one RenderProcessHost per renderer process. 6 // channel. There will be one RenderProcessHost per renderer process.
7 7
8 #include "content/browser/renderer_host/render_process_host_impl.h" 8 #include "content/browser/renderer_host/render_process_host_impl.h"
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 #include "content/public/common/process_type.h" 130 #include "content/public/common/process_type.h"
131 #include "content/public/common/resource_type.h" 131 #include "content/public/common/resource_type.h"
132 #include "content/public/common/result_codes.h" 132 #include "content/public/common/result_codes.h"
133 #include "content/public/common/sandboxed_process_launcher_delegate.h" 133 #include "content/public/common/sandboxed_process_launcher_delegate.h"
134 #include "content/public/common/url_constants.h" 134 #include "content/public/common/url_constants.h"
135 #include "gpu/command_buffer/service/gpu_switches.h" 135 #include "gpu/command_buffer/service/gpu_switches.h"
136 #include "ipc/ipc_channel.h" 136 #include "ipc/ipc_channel.h"
137 #include "ipc/ipc_logging.h" 137 #include "ipc/ipc_logging.h"
138 #include "ipc/ipc_switches.h" 138 #include "ipc/ipc_switches.h"
139 #include "ipc/mojo/ipc_channel_mojo.h" 139 #include "ipc/mojo/ipc_channel_mojo.h"
140 #include "ipc/mojo/ipc_channel_mojo_host.h"
141 #include "media/base/media_switches.h" 140 #include "media/base/media_switches.h"
142 #include "net/url_request/url_request_context_getter.h" 141 #include "net/url_request/url_request_context_getter.h"
143 #include "ppapi/shared_impl/ppapi_switches.h" 142 #include "ppapi/shared_impl/ppapi_switches.h"
144 #include "storage/browser/fileapi/sandbox_file_system_backend.h" 143 #include "storage/browser/fileapi/sandbox_file_system_backend.h"
145 #include "third_party/skia/include/core/SkBitmap.h" 144 #include "third_party/skia/include/core/SkBitmap.h"
146 #include "ui/base/ui_base_switches.h" 145 #include "ui/base/ui_base_switches.h"
147 #include "ui/events/event_switches.h" 146 #include "ui/events/event_switches.h"
148 #include "ui/gfx/switches.h" 147 #include "ui/gfx/switches.h"
149 #include "ui/gl/gl_switches.h" 148 #include "ui/gl/gl_switches.h"
150 #include "ui/native_theme/native_theme_switches.h" 149 #include "ui/native_theme/native_theme_switches.h"
(...skipping 1949 matching lines...) Expand 10 before | Expand all | Expand 10 after
2100 NotificationService::current()->Notify( 2099 NotificationService::current()->Notify(
2101 NOTIFICATION_RENDERER_PROCESS_CREATED, 2100 NOTIFICATION_RENDERER_PROCESS_CREATED,
2102 Source<RenderProcessHost>(this), 2101 Source<RenderProcessHost>(this),
2103 NotificationService::NoDetails()); 2102 NotificationService::NoDetails());
2104 2103
2105 // Allow Mojo to be setup before the renderer sees any Chrome IPC messages. 2104 // Allow Mojo to be setup before the renderer sees any Chrome IPC messages.
2106 // This way, Mojo can be safely used from the renderer in response to any 2105 // This way, Mojo can be safely used from the renderer in response to any
2107 // Chrome IPC message. 2106 // Chrome IPC message.
2108 MaybeActivateMojo(); 2107 MaybeActivateMojo();
2109 2108
2110 if (channel_mojo_host_) 2109 if (channel_mojo_host_) {
2111 channel_mojo_host_->OnClientLaunched(child_process_launcher_->GetHandle()); 2110 base::ProcessHandle process = child_process_launcher_
viettrungluu 2014/09/25 19:38:34 When can child_process_launcher_ be null? Maybe yo
Hajime Morrita 2014/09/25 22:00:03 Done.
2111 ? child_process_launcher_->GetHandle()
2112 : base::GetCurrentProcessHandle();
2113 channel_mojo_host_->OnClientLaunched(process);
2114 }
2112 2115
2113 while (!queued_messages_.empty()) { 2116 while (!queued_messages_.empty()) {
2114 Send(queued_messages_.front()); 2117 Send(queued_messages_.front());
2115 queued_messages_.pop(); 2118 queued_messages_.pop();
2116 } 2119 }
2117 2120
2118 #if defined(ENABLE_WEBRTC) 2121 #if defined(ENABLE_WEBRTC)
2119 if (WebRTCInternals::GetInstance()->aec_dump_enabled()) 2122 if (WebRTCInternals::GetInstance()->aec_dump_enabled())
2120 EnableAecDump(WebRTCInternals::GetInstance()->aec_dump_file_path()); 2123 EnableAecDump(WebRTCInternals::GetInstance()->aec_dump_file_path());
2121 #endif 2124 #endif
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
2248 if (worker_ref_count_ == 0) 2251 if (worker_ref_count_ == 0)
2249 Cleanup(); 2252 Cleanup();
2250 } 2253 }
2251 2254
2252 void RenderProcessHostImpl::EnsureMojoActivated() { 2255 void RenderProcessHostImpl::EnsureMojoActivated() {
2253 mojo_activation_required_ = true; 2256 mojo_activation_required_ = true;
2254 MaybeActivateMojo(); 2257 MaybeActivateMojo();
2255 } 2258 }
2256 2259
2257 } // namespace content 2260 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698