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

Side by Side Diff: chrome/browser/chromeos/mobile/mobile_activator.cc

Issue 1049873005: [chrome/browser/chromeos/] favor DCHECK_CURRENTLY_ON for better logs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/mobile/mobile_activator.h" 5 #include "chrome/browser/chromeos/mobile/mobile_activator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 } 232 }
233 233
234 // A modem reset leads to a new service path. Since we have verified that we 234 // A modem reset leads to a new service path. Since we have verified that we
235 // are a cellular service on a still valid stored device path, update it. 235 // are a cellular service on a still valid stored device path, update it.
236 service_path_ = network->path(); 236 service_path_ = network->path();
237 237
238 EvaluateCellularNetwork(network); 238 EvaluateCellularNetwork(network);
239 } 239 }
240 240
241 void MobileActivator::AddObserver(MobileActivator::Observer* observer) { 241 void MobileActivator::AddObserver(MobileActivator::Observer* observer) {
242 DCHECK(content::BrowserThread::CurrentlyOn(BrowserThread::UI)); 242 DCHECK_CURRENTLY_ON(BrowserThread::UI);
243 observers_.AddObserver(observer); 243 observers_.AddObserver(observer);
244 } 244 }
245 245
246 void MobileActivator::RemoveObserver(MobileActivator::Observer* observer) { 246 void MobileActivator::RemoveObserver(MobileActivator::Observer* observer) {
247 DCHECK(content::BrowserThread::CurrentlyOn(BrowserThread::UI)); 247 DCHECK_CURRENTLY_ON(BrowserThread::UI);
248 observers_.RemoveObserver(observer); 248 observers_.RemoveObserver(observer);
249 } 249 }
250 250
251 void MobileActivator::InitiateActivation(const std::string& service_path) { 251 void MobileActivator::InitiateActivation(const std::string& service_path) {
252 DCHECK(content::BrowserThread::CurrentlyOn(BrowserThread::UI)); 252 DCHECK_CURRENTLY_ON(BrowserThread::UI);
253 const NetworkState* network = GetNetworkState(service_path); 253 const NetworkState* network = GetNetworkState(service_path);
254 if (!network) { 254 if (!network) {
255 LOG(WARNING) << "Cellular service can't be found: " << service_path; 255 LOG(WARNING) << "Cellular service can't be found: " << service_path;
256 return; 256 return;
257 } 257 }
258 const DeviceState* device = NetworkHandler::Get()->network_state_handler()-> 258 const DeviceState* device = NetworkHandler::Get()->network_state_handler()->
259 GetDeviceState(network->device_path()); 259 GetDeviceState(network->device_path());
260 if (!device) { 260 if (!device) {
261 LOG(ERROR) << "Cellular device can't be found: " << network->device_path(); 261 LOG(ERROR) << "Cellular device can't be found: " << network->device_path();
262 return; 262 return;
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
1163 cellular_plan_payment_time_ = base::Time::Now(); 1163 cellular_plan_payment_time_ = base::Time::Now();
1164 } 1164 }
1165 1165
1166 bool MobileActivator::HasRecentCellularPlanPayment() const { 1166 bool MobileActivator::HasRecentCellularPlanPayment() const {
1167 const int kRecentPlanPaymentHours = 6; 1167 const int kRecentPlanPaymentHours = 6;
1168 return (base::Time::Now() - 1168 return (base::Time::Now() -
1169 cellular_plan_payment_time_).InHours() < kRecentPlanPaymentHours; 1169 cellular_plan_payment_time_).InHours() < kRecentPlanPaymentHours;
1170 } 1170 }
1171 1171
1172 } // namespace chromeos 1172 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/ui/proxy_settings_dialog.cc ('k') | chrome/browser/chromeos/policy/policy_cert_verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698