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

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

Issue 648873003: Adding instrumentation to locate the source of jankiness. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
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/profiler/scoped_profile.h"
8 #include "base/sha1.h" 9 #include "base/sha1.h"
9 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
11 #if !defined(OS_ANDROID) 12 #if !defined(OS_ANDROID)
12 // channel_common.proto defines ANDROID constant that conflicts with Android 13 // channel_common.proto defines ANDROID constant that conflicts with Android
13 // build. At the same time TiclInvalidationService is not used on Android so it 14 // build. At the same time TiclInvalidationService is not used on Android so it
14 // is safe to exclude these protos from Android build. 15 // is safe to exclude these protos from Android build.
15 #include "google/cacheinvalidation/android_channel.pb.h" 16 #include "google/cacheinvalidation/android_channel.pb.h"
16 #include "google/cacheinvalidation/channel_common.pb.h" 17 #include "google/cacheinvalidation/channel_common.pb.h"
17 #include "google/cacheinvalidation/types.pb.h" 18 #include "google/cacheinvalidation/types.pb.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 const std::string echo_header("echo-token: " + echo_token_); 217 const std::string echo_header("echo-token: " + echo_token_);
217 fetcher_->AddExtraRequestHeader(echo_header); 218 fetcher_->AddExtraRequestHeader(echo_header);
218 } 219 }
219 fetcher_->SetUploadData("application/x-protobuffer", cached_message_); 220 fetcher_->SetUploadData("application/x-protobuffer", cached_message_);
220 fetcher_->Start(); 221 fetcher_->Start();
221 // Clear message to prevent accidentally resending it in the future. 222 // Clear message to prevent accidentally resending it in the future.
222 cached_message_.clear(); 223 cached_message_.clear();
223 } 224 }
224 225
225 void GCMNetworkChannel::OnURLFetchComplete(const net::URLFetcher* source) { 226 void GCMNetworkChannel::OnURLFetchComplete(const net::URLFetcher* source) {
227 // TODO(vadimt): Remove ScopedProfile below once crbug.com/422577 is fixed.
228 tracked_objects::ScopedProfile tracking_profile(
229 FROM_HERE_WITH_EXPLICIT_FUNCTION(
230 "422577 GCMNetworkChannel::OnURLFetchComplete"));
231
226 DCHECK(CalledOnValidThread()); 232 DCHECK(CalledOnValidThread());
227 DCHECK_EQ(fetcher_, source); 233 DCHECK_EQ(fetcher_, source);
228 // Free fetcher at the end of function. 234 // Free fetcher at the end of function.
229 scoped_ptr<net::URLFetcher> fetcher = fetcher_.Pass(); 235 scoped_ptr<net::URLFetcher> fetcher = fetcher_.Pass();
230 236
231 net::URLRequestStatus status = fetcher->GetStatus(); 237 net::URLRequestStatus status = fetcher->GetStatus();
232 diagnostic_info_.last_post_response_code_ = 238 diagnostic_info_.last_post_response_code_ =
233 status.is_success() ? source->GetResponseCode() : status.error(); 239 status.is_success() ? source->GetResponseCode() : status.error();
234 240
235 if (status.is_success() && 241 if (status.is_success() &&
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 ENUM_CASE(gcm::GCMClient::NOT_SIGNED_IN); 455 ENUM_CASE(gcm::GCMClient::NOT_SIGNED_IN);
450 ENUM_CASE(gcm::GCMClient::INVALID_PARAMETER); 456 ENUM_CASE(gcm::GCMClient::INVALID_PARAMETER);
451 ENUM_CASE(gcm::GCMClient::ASYNC_OPERATION_PENDING); 457 ENUM_CASE(gcm::GCMClient::ASYNC_OPERATION_PENDING);
452 ENUM_CASE(gcm::GCMClient::GCM_DISABLED); 458 ENUM_CASE(gcm::GCMClient::GCM_DISABLED);
453 } 459 }
454 NOTREACHED(); 460 NOTREACHED();
455 return ""; 461 return "";
456 } 462 }
457 463
458 } // namespace syncer 464 } // namespace syncer
OLDNEW
« no previous file with comments | « components/google/core/browser/google_url_tracker.cc ('k') | components/policy/core/common/cloud/device_management_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698