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

Unified Diff: components/proximity_auth/bluetooth_connection_finder.cc

Issue 1264703003: Implement debugging local unlock keys in chrome://proximity-auth. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + fixes Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/proximity_auth/bluetooth_connection.cc ('k') | components/proximity_auth/client_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/proximity_auth/bluetooth_connection_finder.cc
diff --git a/components/proximity_auth/bluetooth_connection_finder.cc b/components/proximity_auth/bluetooth_connection_finder.cc
index 3ab43a4ad6ce34430fe72109cb8a1b39e09180ed..7596a11c04f49bd9aa4d9c1df65a1ead3badd37d 100644
--- a/components/proximity_auth/bluetooth_connection_finder.cc
+++ b/components/proximity_auth/bluetooth_connection_finder.cc
@@ -10,6 +10,7 @@
#include "base/single_thread_task_runner.h"
#include "base/thread_task_runner_handle.h"
#include "components/proximity_auth/bluetooth_connection.h"
+#include "components/proximity_auth/logging/logging.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
using device::BluetoothAdapter;
@@ -34,12 +35,12 @@ BluetoothConnectionFinder::~BluetoothConnectionFinder() {
void BluetoothConnectionFinder::Find(
const ConnectionCallback& connection_callback) {
if (!device::BluetoothAdapterFactory::IsBluetoothAdapterAvailable()) {
- VLOG(1) << "[BCF] Bluetooth is unsupported on this platform. Aborting.";
+ PA_LOG(WARNING) << "Bluetooth is unsupported on this platform. Aborting.";
return;
}
DCHECK(start_time_.is_null());
- VLOG(1) << "[BCF] Finding Bluetooth connection...";
+ PA_LOG(WARNING) << "Finding Bluetooth connection...";
start_time_ = base::TimeTicks::Now();
connection_callback_ = connection_callback;
@@ -56,8 +57,8 @@ scoped_ptr<Connection> BluetoothConnectionFinder::CreateConnection() {
bool BluetoothConnectionFinder::IsReadyToPoll() {
bool is_adapter_available =
adapter_.get() && adapter_->IsPresent() && adapter_->IsPowered();
- VLOG(1) << "[BCF] Readiness: adapter="
- << (is_adapter_available ? "available" : "unavailable");
+ PA_LOG(INFO) << "Readiness: adapter="
+ << (is_adapter_available ? "available" : "unavailable");
return is_adapter_available;
}
@@ -76,7 +77,7 @@ void BluetoothConnectionFinder::PollIfReady() {
if (connection_)
return;
- VLOG(1) << "[BCF] Polling for connection...";
+ PA_LOG(INFO) << "Polling for connection...";
connection_ = CreateConnection();
connection_->AddObserver(this);
connection_->Connect();
@@ -127,12 +128,13 @@ void BluetoothConnectionFinder::OnConnectionStatusChanged(
if (connection_->IsConnected()) {
base::TimeDelta elapsed = base::TimeTicks::Now() - start_time_;
- VLOG(1) << "[BCF] Connection found! Elapsed Time: "
- << elapsed.InMilliseconds() << "ms.";
+ PA_LOG(WARNING) << "Connection found! Elapsed Time: "
+ << elapsed.InMilliseconds() << "ms.";
UnregisterAsObserver();
connection_callback_.Run(connection_.Pass());
} else if (old_status == Connection::IN_PROGRESS) {
- VLOG(1) << "[BCF] Connection failed! Scheduling another polling iteration.";
+ PA_LOG(WARNING)
+ << "Connection failed! Scheduling another polling iteration.";
connection_.reset();
has_delayed_poll_scheduled_ = true;
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
« no previous file with comments | « components/proximity_auth/bluetooth_connection.cc ('k') | components/proximity_auth/client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698