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

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

Issue 1440593004: Make operators on scoped_ptr match the ones defined for std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrequals: followupfix-after-rebase 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
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/invalidation/impl/gcm_network_channel.h" 5 #include "components/invalidation/impl/gcm_network_channel.h"
6 6
7 #include "base/base64url.h" 7 #include "base/base64url.h"
8 #include "base/i18n/time_formatting.h" 8 #include "base/i18n/time_formatting.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 fetcher_->AddExtraRequestHeader(echo_header); 224 fetcher_->AddExtraRequestHeader(echo_header);
225 } 225 }
226 fetcher_->SetUploadData("application/x-protobuffer", cached_message_); 226 fetcher_->SetUploadData("application/x-protobuffer", cached_message_);
227 fetcher_->Start(); 227 fetcher_->Start();
228 // Clear message to prevent accidentally resending it in the future. 228 // Clear message to prevent accidentally resending it in the future.
229 cached_message_.clear(); 229 cached_message_.clear();
230 } 230 }
231 231
232 void GCMNetworkChannel::OnURLFetchComplete(const net::URLFetcher* source) { 232 void GCMNetworkChannel::OnURLFetchComplete(const net::URLFetcher* source) {
233 DCHECK(CalledOnValidThread()); 233 DCHECK(CalledOnValidThread());
234 DCHECK_EQ(fetcher_, source); 234 DCHECK_EQ(fetcher_.get(), source);
235 // Free fetcher at the end of function. 235 // Free fetcher at the end of function.
236 scoped_ptr<net::URLFetcher> fetcher = fetcher_.Pass(); 236 scoped_ptr<net::URLFetcher> fetcher = fetcher_.Pass();
237 237
238 net::URLRequestStatus status = fetcher->GetStatus(); 238 net::URLRequestStatus status = fetcher->GetStatus();
239 diagnostic_info_.last_post_response_code_ = 239 diagnostic_info_.last_post_response_code_ =
240 status.is_success() ? source->GetResponseCode() : status.error(); 240 status.is_success() ? source->GetResponseCode() : status.error();
241 241
242 if (status.is_success() && 242 if (status.is_success() &&
243 fetcher->GetResponseCode() == net::HTTP_UNAUTHORIZED) { 243 fetcher->GetResponseCode() == net::HTTP_UNAUTHORIZED) {
244 DVLOG(1) << "URLFetcher failure: HTTP_UNAUTHORIZED"; 244 DVLOG(1) << "URLFetcher failure: HTTP_UNAUTHORIZED";
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 ENUM_CASE(gcm::GCMClient::UNKNOWN_ERROR); 433 ENUM_CASE(gcm::GCMClient::UNKNOWN_ERROR);
434 ENUM_CASE(gcm::GCMClient::INVALID_PARAMETER); 434 ENUM_CASE(gcm::GCMClient::INVALID_PARAMETER);
435 ENUM_CASE(gcm::GCMClient::ASYNC_OPERATION_PENDING); 435 ENUM_CASE(gcm::GCMClient::ASYNC_OPERATION_PENDING);
436 ENUM_CASE(gcm::GCMClient::GCM_DISABLED); 436 ENUM_CASE(gcm::GCMClient::GCM_DISABLED);
437 } 437 }
438 NOTREACHED(); 438 NOTREACHED();
439 return ""; 439 return "";
440 } 440 }
441 441
442 } // namespace syncer 442 } // namespace syncer
OLDNEW
« no previous file with comments | « components/invalidation/impl/gcm_invalidation_bridge.cc ('k') | components/invalidation/impl/ticl_invalidation_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698