| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/chromeos/chrome_browser_main_chromeos.h" | 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 } // namespace | 191 } // namespace |
| 192 | 192 |
| 193 namespace internal { | 193 namespace internal { |
| 194 | 194 |
| 195 // Wrapper class for initializing dbus related services and shutting them | 195 // Wrapper class for initializing dbus related services and shutting them |
| 196 // down. This gets instantiated in a scoped_ptr so that shutdown methods in the | 196 // down. This gets instantiated in a scoped_ptr so that shutdown methods in the |
| 197 // destructor will get called if and only if this has been instantiated. | 197 // destructor will get called if and only if this has been instantiated. |
| 198 class DBusServices { | 198 class DBusServices { |
| 199 public: | 199 public: |
| 200 explicit DBusServices(const content::MainFunctionParams& parameters) { | 200 explicit DBusServices(const content::MainFunctionParams& parameters) { |
| 201 // Under mash, some D-Bus clients are owned by other processes. |
| 202 DBusThreadManager::ProcessMask process_mask = |
| 203 chrome::IsRunningInMash() ? DBusThreadManager::PROCESS_BROWSER |
| 204 : DBusThreadManager::PROCESS_ALL; |
| 205 |
| 201 // Initialize DBusThreadManager for the browser. This must be done after | 206 // Initialize DBusThreadManager for the browser. This must be done after |
| 202 // the main message loop is started, as it uses the message loop. | 207 // the main message loop is started, as it uses the message loop. |
| 203 DBusThreadManager::Initialize(); | 208 DBusThreadManager::Initialize(process_mask); |
| 204 | 209 |
| 205 bluez::BluezDBusManager::Initialize( | 210 bluez::BluezDBusManager::Initialize( |
| 206 DBusThreadManager::Get()->GetSystemBus(), | 211 DBusThreadManager::Get()->GetSystemBus(), |
| 207 chromeos::DBusThreadManager::Get()->IsUsingFake( | 212 chromeos::DBusThreadManager::Get()->IsUsingFake( |
| 208 chromeos::DBusClientType::BLUETOOTH)); | 213 chromeos::DBusClientType::BLUETOOTH)); |
| 209 | 214 |
| 210 PowerPolicyController::Initialize( | 215 PowerPolicyController::Initialize( |
| 211 DBusThreadManager::Get()->GetPowerManagerClient()); | 216 DBusThreadManager::Get()->GetPowerManagerClient()); |
| 212 | 217 |
| 213 CrosDBusService::ServiceProviderList service_providers; | 218 CrosDBusService::ServiceProviderList service_providers; |
| (...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 // Destroy DBus services immediately after threads are stopped. | 885 // Destroy DBus services immediately after threads are stopped. |
| 881 dbus_services_.reset(); | 886 dbus_services_.reset(); |
| 882 | 887 |
| 883 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 888 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
| 884 | 889 |
| 885 // Destroy DeviceSettingsService after g_browser_process. | 890 // Destroy DeviceSettingsService after g_browser_process. |
| 886 DeviceSettingsService::Shutdown(); | 891 DeviceSettingsService::Shutdown(); |
| 887 } | 892 } |
| 888 | 893 |
| 889 } // namespace chromeos | 894 } // namespace chromeos |
| OLD | NEW |