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 // 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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 #endif | 489 #endif |
490 new IPC::ChannelProxy( | 490 new IPC::ChannelProxy( |
491 channel_id, IPC::Channel::MODE_SERVER, this, | 491 channel_id, IPC::Channel::MODE_SERVER, this, |
492 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); | 492 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); |
493 | 493 |
494 // Call the embedder first so that their IPC filters have priority. | 494 // Call the embedder first so that their IPC filters have priority. |
495 GetContentClient()->browser()->RenderProcessHostCreated(this); | 495 GetContentClient()->browser()->RenderProcessHostCreated(this); |
496 | 496 |
497 CreateMessageFilters(); | 497 CreateMessageFilters(); |
498 | 498 |
| 499 // Single-process mode not supported in split-dll mode. |
| 500 #if !defined(CHROME_SPLIT_DLL) |
499 if (run_renderer_in_process()) { | 501 if (run_renderer_in_process()) { |
500 // Crank up a thread and run the initialization there. With the way that | 502 // Crank up a thread and run the initialization there. With the way that |
501 // messages flow between the browser and renderer, this thread is required | 503 // messages flow between the browser and renderer, this thread is required |
502 // to prevent a deadlock in single-process mode. Since the primordial | 504 // to prevent a deadlock in single-process mode. Since the primordial |
503 // thread in the renderer process runs the WebKit code and can sometimes | 505 // thread in the renderer process runs the WebKit code and can sometimes |
504 // make blocking calls to the UI thread (i.e. this thread), they need to run | 506 // make blocking calls to the UI thread (i.e. this thread), they need to run |
505 // on separate threads. | 507 // on separate threads. |
506 in_process_renderer_.reset(new RendererMainThread(channel_id)); | 508 in_process_renderer_.reset(new RendererMainThread(channel_id)); |
507 | 509 |
508 base::Thread::Options options; | 510 base::Thread::Options options; |
509 #if defined(OS_WIN) && !defined(OS_MACOSX) | 511 #if defined(OS_WIN) && !defined(OS_MACOSX) |
510 // In-process plugins require this to be a UI message loop. | 512 // In-process plugins require this to be a UI message loop. |
511 options.message_loop_type = base::MessageLoop::TYPE_UI; | 513 options.message_loop_type = base::MessageLoop::TYPE_UI; |
512 #else | 514 #else |
513 // We can't have multiple UI loops on Linux and Android, so we don't support | 515 // We can't have multiple UI loops on Linux and Android, so we don't support |
514 // in-process plugins. | 516 // in-process plugins. |
515 options.message_loop_type = base::MessageLoop::TYPE_DEFAULT; | 517 options.message_loop_type = base::MessageLoop::TYPE_DEFAULT; |
516 #endif | 518 #endif |
517 in_process_renderer_->StartWithOptions(options); | 519 in_process_renderer_->StartWithOptions(options); |
518 | 520 |
519 OnProcessLaunched(); // Fake a callback that the process is ready. | 521 OnProcessLaunched(); // Fake a callback that the process is ready. |
520 } else { | 522 } else |
| 523 #endif // !CHROME_SPLIT_DLL |
| 524 { |
521 // Build command line for renderer. We call AppendRendererCommandLine() | 525 // Build command line for renderer. We call AppendRendererCommandLine() |
522 // first so the process type argument will appear first. | 526 // first so the process type argument will appear first. |
523 CommandLine* cmd_line = new CommandLine(renderer_path); | 527 CommandLine* cmd_line = new CommandLine(renderer_path); |
524 if (!renderer_prefix.empty()) | 528 if (!renderer_prefix.empty()) |
525 cmd_line->PrependWrapper(renderer_prefix); | 529 cmd_line->PrependWrapper(renderer_prefix); |
526 AppendRendererCommandLine(cmd_line); | 530 AppendRendererCommandLine(cmd_line); |
527 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); | 531 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); |
528 | 532 |
529 // Spawn the child process asynchronously to avoid blocking the UI thread. | 533 // Spawn the child process asynchronously to avoid blocking the UI thread. |
530 // As long as there's no renderer prefix, we can use the zygote process | 534 // As long as there's no renderer prefix, we can use the zygote process |
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1742 TRACE_EVENT0("renderer_host", | 1746 TRACE_EVENT0("renderer_host", |
1743 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); | 1747 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); |
1744 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; | 1748 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; |
1745 ack_params.sync_point = 0; | 1749 ack_params.sync_point = 0; |
1746 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, | 1750 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, |
1747 gpu_process_host_id, | 1751 gpu_process_host_id, |
1748 ack_params); | 1752 ack_params); |
1749 } | 1753 } |
1750 | 1754 |
1751 } // namespace content | 1755 } // namespace content |
OLD | NEW |