| 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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 IPC::Channel::MODE_SERVER, | 498 IPC::Channel::MODE_SERVER, |
| 499 this, | 499 this, |
| 500 BrowserThread::GetMessageLoopProxyForThread( | 500 BrowserThread::GetMessageLoopProxyForThread( |
| 501 BrowserThread::IO).get())); | 501 BrowserThread::IO).get())); |
| 502 | 502 |
| 503 // Call the embedder first so that their IPC filters have priority. | 503 // Call the embedder first so that their IPC filters have priority. |
| 504 GetContentClient()->browser()->RenderProcessHostCreated(this); | 504 GetContentClient()->browser()->RenderProcessHostCreated(this); |
| 505 | 505 |
| 506 CreateMessageFilters(); | 506 CreateMessageFilters(); |
| 507 | 507 |
| 508 // Single-process mode not supported in multiple-dll mode currently. | 508 if (run_renderer_in_process()) { |
| 509 if (run_renderer_in_process() && g_renderer_main_thread_factory) { | 509 DCHECK(g_renderer_main_thread_factory); |
| 510 // Crank up a thread and run the initialization there. With the way that | 510 // Crank up a thread and run the initialization there. With the way that |
| 511 // messages flow between the browser and renderer, this thread is required | 511 // messages flow between the browser and renderer, this thread is required |
| 512 // to prevent a deadlock in single-process mode. Since the primordial | 512 // to prevent a deadlock in single-process mode. Since the primordial |
| 513 // thread in the renderer process runs the WebKit code and can sometimes | 513 // thread in the renderer process runs the WebKit code and can sometimes |
| 514 // make blocking calls to the UI thread (i.e. this thread), they need to run | 514 // make blocking calls to the UI thread (i.e. this thread), they need to run |
| 515 // on separate threads. | 515 // on separate threads. |
| 516 in_process_renderer_.reset(g_renderer_main_thread_factory(channel_id)); | 516 in_process_renderer_.reset(g_renderer_main_thread_factory(channel_id)); |
| 517 | 517 |
| 518 base::Thread::Options options; | 518 base::Thread::Options options; |
| 519 #if defined(OS_WIN) && !defined(OS_MACOSX) | 519 #if defined(OS_WIN) && !defined(OS_MACOSX) |
| (...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1894 // Skip widgets in other processes. | 1894 // Skip widgets in other processes. |
| 1895 if (widget->GetProcess()->GetID() != GetID()) | 1895 if (widget->GetProcess()->GetID() != GetID()) |
| 1896 continue; | 1896 continue; |
| 1897 | 1897 |
| 1898 RenderViewHost* rvh = RenderViewHost::From(widget); | 1898 RenderViewHost* rvh = RenderViewHost::From(widget); |
| 1899 rvh->UpdateWebkitPreferences(rvh->GetWebkitPreferences()); | 1899 rvh->UpdateWebkitPreferences(rvh->GetWebkitPreferences()); |
| 1900 } | 1900 } |
| 1901 } | 1901 } |
| 1902 | 1902 |
| 1903 } // namespace content | 1903 } // namespace content |
| OLD | NEW |