OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/browser_render_process_host.h" | 8 #include "chrome/browser/renderer_host/browser_render_process_host.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 audio_renderer_host_->Destroy(); | 240 audio_renderer_host_->Destroy(); |
241 | 241 |
242 ClearTransportDIBCache(); | 242 ClearTransportDIBCache(); |
243 | 243 |
244 NotificationService::current()->Notify( | 244 NotificationService::current()->Notify( |
245 NotificationType::EXTENSION_PORT_DELETED_DEBUG, | 245 NotificationType::EXTENSION_PORT_DELETED_DEBUG, |
246 Source<IPC::Message::Sender>(this), | 246 Source<IPC::Message::Sender>(this), |
247 NotificationService::NoDetails()); | 247 NotificationService::NoDetails()); |
248 } | 248 } |
249 | 249 |
250 bool BrowserRenderProcessHost::Init(bool is_extensions_process, | 250 bool BrowserRenderProcessHost::Init(bool is_extensions_process) { |
251 URLRequestContextGetter* request_context) { | |
252 // calling Init() more than once does nothing, this makes it more convenient | 251 // calling Init() more than once does nothing, this makes it more convenient |
253 // for the view host which may not be sure in some cases | 252 // for the view host which may not be sure in some cases |
254 if (channel_.get()) | 253 if (channel_.get()) |
255 return true; | 254 return true; |
256 | 255 |
257 // It is possible for an extension process to be reused for non-extension | 256 // It is possible for an extension process to be reused for non-extension |
258 // content, e.g. if an extension calls window.open. | 257 // content, e.g. if an extension calls window.open. |
259 extension_process_ = extension_process_ || is_extensions_process; | 258 extension_process_ = extension_process_ || is_extensions_process; |
260 | 259 |
261 // run the IPC channel on the shared IO thread. | 260 // run the IPC channel on the shared IO thread. |
262 base::Thread* io_thread = g_browser_process->io_thread(); | 261 base::Thread* io_thread = g_browser_process->io_thread(); |
263 | 262 |
264 // Construct the AudioRendererHost with the IO thread. | 263 // Construct the AudioRendererHost with the IO thread. |
265 audio_renderer_host_ = new AudioRendererHost(); | 264 audio_renderer_host_ = new AudioRendererHost(); |
266 | 265 |
267 scoped_refptr<ResourceMessageFilter> resource_message_filter = | 266 scoped_refptr<ResourceMessageFilter> resource_message_filter = |
268 new ResourceMessageFilter(g_browser_process->resource_dispatcher_host(), | 267 new ResourceMessageFilter(g_browser_process->resource_dispatcher_host(), |
269 id(), | 268 id(), |
270 audio_renderer_host_.get(), | 269 audio_renderer_host_.get(), |
271 PluginService::GetInstance(), | 270 PluginService::GetInstance(), |
272 g_browser_process->print_job_manager(), | 271 g_browser_process->print_job_manager(), |
273 profile(), | 272 profile(), |
274 widget_helper_, | 273 widget_helper_); |
275 request_context); | |
276 | 274 |
277 std::wstring renderer_prefix; | 275 std::wstring renderer_prefix; |
278 #if defined(OS_POSIX) | 276 #if defined(OS_POSIX) |
279 // A command prefix is something prepended to the command line of the spawned | 277 // A command prefix is something prepended to the command line of the spawned |
280 // process. It is supported only on POSIX systems. | 278 // process. It is supported only on POSIX systems. |
281 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 279 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
282 renderer_prefix = | 280 renderer_prefix = |
283 browser_command_line.GetSwitchValue(switches::kRendererCmdPrefix); | 281 browser_command_line.GetSwitchValue(switches::kRendererCmdPrefix); |
284 #endif // defined(OS_POSIX) | 282 #endif // defined(OS_POSIX) |
285 | 283 |
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 IPC::InvalidPlatformFileForTransit(), | 1064 IPC::InvalidPlatformFileForTransit(), |
1067 std::vector<std::string>(), | 1065 std::vector<std::string>(), |
1068 std::string(), | 1066 std::string(), |
1069 false)); | 1067 false)); |
1070 } | 1068 } |
1071 } | 1069 } |
1072 | 1070 |
1073 void BrowserRenderProcessHost::EnableAutoSpellCorrect(bool enable) { | 1071 void BrowserRenderProcessHost::EnableAutoSpellCorrect(bool enable) { |
1074 Send(new ViewMsg_SpellChecker_EnableAutoSpellCorrect(enable)); | 1072 Send(new ViewMsg_SpellChecker_EnableAutoSpellCorrect(enable)); |
1075 } | 1073 } |
OLD | NEW |