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

Side by Side Diff: sync/notifier/gcm_network_channel.cc

Issue 186623006: Refactor GCMNetworkChannelDelegateImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another rebase to resolve conflict with recent change. Created 6 years, 9 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 | « chrome/chrome_tests_unit.gypi ('k') | sync/notifier/gcm_network_channel_delegate.h » ('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 "google_apis/gaia/google_service_auth_error.h" 5 #include "google_apis/gaia/google_service_auth_error.h"
6 #include "net/http/http_status_code.h" 6 #include "net/http/http_status_code.h"
7 #include "net/url_request/url_fetcher.h" 7 #include "net/url_request/url_fetcher.h"
8 #include "net/url_request/url_request_status.h" 8 #include "net/url_request/url_request_status.h"
9 #include "sync/notifier/gcm_network_channel.h" 9 #include "sync/notifier/gcm_network_channel.h"
10 #include "sync/notifier/gcm_network_channel_delegate.h" 10 #include "sync/notifier/gcm_network_channel_delegate.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 } // namespace 43 } // namespace
44 44
45 GCMNetworkChannel::GCMNetworkChannel( 45 GCMNetworkChannel::GCMNetworkChannel(
46 scoped_refptr<net::URLRequestContextGetter> request_context_getter, 46 scoped_refptr<net::URLRequestContextGetter> request_context_getter,
47 scoped_ptr<GCMNetworkChannelDelegate> delegate) 47 scoped_ptr<GCMNetworkChannelDelegate> delegate)
48 : request_context_getter_(request_context_getter), 48 : request_context_getter_(request_context_getter),
49 delegate_(delegate.Pass()), 49 delegate_(delegate.Pass()),
50 register_backoff_entry_(new net::BackoffEntry(&kRegisterBackoffPolicy)), 50 register_backoff_entry_(new net::BackoffEntry(&kRegisterBackoffPolicy)),
51 weak_factory_(this) { 51 weak_factory_(this) {
52 delegate_->Initialize();
52 Register(); 53 Register();
53 } 54 }
54 55
55 GCMNetworkChannel::~GCMNetworkChannel() { 56 GCMNetworkChannel::~GCMNetworkChannel() {
56 } 57 }
57 58
58 void GCMNetworkChannel::UpdateCredentials( 59 void GCMNetworkChannel::UpdateCredentials(
59 const std::string& email, 60 const std::string& email,
60 const std::string& token) { 61 const std::string& token) {
61 // Do nothing. We get access token by requesting it for every message. 62 // Do nothing. We get access token by requesting it for every message.
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 GURL GCMNetworkChannel::BuildUrl() { 178 GURL GCMNetworkChannel::BuildUrl() {
178 DCHECK(!registration_id_.empty()); 179 DCHECK(!registration_id_.empty());
179 // Prepare NetworkEndpointId using registration_id 180 // Prepare NetworkEndpointId using registration_id
180 // Serialize NetworkEndpointId into byte array and base64 encode. 181 // Serialize NetworkEndpointId into byte array and base64 encode.
181 // Format url using encoded NetworkEndpointId. 182 // Format url using encoded NetworkEndpointId.
182 // TODO(pavely): implement all of the above. 183 // TODO(pavely): implement all of the above.
183 return GURL("http://invalid.url.com"); 184 return GURL("http://invalid.url.com");
184 } 185 }
185 186
186 } // namespace syncer 187 } // namespace syncer
OLDNEW
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | sync/notifier/gcm_network_channel_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698