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

Side by Side Diff: content/browser/bluetooth/bluetooth_dispatcher_host.cc

Issue 1941923002: bluetooth: Return int8_t and use -128 for unknown tx power. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Moar fixes Created 4 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 // ID Not In Map Note: 5 // ID Not In Map Note:
6 // A service, characteristic, or descriptor ID not in the corresponding 6 // A service, characteristic, or descriptor ID not in the corresponding
7 // BluetoothDispatcherHost map [service_to_device_, characteristic_to_service_, 7 // BluetoothDispatcherHost map [service_to_device_, characteristic_to_service_,
8 // descriptor_to_characteristic_] implies a hostile renderer because a renderer 8 // descriptor_to_characteristic_] implies a hostile renderer because a renderer
9 // obtains the corresponding ID from this class and it will be added to the map 9 // obtains the corresponding ID from this class and it will be added to the map
10 // at that time. 10 // at that time.
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 if (allowed_devices_map_.IsOriginAllowedToAccessService( 911 if (allowed_devices_map_.IsOriginAllowedToAccessService(
912 session->origin, device_id_for_origin, uuid.canonical_value())) { 912 session->origin, device_id_for_origin, uuid.canonical_value())) {
913 VLOG(1) << "\t Allowed: " << uuid.canonical_value(); 913 VLOG(1) << "\t Allowed: " << uuid.canonical_value();
914 filtered_uuids.push_back(uuid); 914 filtered_uuids.push_back(uuid);
915 } else { 915 } else {
916 VLOG(1) << "\t Not Allowed: " << uuid.canonical_value(); 916 VLOG(1) << "\t Not Allowed: " << uuid.canonical_value();
917 } 917 }
918 } 918 }
919 919
920 content::BluetoothDevice device_ipc( 920 content::BluetoothDevice device_ipc(
921 device_id_for_origin, // id 921 device_id_for_origin, // id
922 device->GetName(), // name 922 device->GetName(), // name
923 content::BluetoothDevice::ValidatePower( 923 device->GetInquiryTxPower(), // tx_power
924 device->GetInquiryTxPower()), // tx_power 924 device->GetInquiryRSSI(), // rssi
925 content::BluetoothDevice::ValidatePower(
926 device->GetInquiryRSSI()), // rssi
927 content::BluetoothDevice::UUIDsFromBluetoothUUIDs( 925 content::BluetoothDevice::UUIDsFromBluetoothUUIDs(
928 filtered_uuids)); // uuids 926 filtered_uuids)); // uuids
929 RecordRequestDeviceOutcome(UMARequestDeviceOutcome::SUCCESS); 927 RecordRequestDeviceOutcome(UMARequestDeviceOutcome::SUCCESS);
930 Send(new BluetoothMsg_RequestDeviceSuccess(session->thread_id, 928 Send(new BluetoothMsg_RequestDeviceSuccess(session->thread_id,
931 session->request_id, device_ipc)); 929 session->request_id, device_ipc));
932 request_device_sessions_.Remove(chooser_id); 930 request_device_sessions_.Remove(chooser_id);
933 } 931 }
934 932
935 void BluetoothDispatcherHost::OnGATTConnectionCreated( 933 void BluetoothDispatcherHost::OnGATTConnectionCreated(
936 int thread_id, 934 int thread_id,
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 adapter_->RemoveObserver(observer); 1000 adapter_->RemoveObserver(observer);
1003 } 1001 }
1004 } 1002 }
1005 1003
1006 url::Origin BluetoothDispatcherHost::GetOrigin(int frame_routing_id) { 1004 url::Origin BluetoothDispatcherHost::GetOrigin(int frame_routing_id) {
1007 return RenderFrameHostImpl::FromID(render_process_id_, frame_routing_id) 1005 return RenderFrameHostImpl::FromID(render_process_id_, frame_routing_id)
1008 ->GetLastCommittedOrigin(); 1006 ->GetLastCommittedOrigin();
1009 } 1007 }
1010 1008
1011 } // namespace content 1009 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698