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

Side by Side Diff: components/invalidation/gcm_network_channel.cc

Issue 503353002: Remove implicit conversions from scoped_refptr to T* in components/invalidation/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | components/invalidation/invalidation.cc » ('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 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 "base/base64.h" 5 #include "base/base64.h"
6 #include "base/i18n/time_formatting.h" 6 #include "base/i18n/time_formatting.h"
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/sha1.h" 8 #include "base/sha1.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 cached_message_.clear(); 202 cached_message_.clear();
203 return; 203 return;
204 } 204 }
205 DCHECK(!token.empty()); 205 DCHECK(!token.empty());
206 // Save access token in case POST fails and we need to invalidate it. 206 // Save access token in case POST fails and we need to invalidate it.
207 access_token_ = token; 207 access_token_ = token;
208 208
209 DVLOG(2) << "Got access token, sending message"; 209 DVLOG(2) << "Got access token, sending message";
210 fetcher_.reset(net::URLFetcher::Create( 210 fetcher_.reset(net::URLFetcher::Create(
211 BuildUrl(registration_id_), net::URLFetcher::POST, this)); 211 BuildUrl(registration_id_), net::URLFetcher::POST, this));
212 fetcher_->SetRequestContext(request_context_getter_); 212 fetcher_->SetRequestContext(request_context_getter_.get());
213 const std::string auth_header("Authorization: Bearer " + access_token_); 213 const std::string auth_header("Authorization: Bearer " + access_token_);
214 fetcher_->AddExtraRequestHeader(auth_header); 214 fetcher_->AddExtraRequestHeader(auth_header);
215 if (!echo_token_.empty()) { 215 if (!echo_token_.empty()) {
216 const std::string echo_header("echo-token: " + echo_token_); 216 const std::string echo_header("echo-token: " + echo_token_);
217 fetcher_->AddExtraRequestHeader(echo_header); 217 fetcher_->AddExtraRequestHeader(echo_header);
218 } 218 }
219 fetcher_->SetUploadData("application/x-protobuffer", cached_message_); 219 fetcher_->SetUploadData("application/x-protobuffer", cached_message_);
220 fetcher_->Start(); 220 fetcher_->Start();
221 // Clear message to prevent accidentally resending it in the future. 221 // Clear message to prevent accidentally resending it in the future.
222 cached_message_.clear(); 222 cached_message_.clear();
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 ENUM_CASE(gcm::GCMClient::NOT_SIGNED_IN); 449 ENUM_CASE(gcm::GCMClient::NOT_SIGNED_IN);
450 ENUM_CASE(gcm::GCMClient::INVALID_PARAMETER); 450 ENUM_CASE(gcm::GCMClient::INVALID_PARAMETER);
451 ENUM_CASE(gcm::GCMClient::ASYNC_OPERATION_PENDING); 451 ENUM_CASE(gcm::GCMClient::ASYNC_OPERATION_PENDING);
452 ENUM_CASE(gcm::GCMClient::GCM_DISABLED); 452 ENUM_CASE(gcm::GCMClient::GCM_DISABLED);
453 } 453 }
454 NOTREACHED(); 454 NOTREACHED();
455 return ""; 455 return "";
456 } 456 }
457 457
458 } // namespace syncer 458 } // namespace syncer
OLDNEW
« no previous file with comments | « no previous file | components/invalidation/invalidation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698