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

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

Issue 1815363002: Add RetainedRef uses where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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_event_router.h" 5 #include "extensions/browser/api/bluetooth/bluetooth_event_router.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 device::BluetoothAdapter* adapter, 93 device::BluetoothAdapter* adapter,
94 const std::string& extension_id, 94 const std::string& extension_id,
95 const base::Closure& callback, 95 const base::Closure& callback,
96 const base::Closure& error_callback) { 96 const base::Closure& error_callback) {
97 if (!adapter_.get() && IsBluetoothSupported()) { 97 if (!adapter_.get() && IsBluetoothSupported()) {
98 // If |adapter_| isn't set yet, call GetAdapter() which will synchronously 98 // If |adapter_| isn't set yet, call GetAdapter() which will synchronously
99 // invoke the callback (StartDiscoverySessionImpl). 99 // invoke the callback (StartDiscoverySessionImpl).
100 GetAdapter(base::Bind( 100 GetAdapter(base::Bind(
101 &IgnoreAdapterResultAndThen, 101 &IgnoreAdapterResultAndThen,
102 base::Bind(&BluetoothEventRouter::StartDiscoverySessionImpl, 102 base::Bind(&BluetoothEventRouter::StartDiscoverySessionImpl,
103 weak_ptr_factory_.GetWeakPtr(), make_scoped_refptr(adapter), 103 weak_ptr_factory_.GetWeakPtr(), base::RetainedRef(adapter),
104 extension_id, callback, error_callback))); 104 extension_id, callback, error_callback)));
105 return; 105 return;
106 } 106 }
107 StartDiscoverySessionImpl(adapter, extension_id, callback, error_callback); 107 StartDiscoverySessionImpl(adapter, extension_id, callback, error_callback);
108 } 108 }
109 109
110 void BluetoothEventRouter::StartDiscoverySessionImpl( 110 void BluetoothEventRouter::StartDiscoverySessionImpl(
111 device::BluetoothAdapter* adapter, 111 device::BluetoothAdapter* adapter,
112 const std::string& extension_id, 112 const std::string& extension_id,
113 const base::Closure& callback, 113 const base::Closure& callback,
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 } 467 }
468 468
469 void BluetoothEventRouter::OnExtensionUnloaded( 469 void BluetoothEventRouter::OnExtensionUnloaded(
470 content::BrowserContext* browser_context, 470 content::BrowserContext* browser_context,
471 const Extension* extension, 471 const Extension* extension,
472 UnloadedExtensionInfo::Reason reason) { 472 UnloadedExtensionInfo::Reason reason) {
473 CleanUpForExtension(extension->id()); 473 CleanUpForExtension(extension->id());
474 } 474 }
475 475
476 } // namespace extensions 476 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698