| 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 986 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 997       // connection. | 997       // connection. | 
| 998       service_manager::mojom::ServiceRequest request(&test_service_); | 998       service_manager::mojom::ServiceRequest request(&test_service_); | 
| 999       ServiceManagerConnection::SetForProcess(ServiceManagerConnection::Create( | 999       ServiceManagerConnection::SetForProcess(ServiceManagerConnection::Create( | 
| 1000           std::move(request), io_task_runner)); | 1000           std::move(request), io_task_runner)); | 
| 1001     } | 1001     } | 
| 1002     connector = ServiceManagerConnection::GetForProcess()->GetConnector(); | 1002     connector = ServiceManagerConnection::GetForProcess()->GetConnector(); | 
| 1003   } | 1003   } | 
| 1004 | 1004 | 
| 1005   // Establish a ServiceManager connection for the new render service instance. | 1005   // Establish a ServiceManager connection for the new render service instance. | 
| 1006   pending_connection_.reset(new mojo::edk::PendingProcessConnection); | 1006   pending_connection_.reset(new mojo::edk::PendingProcessConnection); | 
|  | 1007   service_manager::Identity child_identity( | 
|  | 1008       mojom::kRendererServiceName, | 
|  | 1009       BrowserContext::GetServiceUserIdFor(GetBrowserContext()), | 
|  | 1010       base::StringPrintf("%d_%d", id_, instance_id_++)); | 
| 1007   child_connection_.reset(new ChildConnection( | 1011   child_connection_.reset(new ChildConnection( | 
| 1008       mojom::kRendererServiceName, | 1012       child_identity, pending_connection_.get(), connector, io_task_runner)); | 
| 1009       base::StringPrintf("%d_%d", id_, instance_id_++), |  | 
| 1010       pending_connection_.get(), connector, io_task_runner)); |  | 
| 1011 | 1013 | 
| 1012   // Send an interface request to bootstrap the IPC::Channel. Note that this | 1014   // Send an interface request to bootstrap the IPC::Channel. Note that this | 
| 1013   // request will happily sit on the pipe until the process is launched and | 1015   // request will happily sit on the pipe until the process is launched and | 
| 1014   // connected to the ServiceManager. We take the other end immediately and | 1016   // connected to the ServiceManager. We take the other end immediately and | 
| 1015   // plug it into a new ChannelProxy. | 1017   // plug it into a new ChannelProxy. | 
| 1016   mojo::MessagePipe pipe; | 1018   mojo::MessagePipe pipe; | 
| 1017   BindInterface(IPC::mojom::ChannelBootstrap::Name_, std::move(pipe.handle1)); | 1019   BindInterface(IPC::mojom::ChannelBootstrap::Name_, std::move(pipe.handle1)); | 
| 1018   std::unique_ptr<IPC::ChannelFactory> channel_factory = | 1020   std::unique_ptr<IPC::ChannelFactory> channel_factory = | 
| 1019       IPC::ChannelMojo::CreateServerFactory(std::move(pipe.handle0), | 1021       IPC::ChannelMojo::CreateServerFactory(std::move(pipe.handle0), | 
| 1020                                             io_task_runner); | 1022                                             io_task_runner); | 
| (...skipping 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3139   LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3141   LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 
| 3140 | 3142 | 
| 3141   // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. | 3143   // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. | 
| 3142   // Capture the error message in a crash key value. | 3144   // Capture the error message in a crash key value. | 
| 3143   base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); | 3145   base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); | 
| 3144   bad_message::ReceivedBadMessage(render_process_id, | 3146   bad_message::ReceivedBadMessage(render_process_id, | 
| 3145                                   bad_message::RPH_MOJO_PROCESS_ERROR); | 3147                                   bad_message::RPH_MOJO_PROCESS_ERROR); | 
| 3146 } | 3148 } | 
| 3147 | 3149 | 
| 3148 }  // namespace content | 3150 }  // namespace content | 
| OLD | NEW | 
|---|