OLD | NEW |
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 COMPONENTS_INVALIDATION_GCM_NETWORK_CHANNEL_H_ | 5 #ifndef COMPONENTS_INVALIDATION_GCM_NETWORK_CHANNEL_H_ |
6 #define COMPONENTS_INVALIDATION_GCM_NETWORK_CHANNEL_H_ | 6 #define COMPONENTS_INVALIDATION_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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 private: | 86 private: |
87 friend class GCMNetworkChannelTest; | 87 friend class GCMNetworkChannelTest; |
88 void Register(); | 88 void Register(); |
89 void OnRegisterComplete(const std::string& registration_id, | 89 void OnRegisterComplete(const std::string& registration_id, |
90 gcm::GCMClient::Result result); | 90 gcm::GCMClient::Result result); |
91 void RequestAccessToken(); | 91 void RequestAccessToken(); |
92 void OnGetTokenComplete(const GoogleServiceAuthError& error, | 92 void OnGetTokenComplete(const GoogleServiceAuthError& error, |
93 const std::string& token); | 93 const std::string& token); |
94 void OnIncomingMessage(const std::string& message, | 94 void OnIncomingMessage(const std::string& message, |
95 const std::string& echo_token); | 95 const std::string& echo_token); |
| 96 void OnConnectionStateChanged( |
| 97 GCMNetworkChannelDelegate::ConnectionState connection_state); |
96 | 98 |
97 // Base64 encoding/decoding with URL safe alphabet. | 99 // Base64 encoding/decoding with URL safe alphabet. |
98 // http://tools.ietf.org/html/rfc4648#page-7 | 100 // http://tools.ietf.org/html/rfc4648#page-7 |
99 static void Base64EncodeURLSafe(const std::string& input, | 101 static void Base64EncodeURLSafe(const std::string& input, |
100 std::string* output); | 102 std::string* output); |
101 static bool Base64DecodeURLSafe(const std::string& input, | 103 static bool Base64DecodeURLSafe(const std::string& input, |
102 std::string* output); | 104 std::string* output); |
103 | 105 |
104 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; | 106 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; |
105 scoped_ptr<GCMNetworkChannelDelegate> delegate_; | 107 scoped_ptr<GCMNetworkChannelDelegate> delegate_; |
(...skipping 20 matching lines...) Expand all Loading... |
126 GCMNetworkChannelDiagnostic diagnostic_info_; | 128 GCMNetworkChannelDiagnostic diagnostic_info_; |
127 | 129 |
128 base::WeakPtrFactory<GCMNetworkChannel> weak_factory_; | 130 base::WeakPtrFactory<GCMNetworkChannel> weak_factory_; |
129 | 131 |
130 DISALLOW_COPY_AND_ASSIGN(GCMNetworkChannel); | 132 DISALLOW_COPY_AND_ASSIGN(GCMNetworkChannel); |
131 }; | 133 }; |
132 | 134 |
133 } // namespace syncer | 135 } // namespace syncer |
134 | 136 |
135 #endif // COMPONENTS_INVALIDATION_GCM_NETWORK_CHANNEL_H_ | 137 #endif // COMPONENTS_INVALIDATION_GCM_NETWORK_CHANNEL_H_ |
OLD | NEW |