OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "content/child/child_thread_impl.h" | 5 #include "content/child/child_thread_impl.h" |
6 | 6 |
7 #include <signal.h> | 7 #include <signal.h> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 #include "ipc/ipc_sync_channel.h" | 60 #include "ipc/ipc_sync_channel.h" |
61 #include "ipc/ipc_sync_message_filter.h" | 61 #include "ipc/ipc_sync_message_filter.h" |
62 #include "mojo/edk/embedder/embedder.h" | 62 #include "mojo/edk/embedder/embedder.h" |
63 #include "mojo/edk/embedder/incoming_broker_client_invitation.h" | 63 #include "mojo/edk/embedder/incoming_broker_client_invitation.h" |
64 #include "mojo/edk/embedder/named_platform_channel_pair.h" | 64 #include "mojo/edk/embedder/named_platform_channel_pair.h" |
65 #include "mojo/edk/embedder/platform_channel_pair.h" | 65 #include "mojo/edk/embedder/platform_channel_pair.h" |
66 #include "mojo/edk/embedder/scoped_ipc_support.h" | 66 #include "mojo/edk/embedder/scoped_ipc_support.h" |
67 #include "mojo/public/cpp/system/buffer.h" | 67 #include "mojo/public/cpp/system/buffer.h" |
68 #include "mojo/public/cpp/system/platform_handle.h" | 68 #include "mojo/public/cpp/system/platform_handle.h" |
69 #include "services/device/public/cpp/power_monitor/power_monitor_broadcast_sourc
e.h" | 69 #include "services/device/public/cpp/power_monitor/power_monitor_broadcast_sourc
e.h" |
70 #include "services/resource_coordinator/public/cpp/memory/process_local_dump_man
ager_impl.h" | 70 #include "services/resource_coordinator/public/cpp/memory_instrumentation/client
_process_impl.h" |
71 #include "services/resource_coordinator/public/interfaces/memory/memory_instrume
ntation.mojom.h" | 71 #include "services/resource_coordinator/public/interfaces/memory_instrumentation
/memory_instrumentation.mojom.h" |
72 #include "services/service_manager/public/cpp/connector.h" | 72 #include "services/service_manager/public/cpp/connector.h" |
73 #include "services/service_manager/public/cpp/interface_provider.h" | 73 #include "services/service_manager/public/cpp/interface_provider.h" |
74 #include "services/service_manager/runner/common/client_util.h" | 74 #include "services/service_manager/runner/common/client_util.h" |
75 | 75 |
76 #if defined(OS_POSIX) | 76 #if defined(OS_POSIX) |
77 #include "base/posix/global_descriptors.h" | 77 #include "base/posix/global_descriptors.h" |
78 #include "content/public/common/content_descriptors.h" | 78 #include "content/public/common/content_descriptors.h" |
79 #endif | 79 #endif |
80 | 80 |
81 #if defined(OS_MACOSX) | 81 #if defined(OS_MACOSX) |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 auto process_type = memory_instrumentation::mojom::ProcessType::OTHER; | 503 auto process_type = memory_instrumentation::mojom::ProcessType::OTHER; |
504 if (process_type_str == switches::kRendererProcess) | 504 if (process_type_str == switches::kRendererProcess) |
505 process_type = memory_instrumentation::mojom::ProcessType::RENDERER; | 505 process_type = memory_instrumentation::mojom::ProcessType::RENDERER; |
506 else if (process_type_str == switches::kGpuProcess) | 506 else if (process_type_str == switches::kGpuProcess) |
507 process_type = memory_instrumentation::mojom::ProcessType::GPU; | 507 process_type = memory_instrumentation::mojom::ProcessType::GPU; |
508 else if (process_type_str == switches::kUtilityProcess) | 508 else if (process_type_str == switches::kUtilityProcess) |
509 process_type = memory_instrumentation::mojom::ProcessType::UTILITY; | 509 process_type = memory_instrumentation::mojom::ProcessType::UTILITY; |
510 else if (process_type_str == switches::kPpapiPluginProcess) | 510 else if (process_type_str == switches::kPpapiPluginProcess) |
511 process_type = memory_instrumentation::mojom::ProcessType::PLUGIN; | 511 process_type = memory_instrumentation::mojom::ProcessType::PLUGIN; |
512 | 512 |
513 memory_instrumentation::ProcessLocalDumpManagerImpl::Config config( | 513 memory_instrumentation::ClientProcessImpl::Config config( |
514 GetConnector(), mojom::kBrowserServiceName, process_type); | 514 GetConnector(), mojom::kBrowserServiceName, process_type); |
515 memory_instrumentation::ProcessLocalDumpManagerImpl::CreateInstance( | 515 memory_instrumentation::ClientProcessImpl::CreateInstance(config); |
516 config); | |
517 } | 516 } |
518 } | 517 } |
519 | 518 |
520 // In single process mode we may already have a power monitor, | 519 // In single process mode we may already have a power monitor, |
521 // also for some edge cases where there is no ServiceManagerConnection, we do | 520 // also for some edge cases where there is no ServiceManagerConnection, we do |
522 // not create the power monitor. | 521 // not create the power monitor. |
523 if (!base::PowerMonitor::Get() && service_manager_connection_) { | 522 if (!base::PowerMonitor::Get() && service_manager_connection_) { |
524 auto power_monitor_source = | 523 auto power_monitor_source = |
525 base::MakeUnique<device::PowerMonitorBroadcastSource>(GetConnector()); | 524 base::MakeUnique<device::PowerMonitorBroadcastSource>(GetConnector()); |
526 power_monitor_.reset( | 525 power_monitor_.reset( |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 Listener* route = router_.GetRoute(routing_id); | 841 Listener* route = router_.GetRoute(routing_id); |
843 if (route) | 842 if (route) |
844 route->OnAssociatedInterfaceRequest(name, request.PassHandle()); | 843 route->OnAssociatedInterfaceRequest(name, request.PassHandle()); |
845 } | 844 } |
846 | 845 |
847 bool ChildThreadImpl::IsInBrowserProcess() const { | 846 bool ChildThreadImpl::IsInBrowserProcess() const { |
848 return static_cast<bool>(browser_process_io_runner_); | 847 return static_cast<bool>(browser_process_io_runner_); |
849 } | 848 } |
850 | 849 |
851 } // namespace content | 850 } // namespace content |
OLD | NEW |