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

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

Issue 182333003: Build correct URL for cacheinvalidation endpoint. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@RollCacheInvalidations
Patch Set: Created 6 years, 10 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 #ifndef SYNC_NOTIFIER_GCM_NETWORK_CHANNEL_H_ 5 #ifndef SYNC_NOTIFIER_GCM_NETWORK_CHANNEL_H_
6 #define SYNC_NOTIFIER_GCM_NETWORK_CHANNEL_H_ 6 #define SYNC_NOTIFIER_GCM_NETWORK_CHANNEL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 30 matching lines...) Expand all
41 const std::string& token) OVERRIDE; 41 const std::string& token) OVERRIDE;
42 42
43 // URLFetcherDelegate implementation. 43 // URLFetcherDelegate implementation.
44 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; 44 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
45 45
46 protected: 46 protected:
47 void ResetRegisterBackoffEntryForTest( 47 void ResetRegisterBackoffEntryForTest(
48 const net::BackoffEntry::Policy* policy); 48 const net::BackoffEntry::Policy* policy);
49 49
50 private: 50 private:
51 friend class GCMNetworkChannelTest;
51 void Register(); 52 void Register();
52 void OnRegisterComplete(const std::string& registration_id, 53 void OnRegisterComplete(const std::string& registration_id,
53 gcm::GCMClient::Result result); 54 gcm::GCMClient::Result result);
54 void RequestAccessToken(); 55 void RequestAccessToken();
55 void OnGetTokenComplete(const GoogleServiceAuthError& error, 56 void OnGetTokenComplete(const GoogleServiceAuthError& error,
56 const std::string& token); 57 const std::string& token);
57 GURL BuildUrl(); 58 static GURL BuildUrl(const std::string& registration_id);
58 59
59 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; 60 scoped_refptr<net::URLRequestContextGetter> request_context_getter_;
60 scoped_ptr<GCMNetworkChannelDelegate> delegate_; 61 scoped_ptr<GCMNetworkChannelDelegate> delegate_;
61 62
62 // Message is saved until all conditions are met: there is valid 63 // Message is saved until all conditions are met: there is valid
63 // registration_id and access_token. 64 // registration_id and access_token.
64 std::string encoded_message_; 65 std::string encoded_message_;
65 66
66 // Access token is saved because in case of auth failure from server we need 67 // Access token is saved because in case of auth failure from server we need
67 // to invalidate it. 68 // to invalidate it.
68 std::string access_token_; 69 std::string access_token_;
69 70
70 // GCM registration_id is requested one at startup and never refreshed until 71 // GCM registration_id is requested one at startup and never refreshed until
71 // next restart. 72 // next restart.
72 std::string registration_id_; 73 std::string registration_id_;
73 scoped_ptr<net::BackoffEntry> register_backoff_entry_; 74 scoped_ptr<net::BackoffEntry> register_backoff_entry_;
74 75
75 scoped_ptr<net::URLFetcher> fetcher_; 76 scoped_ptr<net::URLFetcher> fetcher_;
76 77
77 base::WeakPtrFactory<GCMNetworkChannel> weak_factory_; 78 base::WeakPtrFactory<GCMNetworkChannel> weak_factory_;
78 79
79 DISALLOW_COPY_AND_ASSIGN(GCMNetworkChannel); 80 DISALLOW_COPY_AND_ASSIGN(GCMNetworkChannel);
80 }; 81 };
81 82
82 } // namespace syncer 83 } // namespace syncer
83 84
84 #endif // SYNC_NOTIFIER_GCM_NETWORK_CHANNEL_H_ 85 #endif // SYNC_NOTIFIER_GCM_NETWORK_CHANNEL_H_
OLDNEW
« no previous file with comments | « no previous file | sync/notifier/gcm_network_channel.cc » ('j') | sync/notifier/gcm_network_channel.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698