Chromium Code Reviews| 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 "chrome/browser/chromeos/dbus/cros_dbus_service.h" | 5 #include "chrome/browser/chromeos/dbus/cros_dbus_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/chromeos/chromeos_version.h" | 8 #include "base/chromeos/chromeos_version.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/threading/platform_thread.h" | 10 #include "base/threading/platform_thread.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 void Start() { | 43 void Start() { |
| 44 // Make sure we're running on the origin thread (i.e. the UI thread in | 44 // Make sure we're running on the origin thread (i.e. the UI thread in |
| 45 // production). | 45 // production). |
| 46 DCHECK(OnOriginThread()); | 46 DCHECK(OnOriginThread()); |
| 47 | 47 |
| 48 // Return if the service has been already started. | 48 // Return if the service has been already started. |
| 49 if (service_started_) | 49 if (service_started_) |
| 50 return; | 50 return; |
| 51 | 51 |
| 52 bus_->RequestOwnership(kLibCrosServiceName, | 52 bus_->RequestOwnership(kLibCrosServiceName, |
| 53 dbus::Bus::REQUIRE_PRIMARY_ALLOW_REPLACEMENT, | |
|
satorux1
2013/07/26 01:14:45
Please add some comment about why we are allowing
Chris Masone
2013/07/26 17:37:24
Done.
| |
| 53 base::Bind(&CrosDBusServiceImpl::OnOwnership, | 54 base::Bind(&CrosDBusServiceImpl::OnOwnership, |
| 54 base::Unretained(this))); | 55 base::Unretained(this))); |
| 55 | 56 |
| 56 exported_object_ = bus_->GetExportedObject( | 57 exported_object_ = bus_->GetExportedObject( |
| 57 dbus::ObjectPath(kLibCrosServicePath)); | 58 dbus::ObjectPath(kLibCrosServicePath)); |
| 58 | 59 |
| 59 for (size_t i = 0; i < service_providers_.size(); ++i) | 60 for (size_t i = 0; i < service_providers_.size(); ++i) |
| 60 service_providers_[i]->Start(exported_object_); | 61 service_providers_[i]->Start(exported_object_); |
| 61 | 62 |
| 62 service_started_ = true; | 63 service_started_ = true; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 145 VLOG(1) << "CrosDBusService Shutdown completed"; | 146 VLOG(1) << "CrosDBusService Shutdown completed"; |
| 146 } | 147 } |
| 147 | 148 |
| 148 CrosDBusService::~CrosDBusService() { | 149 CrosDBusService::~CrosDBusService() { |
| 149 } | 150 } |
| 150 | 151 |
| 151 CrosDBusService::ServiceProviderInterface::~ServiceProviderInterface() { | 152 CrosDBusService::ServiceProviderInterface::~ServiceProviderInterface() { |
| 152 } | 153 } |
| 153 | 154 |
| 154 } // namespace chromeos | 155 } // namespace chromeos |
| OLD | NEW |