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

Side by Side Diff: components/proximity_auth/proximity_auth_system.cc

Issue 1413183007: Fix Smart Lock crash when resuming from suspend. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/proximity_auth/proximity_auth_system.h" 5 #include "components/proximity_auth/proximity_auth_system.h"
6 6
7 #include "base/thread_task_runner_handle.h" 7 #include "base/thread_task_runner_handle.h"
8 #include "base/time/default_tick_clock.h" 8 #include "base/time/default_tick_clock.h"
9 #include "components/proximity_auth/logging/logging.h" 9 #include "components/proximity_auth/logging/logging.h"
10 #include "components/proximity_auth/proximity_auth_client.h" 10 #include "components/proximity_auth/proximity_auth_client.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 void ProximityAuthSystem::OnAuthAttempted(const std::string& user_id) { 50 void ProximityAuthSystem::OnAuthAttempted(const std::string& user_id) {
51 // TODO(tengs): There is no reason to pass the |user_id| argument anymore. 51 // TODO(tengs): There is no reason to pass the |user_id| argument anymore.
52 unlock_manager_->OnAuthAttempted(ScreenlockBridge::LockHandler::USER_CLICK); 52 unlock_manager_->OnAuthAttempted(ScreenlockBridge::LockHandler::USER_CLICK);
53 } 53 }
54 54
55 void ProximityAuthSystem::OnSuspend() { 55 void ProximityAuthSystem::OnSuspend() {
56 PA_LOG(INFO) << "Preparing for device suspension."; 56 PA_LOG(INFO) << "Preparing for device suspension.";
57 DCHECK(!suspended_); 57 DCHECK(!suspended_);
58 suspended_ = true; 58 suspended_ = true;
59 unlock_manager_->SetRemoteDeviceLifeCycle(nullptr);
59 remote_device_life_cycle_.reset(); 60 remote_device_life_cycle_.reset();
60 } 61 }
61 62
62 void ProximityAuthSystem::OnSuspendDone() { 63 void ProximityAuthSystem::OnSuspendDone() {
63 PA_LOG(INFO) << "Device resumed from suspension."; 64 PA_LOG(INFO) << "Device resumed from suspension.";
64 DCHECK(suspended_); 65 DCHECK(suspended_);
65 66
66 // TODO(tengs): On ChromeOS, the system's Bluetooth adapter is invalidated 67 // TODO(tengs): On ChromeOS, the system's Bluetooth adapter is invalidated
67 // when the system suspends. However, Chrome does not receive this 68 // when the system suspends. However, Chrome does not receive this
68 // notification until a second or so after the system wakes up. That means 69 // notification until a second or so after the system wakes up. That means
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 PA_LOG(INFO) << "Creating RemoteDeviceLifeCycle for focused user."; 109 PA_LOG(INFO) << "Creating RemoteDeviceLifeCycle for focused user.";
109 remote_device_life_cycle_.reset( 110 remote_device_life_cycle_.reset(
110 new RemoteDeviceLifeCycleImpl(remote_device_, proximity_auth_client_)); 111 new RemoteDeviceLifeCycleImpl(remote_device_, proximity_auth_client_));
111 unlock_manager_->SetRemoteDeviceLifeCycle(remote_device_life_cycle_.get()); 112 unlock_manager_->SetRemoteDeviceLifeCycle(remote_device_life_cycle_.get());
112 remote_device_life_cycle_->AddObserver(this); 113 remote_device_life_cycle_->AddObserver(this);
113 remote_device_life_cycle_->Start(); 114 remote_device_life_cycle_->Start();
114 } 115 }
115 } 116 }
116 117
117 } // proximity_auth 118 } // proximity_auth
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698