Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(385)

Side by Side Diff: extensions/browser/api/bluetooth/bluetooth_api.cc

Issue 671783002: Reverting instrumentations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "extensions/browser/api/bluetooth/bluetooth_api.h" 5 #include "extensions/browser/api/bluetooth/bluetooth_api.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/profiler/scoped_profile.h"
13 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
14 #include "device/bluetooth/bluetooth_adapter.h" 13 #include "device/bluetooth/bluetooth_adapter.h"
15 #include "device/bluetooth/bluetooth_device.h" 14 #include "device/bluetooth/bluetooth_device.h"
16 #include "extensions/browser/api/bluetooth/bluetooth_api_utils.h" 15 #include "extensions/browser/api/bluetooth/bluetooth_api_utils.h"
17 #include "extensions/browser/api/bluetooth/bluetooth_event_router.h" 16 #include "extensions/browser/api/bluetooth/bluetooth_event_router.h"
18 #include "extensions/browser/event_router.h" 17 #include "extensions/browser/event_router.h"
19 #include "extensions/common/api/bluetooth.h" 18 #include "extensions/common/api/bluetooth.h"
20 19
21 using content::BrowserContext; 20 using content::BrowserContext;
22 using content::BrowserThread; 21 using content::BrowserThread;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 } 78 }
80 return event_router_.get(); 79 return event_router_.get();
81 } 80 }
82 81
83 void BluetoothAPI::Shutdown() { 82 void BluetoothAPI::Shutdown() {
84 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 83 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
85 EventRouter::Get(browser_context_)->UnregisterObserver(this); 84 EventRouter::Get(browser_context_)->UnregisterObserver(this);
86 } 85 }
87 86
88 void BluetoothAPI::OnListenerAdded(const EventListenerInfo& details) { 87 void BluetoothAPI::OnListenerAdded(const EventListenerInfo& details) {
89 // TODO(vadimt): Remove ScopedProfile below once crbug.com/417106 is fixed.
90 tracked_objects::ScopedProfile tracking_profile(
91 FROM_HERE_WITH_EXPLICIT_FUNCTION("BluetoothAPI::OnListenerAdded"));
92
93 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 88 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
94 if (event_router()->IsBluetoothSupported()) 89 if (event_router()->IsBluetoothSupported())
95 event_router()->OnListenerAdded(); 90 event_router()->OnListenerAdded();
96 } 91 }
97 92
98 void BluetoothAPI::OnListenerRemoved(const EventListenerInfo& details) { 93 void BluetoothAPI::OnListenerRemoved(const EventListenerInfo& details) {
99 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 94 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
100 if (event_router()->IsBluetoothSupported()) 95 if (event_router()->IsBluetoothSupported())
101 event_router()->OnListenerRemoved(); 96 event_router()->OnListenerRemoved();
102 } 97 }
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 adapter.get(), 194 adapter.get(),
200 extension_id(), 195 extension_id(),
201 base::Bind(&BluetoothStopDiscoveryFunction::OnSuccessCallback, this), 196 base::Bind(&BluetoothStopDiscoveryFunction::OnSuccessCallback, this),
202 base::Bind(&BluetoothStopDiscoveryFunction::OnErrorCallback, this)); 197 base::Bind(&BluetoothStopDiscoveryFunction::OnErrorCallback, this));
203 198
204 return true; 199 return true;
205 } 200 }
206 201
207 } // namespace core_api 202 } // namespace core_api
208 } // namespace extensions 203 } // namespace extensions
OLDNEW
« no previous file with comments | « components/url_matcher/url_matcher.cc ('k') | extensions/browser/api/system_info/system_info_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698