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

Side by Side Diff: extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc

Issue 2839373003: struct UnloadedExtensionInfo -> enum UnloadedExtensionInfoReason (Closed)
Patch Set: Rebase Created 3 years, 7 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 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/bluetooth_low_energy/bluetooth_low_energy_event _router.h" 5 #include "extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event _router.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 const device::BluetoothDevice* device, 1209 const device::BluetoothDevice* device,
1210 const device::BluetoothLocalGattCharacteristic* characteristic) {} 1210 const device::BluetoothLocalGattCharacteristic* characteristic) {}
1211 1211
1212 void BluetoothLowEnergyEventRouter::OnNotificationsStop( 1212 void BluetoothLowEnergyEventRouter::OnNotificationsStop(
1213 const device::BluetoothDevice* device, 1213 const device::BluetoothDevice* device,
1214 const device::BluetoothLocalGattCharacteristic* characteristic) {} 1214 const device::BluetoothLocalGattCharacteristic* characteristic) {}
1215 1215
1216 void BluetoothLowEnergyEventRouter::OnExtensionUnloaded( 1216 void BluetoothLowEnergyEventRouter::OnExtensionUnloaded(
1217 content::BrowserContext* browser_context, 1217 content::BrowserContext* browser_context,
1218 const extensions::Extension* extension, 1218 const extensions::Extension* extension,
1219 extensions::UnloadedExtensionInfo::Reason reason) { 1219 extensions::UnloadedExtensionReason reason) {
1220 const std::string& app_id = extension->id(); 1220 const std::string& app_id = extension->id();
1221 const auto& services = app_id_to_service_ids_.find(app_id); 1221 const auto& services = app_id_to_service_ids_.find(app_id);
1222 if (services == app_id_to_service_ids_.end()) 1222 if (services == app_id_to_service_ids_.end())
1223 return; 1223 return;
1224 1224
1225 // Find all services owned by this app and delete them. 1225 // Find all services owned by this app and delete them.
1226 for (const auto& service_id : services->second) { 1226 for (const auto& service_id : services->second) {
1227 device::BluetoothLocalGattService* service = 1227 device::BluetoothLocalGattService* service =
1228 adapter_->GetGattService(service_id); 1228 adapter_->GetGattService(service_id);
1229 if (service) 1229 if (service)
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
1885 requests_[extension_id] = std::move(new_request_id_map); 1885 requests_[extension_id] = std::move(new_request_id_map);
1886 } else { 1886 } else {
1887 request_id_map = iter->second.get(); 1887 request_id_map = iter->second.get();
1888 } 1888 }
1889 1889
1890 (*request_id_map)[++last_callback_request_id_] = std::move(request); 1890 (*request_id_map)[++last_callback_request_id_] = std::move(request);
1891 return last_callback_request_id_; 1891 return last_callback_request_id_;
1892 } 1892 }
1893 1893
1894 } // namespace extensions 1894 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698