| 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 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 928 if (!connector) { | 928 if (!connector) { |
| 929 // Note that some embedders (e.g. Android WebView) may not initialize a | 929 // Note that some embedders (e.g. Android WebView) may not initialize a |
| 930 // Connector per BrowserContext. In those cases we fall back to the | 930 // Connector per BrowserContext. In those cases we fall back to the |
| 931 // browser-wide Connector. | 931 // browser-wide Connector. |
| 932 if (!ServiceManagerConnection::GetForProcess()) { | 932 if (!ServiceManagerConnection::GetForProcess()) { |
| 933 // Additionally, some test code may not initialize the process-wide | 933 // Additionally, some test code may not initialize the process-wide |
| 934 // ServiceManagerConnection prior to this point. This class of test code | 934 // ServiceManagerConnection prior to this point. This class of test code |
| 935 // doesn't care about render processes, so we can initialize a dummy | 935 // doesn't care about render processes, so we can initialize a dummy |
| 936 // connection. | 936 // connection. |
| 937 service_manager::mojom::ServiceRequest request = | 937 service_manager::mojom::ServiceRequest request = |
| 938 mojo::GetProxy(&test_service_); | 938 mojo::MakeRequest(&test_service_); |
| 939 ServiceManagerConnection::SetForProcess(ServiceManagerConnection::Create( | 939 ServiceManagerConnection::SetForProcess(ServiceManagerConnection::Create( |
| 940 std::move(request), io_task_runner)); | 940 std::move(request), io_task_runner)); |
| 941 } | 941 } |
| 942 connector = ServiceManagerConnection::GetForProcess()->GetConnector(); | 942 connector = ServiceManagerConnection::GetForProcess()->GetConnector(); |
| 943 } | 943 } |
| 944 | 944 |
| 945 // Establish a ServiceManager connection for the new render service instance. | 945 // Establish a ServiceManager connection for the new render service instance. |
| 946 child_connection_.reset(new ChildConnection( | 946 child_connection_.reset(new ChildConnection( |
| 947 mojom::kRendererServiceName, | 947 mojom::kRendererServiceName, |
| 948 base::StringPrintf("%d_%d", id_, instance_id_++), child_token_, connector, | 948 base::StringPrintf("%d_%d", id_, instance_id_++), child_token_, connector, |
| (...skipping 2073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3022 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3022 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
| 3023 | 3023 |
| 3024 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. | 3024 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. |
| 3025 // Capture the error message in a crash key value. | 3025 // Capture the error message in a crash key value. |
| 3026 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); | 3026 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); |
| 3027 bad_message::ReceivedBadMessage(render_process_id, | 3027 bad_message::ReceivedBadMessage(render_process_id, |
| 3028 bad_message::RPH_MOJO_PROCESS_ERROR); | 3028 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 3029 } | 3029 } |
| 3030 | 3030 |
| 3031 } // namespace content | 3031 } // namespace content |
| OLD | NEW |