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

Side by Side Diff: src/data_plan_provider.cc

Issue 3764012: cashew: support "usage requests allowed OTA only" policy (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/cashew.git
Patch Set: jglasgow review comments Created 10 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/default_policy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS 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 "src/data_plan_provider.h" 5 #include "src/data_plan_provider.h"
6 6
7 #include <base/json/json_reader.h> 7 #include <base/json/json_reader.h>
8 #include <base/scoped_ptr.h> 8 #include <base/scoped_ptr.h>
9 #include <base/values.h> 9 #include <base/values.h>
10 #include <glog/logging.h> 10 #include <glog/logging.h>
(...skipping 16 matching lines...) Expand all
27 const std::string& DataPlanProvider::GetCarrier() const { 27 const std::string& DataPlanProvider::GetCarrier() const {
28 return carrier_; 28 return carrier_;
29 } 29 }
30 30
31 const std::string& DataPlanProvider::GetUsageUrl() const { 31 const std::string& DataPlanProvider::GetUsageUrl() const {
32 return usage_url_; 32 return usage_url_;
33 } 33 }
34 34
35 void DataPlanProvider::SetUsageUrl(const std::string& usage_url) { 35 void DataPlanProvider::SetUsageUrl(const std::string& usage_url) {
36 DLOG(INFO) << carrier_ << ": SetUsageUrl: url = " << usage_url; 36 DLOG(INFO) << carrier_ << ": SetUsageUrl: url = " << usage_url;
37 if (usage_url_.compare(usage_url)) { 37 if (usage_url_ != usage_url) {
38 usage_url_ = usage_url; 38 usage_url_ = usage_url;
39 CancelPendingRequests(); 39 CancelPendingRequests();
40 } 40 }
41 } 41 }
42 42
43 void DataPlanProvider::SetDelegate(DataPlanProviderDelegate *delegate) { 43 void DataPlanProvider::SetDelegate(DataPlanProviderDelegate *delegate) {
44 DLOG(INFO) << carrier_ << ": SetDelegate"; 44 DLOG(INFO) << carrier_ << ": SetDelegate";
45 delegate_ = delegate; 45 delegate_ = delegate;
46 if (delegate_ == NULL) { 46 if (delegate_ == NULL) {
47 CancelPendingRequests(); 47 CancelPendingRequests();
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 if (request_in_progress_) { 138 if (request_in_progress_) {
139 fetcher_->TerminateTransfer(); 139 fetcher_->TerminateTransfer();
140 response_buffer_.clear(); 140 response_buffer_.clear();
141 request_in_progress_ = false; 141 request_in_progress_ = false;
142 } 142 }
143 } 143 }
144 144
145 // private methods 145 // private methods
146 146
147 } // namespace cashew 147 } // namespace cashew
OLDNEW
« no previous file with comments | « no previous file | src/default_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698