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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 // It is possible for an extension process to be reused for non-extension | 290 // It is possible for an extension process to be reused for non-extension |
291 // content, e.g. if an extension calls window.open. | 291 // content, e.g. if an extension calls window.open. |
292 extension_process_ = extension_process_ || is_extensions_process; | 292 extension_process_ = extension_process_ || is_extensions_process; |
293 | 293 |
294 // run the IPC channel on the shared IO thread. | 294 // run the IPC channel on the shared IO thread. |
295 base::Thread* io_thread = g_browser_process->io_thread(); | 295 base::Thread* io_thread = g_browser_process->io_thread(); |
296 | 296 |
297 // Construct the AudioRendererHost with the IO thread. | 297 // Construct the AudioRendererHost with the IO thread. |
298 audio_renderer_host_ = new AudioRendererHost(); | 298 audio_renderer_host_ = new AudioRendererHost(); |
299 | 299 |
300 scoped_refptr<ResourceMessageFilter> resource_message_filter = | 300 scoped_refptr<ResourceMessageFilter> resource_message_filter( |
301 new ResourceMessageFilter(g_browser_process->resource_dispatcher_host(), | 301 new ResourceMessageFilter(g_browser_process->resource_dispatcher_host(), |
302 id(), | 302 id(), |
303 audio_renderer_host_.get(), | 303 audio_renderer_host_.get(), |
304 PluginService::GetInstance(), | 304 PluginService::GetInstance(), |
305 g_browser_process->print_job_manager(), | 305 g_browser_process->print_job_manager(), |
306 profile(), | 306 profile(), |
307 widget_helper_); | 307 widget_helper_)); |
308 | 308 |
309 CommandLine::StringType renderer_prefix; | 309 CommandLine::StringType renderer_prefix; |
310 #if defined(OS_POSIX) | 310 #if defined(OS_POSIX) |
311 // A command prefix is something prepended to the command line of the spawned | 311 // A command prefix is something prepended to the command line of the spawned |
312 // process. It is supported only on POSIX systems. | 312 // process. It is supported only on POSIX systems. |
313 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 313 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
314 renderer_prefix = | 314 renderer_prefix = |
315 browser_command_line.GetSwitchValueNative(switches::kRendererCmdPrefix); | 315 browser_command_line.GetSwitchValueNative(switches::kRendererCmdPrefix); |
316 #endif // defined(OS_POSIX) | 316 #endif // defined(OS_POSIX) |
317 | 317 |
(...skipping 10 matching lines...) Expand all Loading... |
328 channel_.reset( | 328 channel_.reset( |
329 new IPC::SyncChannel(channel_id, IPC::Channel::MODE_SERVER, this, | 329 new IPC::SyncChannel(channel_id, IPC::Channel::MODE_SERVER, this, |
330 resource_message_filter, | 330 resource_message_filter, |
331 io_thread->message_loop(), true, | 331 io_thread->message_loop(), true, |
332 g_browser_process->shutdown_event())); | 332 g_browser_process->shutdown_event())); |
333 // As a preventive mesure, we DCHECK if someone sends a synchronous message | 333 // As a preventive mesure, we DCHECK if someone sends a synchronous message |
334 // with no time-out, which in the context of the browser process we should not | 334 // with no time-out, which in the context of the browser process we should not |
335 // be doing. | 335 // be doing. |
336 channel_->set_sync_messages_with_no_timeout_allowed(false); | 336 channel_->set_sync_messages_with_no_timeout_allowed(false); |
337 | 337 |
338 scoped_refptr<PepperFileMessageFilter> pepper_file_message_filter = | 338 scoped_refptr<PepperFileMessageFilter> pepper_file_message_filter( |
339 new PepperFileMessageFilter(id(), profile()); | 339 new PepperFileMessageFilter(id(), profile())); |
340 channel_->AddFilter(pepper_file_message_filter); | 340 channel_->AddFilter(pepper_file_message_filter); |
341 | 341 |
342 if (run_renderer_in_process()) { | 342 if (run_renderer_in_process()) { |
343 // Crank up a thread and run the initialization there. With the way that | 343 // Crank up a thread and run the initialization there. With the way that |
344 // messages flow between the browser and renderer, this thread is required | 344 // messages flow between the browser and renderer, this thread is required |
345 // to prevent a deadlock in single-process mode. Since the primordial | 345 // to prevent a deadlock in single-process mode. Since the primordial |
346 // thread in the renderer process runs the WebKit code and can sometimes | 346 // thread in the renderer process runs the WebKit code and can sometimes |
347 // make blocking calls to the UI thread (i.e. this thread), they need to run | 347 // make blocking calls to the UI thread (i.e. this thread), they need to run |
348 // on separate threads. | 348 // on separate threads. |
349 in_process_renderer_.reset(new RendererMainThread(channel_id)); | 349 in_process_renderer_.reset(new RendererMainThread(channel_id)); |
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1142 IPC::InvalidPlatformFileForTransit(), | 1142 IPC::InvalidPlatformFileForTransit(), |
1143 std::vector<std::string>(), | 1143 std::vector<std::string>(), |
1144 std::string(), | 1144 std::string(), |
1145 false)); | 1145 false)); |
1146 } | 1146 } |
1147 } | 1147 } |
1148 | 1148 |
1149 void BrowserRenderProcessHost::EnableAutoSpellCorrect(bool enable) { | 1149 void BrowserRenderProcessHost::EnableAutoSpellCorrect(bool enable) { |
1150 Send(new ViewMsg_SpellChecker_EnableAutoSpellCorrect(enable)); | 1150 Send(new ViewMsg_SpellChecker_EnableAutoSpellCorrect(enable)); |
1151 } | 1151 } |
OLD | NEW |