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

Side by Side Diff: google_apis/gcm/engine/unregistration_request.cc

Issue 498123003: Remove implicit conversions from scoped_refptr to T* in google_apis/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 4 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
« no previous file with comments | « google_apis/gcm/engine/registration_request.cc ('k') | 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 "google_apis/gcm/engine/unregistration_request.h" 5 #include "google_apis/gcm/engine/unregistration_request.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 UnregistrationRequest::~UnregistrationRequest() {} 128 UnregistrationRequest::~UnregistrationRequest() {}
129 129
130 void UnregistrationRequest::Start() { 130 void UnregistrationRequest::Start() {
131 DCHECK(!callback_.is_null()); 131 DCHECK(!callback_.is_null());
132 DCHECK(request_info_.android_id != 0UL); 132 DCHECK(request_info_.android_id != 0UL);
133 DCHECK(request_info_.security_token != 0UL); 133 DCHECK(request_info_.security_token != 0UL);
134 DCHECK(!url_fetcher_.get()); 134 DCHECK(!url_fetcher_.get());
135 135
136 url_fetcher_.reset(net::URLFetcher::Create( 136 url_fetcher_.reset(net::URLFetcher::Create(
137 registration_url_, net::URLFetcher::POST, this)); 137 registration_url_, net::URLFetcher::POST, this));
138 url_fetcher_->SetRequestContext(request_context_getter_); 138 url_fetcher_->SetRequestContext(request_context_getter_.get());
139 139
140 std::string android_id = base::Uint64ToString(request_info_.android_id); 140 std::string android_id = base::Uint64ToString(request_info_.android_id);
141 std::string auth_header = 141 std::string auth_header =
142 std::string(kLoginHeader) + " " + android_id + ":" + 142 std::string(kLoginHeader) + " " + android_id + ":" +
143 base::Uint64ToString(request_info_.security_token); 143 base::Uint64ToString(request_info_.security_token);
144 net::HttpRequestHeaders headers; 144 net::HttpRequestHeaders headers;
145 headers.SetHeader(net::HttpRequestHeaders::kAuthorization, auth_header); 145 headers.SetHeader(net::HttpRequestHeaders::kAuthorization, auth_header);
146 headers.SetHeader(kAppIdKey, request_info_.app_id); 146 headers.SetHeader(kAppIdKey, request_info_.app_id);
147 url_fetcher_->SetExtraRequestHeaders(headers.ToString()); 147 url_fetcher_->SetExtraRequestHeaders(headers.ToString());
148 148
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 UMA_HISTOGRAM_COUNTS("GCM.UnregistrationRetryCount", 215 UMA_HISTOGRAM_COUNTS("GCM.UnregistrationRetryCount",
216 backoff_entry_.failure_count()); 216 backoff_entry_.failure_count());
217 UMA_HISTOGRAM_TIMES("GCM.UnregistrationCompleteTime", 217 UMA_HISTOGRAM_TIMES("GCM.UnregistrationCompleteTime",
218 base::TimeTicks::Now() - request_start_time_); 218 base::TimeTicks::Now() - request_start_time_);
219 } 219 }
220 220
221 callback_.Run(status); 221 callback_.Run(status);
222 } 222 }
223 223
224 } // namespace gcm 224 } // namespace gcm
OLDNEW
« no previous file with comments | « google_apis/gcm/engine/registration_request.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698