Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "content/browser/bluetooth/bluetooth_device_chooser_controller.h" | 5 #include "content/browser/bluetooth/bluetooth_device_chooser_controller.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <unordered_set> | 9 #include <unordered_set> |
| 10 | 10 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 const int k60thPercentileRSSI = -55; | 72 const int k60thPercentileRSSI = -55; |
| 73 const int k80thPercentileRSSI = -47; | 73 const int k80thPercentileRSSI = -47; |
| 74 | 74 |
| 75 } // namespace | 75 } // namespace |
| 76 | 76 |
| 77 namespace content { | 77 namespace content { |
| 78 | 78 |
| 79 bool BluetoothDeviceChooserController::use_test_scan_duration_ = false; | 79 bool BluetoothDeviceChooserController::use_test_scan_duration_ = false; |
| 80 | 80 |
| 81 namespace { | 81 namespace { |
| 82 constexpr size_t kMaxLengthForDeviceName = | 82 // Max length of device name in filter, limited to the max EIR packet size. |
| 83 29; // max length of device name in filter. | 83 constexpr size_t kMaxLengthForDeviceName = 240; |
|
jeffcarp
2017/01/09 18:45:20
In my head it made more sense to limit it to 240 b
scheib
2017/01/09 19:26:49
I think this is OK too, practically I doubt device
| |
| 84 | 84 |
| 85 // The duration of a Bluetooth Scan in seconds. | 85 // The duration of a Bluetooth Scan in seconds. |
| 86 constexpr int kScanDuration = 60; | 86 constexpr int kScanDuration = 60; |
| 87 constexpr int kTestScanDuration = 0; | 87 constexpr int kTestScanDuration = 0; |
| 88 | 88 |
| 89 void LogRequestDeviceOptions( | 89 void LogRequestDeviceOptions( |
| 90 const blink::mojom::WebBluetoothRequestDeviceOptionsPtr& options) { | 90 const blink::mojom::WebBluetoothRequestDeviceOptionsPtr& options) { |
| 91 VLOG(1) << "requestDevice called with the following filters: "; | 91 VLOG(1) << "requestDevice called with the following filters: "; |
| 92 VLOG(1) << "acceptAllDevices: " << options->accept_all_devices; | 92 VLOG(1) << "acceptAllDevices: " << options->accept_all_devices; |
| 93 | 93 |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 616 | 616 |
| 617 void BluetoothDeviceChooserController::PostErrorCallback( | 617 void BluetoothDeviceChooserController::PostErrorCallback( |
| 618 blink::mojom::WebBluetoothResult error) { | 618 blink::mojom::WebBluetoothResult error) { |
| 619 if (!base::ThreadTaskRunnerHandle::Get()->PostTask( | 619 if (!base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 620 FROM_HERE, base::Bind(error_callback_, error))) { | 620 FROM_HERE, base::Bind(error_callback_, error))) { |
| 621 LOG(WARNING) << "No TaskRunner."; | 621 LOG(WARNING) << "No TaskRunner."; |
| 622 } | 622 } |
| 623 } | 623 } |
| 624 | 624 |
| 625 } // namespace content | 625 } // namespace content |
| OLD | NEW |