| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 #include "ipc/ipc_channel.h" | 177 #include "ipc/ipc_channel.h" |
| 178 #include "ipc/ipc_channel_mojo.h" | 178 #include "ipc/ipc_channel_mojo.h" |
| 179 #include "ipc/ipc_logging.h" | 179 #include "ipc/ipc_logging.h" |
| 180 #include "media/base/media_switches.h" | 180 #include "media/base/media_switches.h" |
| 181 #include "media/media_features.h" | 181 #include "media/media_features.h" |
| 182 #include "mojo/edk/embedder/embedder.h" | 182 #include "mojo/edk/embedder/embedder.h" |
| 183 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" | 183 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" |
| 184 #include "mojo/public/cpp/bindings/strong_binding.h" | 184 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 185 #include "net/url_request/url_request_context_getter.h" | 185 #include "net/url_request/url_request_context_getter.h" |
| 186 #include "ppapi/features/features.h" | 186 #include "ppapi/features/features.h" |
| 187 #include "services/resource_coordinator/public/cpp/resource_coordinator_interfac
e.h" |
| 187 #include "services/service_manager/embedder/switches.h" | 188 #include "services/service_manager/embedder/switches.h" |
| 188 #include "services/service_manager/public/cpp/binder_registry.h" | 189 #include "services/service_manager/public/cpp/binder_registry.h" |
| 189 #include "services/service_manager/public/cpp/connector.h" | 190 #include "services/service_manager/public/cpp/connector.h" |
| 190 #include "services/service_manager/public/cpp/interface_provider.h" | 191 #include "services/service_manager/public/cpp/interface_provider.h" |
| 191 #include "services/service_manager/runner/common/client_util.h" | 192 #include "services/service_manager/runner/common/client_util.h" |
| 192 #include "services/service_manager/runner/common/switches.h" | 193 #include "services/service_manager/runner/common/switches.h" |
| 193 #include "services/shape_detection/public/interfaces/barcodedetection.mojom.h" | 194 #include "services/shape_detection/public/interfaces/barcodedetection.mojom.h" |
| 194 #include "services/shape_detection/public/interfaces/constants.mojom.h" | 195 #include "services/shape_detection/public/interfaces/constants.mojom.h" |
| 195 #include "services/shape_detection/public/interfaces/facedetection_provider.mojo
m.h" | 196 #include "services/shape_detection/public/interfaces/facedetection_provider.mojo
m.h" |
| 196 #include "services/shape_detection/public/interfaces/textdetection.mojom.h" | 197 #include "services/shape_detection/public/interfaces/textdetection.mojom.h" |
| (...skipping 1545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1742 } | 1743 } |
| 1743 | 1744 |
| 1744 void RenderProcessHostImpl::Resume() { | 1745 void RenderProcessHostImpl::Resume() { |
| 1745 Send(new ChildProcessMsg_Resume()); | 1746 Send(new ChildProcessMsg_Resume()); |
| 1746 } | 1747 } |
| 1747 | 1748 |
| 1748 mojom::Renderer* RenderProcessHostImpl::GetRendererInterface() { | 1749 mojom::Renderer* RenderProcessHostImpl::GetRendererInterface() { |
| 1749 return renderer_interface_.get(); | 1750 return renderer_interface_.get(); |
| 1750 } | 1751 } |
| 1751 | 1752 |
| 1753 resource_coordinator::ResourceCoordinatorInterface* |
| 1754 RenderProcessHostImpl::GetProcessResourceCoordinator() { |
| 1755 if (!process_resource_coordinator_) { |
| 1756 process_resource_coordinator_ = |
| 1757 base::MakeUnique<resource_coordinator::ResourceCoordinatorInterface>( |
| 1758 ServiceManagerConnection::GetForProcess()->GetConnector(), |
| 1759 resource_coordinator::CoordinationUnitType::kProcess, |
| 1760 base::Process(GetHandle()).Pid()); |
| 1761 } |
| 1762 return process_resource_coordinator_.get(); |
| 1763 } |
| 1764 |
| 1752 void RenderProcessHostImpl::SetIsNeverSuitableForReuse() { | 1765 void RenderProcessHostImpl::SetIsNeverSuitableForReuse() { |
| 1753 is_never_suitable_for_reuse_ = true; | 1766 is_never_suitable_for_reuse_ = true; |
| 1754 } | 1767 } |
| 1755 | 1768 |
| 1756 bool RenderProcessHostImpl::MayReuseHost() { | 1769 bool RenderProcessHostImpl::MayReuseHost() { |
| 1757 if (is_never_suitable_for_reuse_) | 1770 if (is_never_suitable_for_reuse_) |
| 1758 return false; | 1771 return false; |
| 1759 | 1772 |
| 1760 return GetContentClient()->browser()->MayReuseHost(this); | 1773 return GetContentClient()->browser()->MayReuseHost(this); |
| 1761 } | 1774 } |
| (...skipping 1811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3573 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3586 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
| 3574 | 3587 |
| 3575 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. | 3588 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. |
| 3576 // Capture the error message in a crash key value. | 3589 // Capture the error message in a crash key value. |
| 3577 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); | 3590 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); |
| 3578 bad_message::ReceivedBadMessage(render_process_id, | 3591 bad_message::ReceivedBadMessage(render_process_id, |
| 3579 bad_message::RPH_MOJO_PROCESS_ERROR); | 3592 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 3580 } | 3593 } |
| 3581 | 3594 |
| 3582 } // namespace content | 3595 } // namespace content |
| OLD | NEW |