OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/api/networking_private/networking_private_linux.h" | 5 #include "extensions/browser/api/networking_private/networking_private_linux.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 dbus_thread_.task_runner()->PostTask( | 143 dbus_thread_.task_runner()->PostTask( |
144 FROM_HERE, | 144 FROM_HERE, |
145 base::Bind(&NetworkingPrivateLinux::Initialize, base::Unretained(this))); | 145 base::Bind(&NetworkingPrivateLinux::Initialize, base::Unretained(this))); |
146 } | 146 } |
147 | 147 |
148 NetworkingPrivateLinux::~NetworkingPrivateLinux() { | 148 NetworkingPrivateLinux::~NetworkingPrivateLinux() { |
149 dbus_thread_.Stop(); | 149 dbus_thread_.Stop(); |
150 } | 150 } |
151 | 151 |
152 void NetworkingPrivateLinux::AssertOnDBusThread() { | 152 void NetworkingPrivateLinux::AssertOnDBusThread() { |
153 DCHECK(dbus_task_runner_->RunsTasksOnCurrentThread()); | 153 DCHECK(dbus_task_runner_->RunsTasksInCurrentSequence()); |
154 } | 154 } |
155 | 155 |
156 void NetworkingPrivateLinux::Initialize() { | 156 void NetworkingPrivateLinux::Initialize() { |
157 dbus_task_runner_ = dbus_thread_.task_runner(); | 157 dbus_task_runner_ = dbus_thread_.task_runner(); |
158 // This has to be called after the task runner is initialized. | 158 // This has to be called after the task runner is initialized. |
159 AssertOnDBusThread(); | 159 AssertOnDBusThread(); |
160 | 160 |
161 dbus::Bus::Options dbus_options; | 161 dbus::Bus::Options dbus_options; |
162 dbus_options.bus_type = dbus::Bus::SYSTEM; | 162 dbus_options.bus_type = dbus::Bus::SYSTEM; |
163 dbus_options.connection_type = dbus::Bus::PRIVATE; | 163 dbus_options.connection_type = dbus::Bus::PRIVATE; |
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1202 base::Unretained(this), base::Passed(&guid_list))); | 1202 base::Unretained(this), base::Passed(&guid_list))); |
1203 } | 1203 } |
1204 | 1204 |
1205 void NetworkingPrivateLinux::OnNetworksChangedEventTask( | 1205 void NetworkingPrivateLinux::OnNetworksChangedEventTask( |
1206 std::unique_ptr<GuidList> guid_list) { | 1206 std::unique_ptr<GuidList> guid_list) { |
1207 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 1207 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
1208 OnNetworksChangedEventOnUIThread(*guid_list); | 1208 OnNetworksChangedEventOnUIThread(*guid_list); |
1209 } | 1209 } |
1210 | 1210 |
1211 } // namespace extensions | 1211 } // namespace extensions |
OLD | NEW |