| 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 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1420 RenderProcessHost* host) { | 1420 RenderProcessHost* host) { |
| 1421 AssociatedInterfaceHolder<mojom::Renderer>* holder = | 1421 AssociatedInterfaceHolder<mojom::Renderer>* holder = |
| 1422 static_cast<AssociatedInterfaceHolder<mojom::Renderer>*>( | 1422 static_cast<AssociatedInterfaceHolder<mojom::Renderer>*>( |
| 1423 host->GetUserData(kRendererInterfaceKeyName)); | 1423 host->GetUserData(kRendererInterfaceKeyName)); |
| 1424 if (!holder) { | 1424 if (!holder) { |
| 1425 // In tests, MockRenderProcessHost will not have initialized this key on its | 1425 // In tests, MockRenderProcessHost will not have initialized this key on its |
| 1426 // own. We do it with a dead-end endpoint so outgoing requests are silently | 1426 // own. We do it with a dead-end endpoint so outgoing requests are silently |
| 1427 // dropped. | 1427 // dropped. |
| 1428 holder = new AssociatedInterfaceHolder<mojom::Renderer>; | 1428 holder = new AssociatedInterfaceHolder<mojom::Renderer>; |
| 1429 host->SetUserData(kRendererInterfaceKeyName, holder); | 1429 host->SetUserData(kRendererInterfaceKeyName, holder); |
| 1430 mojo::GetDummyProxyForTesting(&holder->proxy()); | 1430 mojo::GetIsolatedProxy(&holder->proxy()); |
| 1431 } | 1431 } |
| 1432 | 1432 |
| 1433 return holder->proxy().get(); | 1433 return holder->proxy().get(); |
| 1434 } | 1434 } |
| 1435 | 1435 |
| 1436 void RenderProcessHostImpl::AddRoute(int32_t routing_id, | 1436 void RenderProcessHostImpl::AddRoute(int32_t routing_id, |
| 1437 IPC::Listener* listener) { | 1437 IPC::Listener* listener) { |
| 1438 CHECK(!listeners_.Lookup(routing_id)) << "Found Routing ID Conflict: " | 1438 CHECK(!listeners_.Lookup(routing_id)) << "Found Routing ID Conflict: " |
| 1439 << routing_id; | 1439 << routing_id; |
| 1440 listeners_.AddWithID(listener, routing_id); | 1440 listeners_.AddWithID(listener, routing_id); |
| (...skipping 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3029 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3029 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
| 3030 | 3030 |
| 3031 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 3031 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
| 3032 // enough information here so that we can determine what the bad message was. | 3032 // enough information here so that we can determine what the bad message was. |
| 3033 base::debug::Alias(&error); | 3033 base::debug::Alias(&error); |
| 3034 bad_message::ReceivedBadMessage(render_process_id, | 3034 bad_message::ReceivedBadMessage(render_process_id, |
| 3035 bad_message::RPH_MOJO_PROCESS_ERROR); | 3035 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 3036 } | 3036 } |
| 3037 | 3037 |
| 3038 } // namespace content | 3038 } // namespace content |
| OLD | NEW |