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

Side by Side Diff: google_apis/gcm/gcm_client_impl.cc

Issue 261573002: Add checkin activity recording to gcm recorder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/gcm_client_impl.h" 5 #include "google_apis/gcm/gcm_client_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 device_checkin_info_.android_id, 298 device_checkin_info_.android_id,
299 device_checkin_info_.secret, 299 device_checkin_info_.secret,
300 std::string(), 300 std::string(),
301 account_ids_, 301 account_ids_,
302 chrome_build_proto_); 302 chrome_build_proto_);
303 checkin_request_.reset( 303 checkin_request_.reset(
304 new CheckinRequest(request_info, 304 new CheckinRequest(request_info,
305 kDefaultBackoffPolicy, 305 kDefaultBackoffPolicy,
306 base::Bind(&GCMClientImpl::OnCheckinCompleted, 306 base::Bind(&GCMClientImpl::OnCheckinCompleted,
307 weak_ptr_factory_.GetWeakPtr()), 307 weak_ptr_factory_.GetWeakPtr()),
308 url_request_context_getter_)); 308 url_request_context_getter_,
309 &recorder_));
309 checkin_request_->Start(); 310 checkin_request_->Start();
310 } 311 }
311 312
312 void GCMClientImpl::OnCheckinCompleted( 313 void GCMClientImpl::OnCheckinCompleted(
313 const checkin_proto::AndroidCheckinResponse& checkin_response) { 314 const checkin_proto::AndroidCheckinResponse& checkin_response) {
314 checkin_request_.reset(); 315 checkin_request_.reset();
315 316
316 if (!checkin_response.has_android_id() || 317 if (!checkin_response.has_android_id() ||
317 !checkin_response.has_security_token()) { 318 !checkin_response.has_security_token()) {
318 // TODO(fgorski): I don't think a retry here will help, we should probably 319 // TODO(fgorski): I don't think a retry here will help, we should probably
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 735
735 recorder_.RecordIncomingSendError( 736 recorder_.RecordIncomingSendError(
736 data_message_stanza.category(), 737 data_message_stanza.category(),
737 data_message_stanza.to(), 738 data_message_stanza.to(),
738 data_message_stanza.id()); 739 data_message_stanza.id());
739 delegate_->OnMessageSendError(data_message_stanza.category(), 740 delegate_->OnMessageSendError(data_message_stanza.category(),
740 send_error_details); 741 send_error_details);
741 } 742 }
742 743
743 } // namespace gcm 744 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698