OLD | NEW |
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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 const net::HttpNetworkSession::Params* network_session_params = | 161 const net::HttpNetworkSession::Params* network_session_params = |
162 url_request_context_getter->GetURLRequestContext()-> | 162 url_request_context_getter->GetURLRequestContext()-> |
163 GetNetworkSessionParams(); | 163 GetNetworkSessionParams(); |
164 DCHECK(network_session_params); | 164 DCHECK(network_session_params); |
165 network_session_ = new net::HttpNetworkSession(*network_session_params); | 165 network_session_ = new net::HttpNetworkSession(*network_session_params); |
166 connection_factory_.reset(new ConnectionFactoryImpl( | 166 connection_factory_.reset(new ConnectionFactoryImpl( |
167 GURL(kMCSEndpoint), | 167 GURL(kMCSEndpoint), |
168 kDefaultBackoffPolicy, | 168 kDefaultBackoffPolicy, |
169 network_session_, | 169 network_session_, |
170 net_log_.net_log())); | 170 net_log_.net_log())); |
171 mcs_client_.reset(new MCSClient(clock_.get(), | 171 mcs_client_.reset(new MCSClient(chrome_build_proto.chrome_version(), |
| 172 clock_.get(), |
172 connection_factory_.get(), | 173 connection_factory_.get(), |
173 gcm_store_.get())); | 174 gcm_store_.get())); |
174 } | 175 } |
175 | 176 |
176 state_ = LOADING; | 177 state_ = LOADING; |
177 } | 178 } |
178 | 179 |
179 void GCMClientImpl::OnLoadCompleted(scoped_ptr<GCMStore::LoadResult> result) { | 180 void GCMClientImpl::OnLoadCompleted(scoped_ptr<GCMStore::LoadResult> result) { |
180 DCHECK_EQ(LOADING, state_); | 181 DCHECK_EQ(LOADING, state_); |
181 | 182 |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 if (iter != incoming_message.data.end()) | 570 if (iter != incoming_message.data.end()) |
570 message_id = iter->second; | 571 message_id = iter->second; |
571 delegate->OnMessageSendError(app_id, message_id, SERVER_ERROR); | 572 delegate->OnMessageSendError(app_id, message_id, SERVER_ERROR); |
572 } | 573 } |
573 | 574 |
574 void GCMClientImpl::SetMCSClientForTesting(scoped_ptr<MCSClient> mcs_client) { | 575 void GCMClientImpl::SetMCSClientForTesting(scoped_ptr<MCSClient> mcs_client) { |
575 mcs_client_ = mcs_client.Pass(); | 576 mcs_client_ = mcs_client.Pass(); |
576 } | 577 } |
577 | 578 |
578 } // namespace gcm | 579 } // namespace gcm |
OLD | NEW |