OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 // Crank up a thread and run the initialization there. With the way that | 826 // Crank up a thread and run the initialization there. With the way that |
827 // messages flow between the browser and renderer, this thread is required | 827 // messages flow between the browser and renderer, this thread is required |
828 // to prevent a deadlock in single-process mode. Since the primordial | 828 // to prevent a deadlock in single-process mode. Since the primordial |
829 // thread in the renderer process runs the WebKit code and can sometimes | 829 // thread in the renderer process runs the WebKit code and can sometimes |
830 // make blocking calls to the UI thread (i.e. this thread), they need to run | 830 // make blocking calls to the UI thread (i.e. this thread), they need to run |
831 // on separate threads. | 831 // on separate threads. |
832 in_process_renderer_.reset( | 832 in_process_renderer_.reset( |
833 g_renderer_main_thread_factory(InProcessChildThreadParams( | 833 g_renderer_main_thread_factory(InProcessChildThreadParams( |
834 channel_id, | 834 channel_id, |
835 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), | 835 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), |
836 std::string(), mojo_child_connection_->service_token()))); | 836 mojo_child_connection_->service_token()))); |
837 | 837 |
838 base::Thread::Options options; | 838 base::Thread::Options options; |
839 #if defined(OS_WIN) && !defined(OS_MACOSX) | 839 #if defined(OS_WIN) && !defined(OS_MACOSX) |
840 // In-process plugins require this to be a UI message loop. | 840 // In-process plugins require this to be a UI message loop. |
841 options.message_loop_type = base::MessageLoop::TYPE_UI; | 841 options.message_loop_type = base::MessageLoop::TYPE_UI; |
842 #else | 842 #else |
843 // We can't have multiple UI loops on Linux and Android, so we don't support | 843 // We can't have multiple UI loops on Linux and Android, so we don't support |
844 // in-process plugins. | 844 // in-process plugins. |
845 options.message_loop_type = base::MessageLoop::TYPE_DEFAULT; | 845 options.message_loop_type = base::MessageLoop::TYPE_DEFAULT; |
846 #endif | 846 #endif |
(...skipping 1996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2843 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 2843 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
2844 | 2844 |
2845 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 2845 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
2846 // enough information here so that we can determine what the bad message was. | 2846 // enough information here so that we can determine what the bad message was. |
2847 base::debug::Alias(&error); | 2847 base::debug::Alias(&error); |
2848 bad_message::ReceivedBadMessage(process.get(), | 2848 bad_message::ReceivedBadMessage(process.get(), |
2849 bad_message::RPH_MOJO_PROCESS_ERROR); | 2849 bad_message::RPH_MOJO_PROCESS_ERROR); |
2850 } | 2850 } |
2851 | 2851 |
2852 } // namespace content | 2852 } // namespace content |
OLD | NEW |