OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/service/cloud_print/cloud_print_proxy_backend.h" | 5 #include "chrome/service/cloud_print/cloud_print_proxy_backend.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 const ConnectorSettings& settings, | 168 const ConnectorSettings& settings, |
169 const gaia::OAuthClientInfo& oauth_client_info, | 169 const gaia::OAuthClientInfo& oauth_client_info, |
170 bool enable_job_poll) | 170 bool enable_job_poll) |
171 : core_thread_("Chrome_CloudPrintProxyCoreThread"), | 171 : core_thread_("Chrome_CloudPrintProxyCoreThread"), |
172 frontend_loop_(base::MessageLoop::current()), | 172 frontend_loop_(base::MessageLoop::current()), |
173 frontend_(frontend) { | 173 frontend_(frontend) { |
174 DCHECK(frontend_); | 174 DCHECK(frontend_); |
175 core_ = new Core(this, settings, oauth_client_info, enable_job_poll); | 175 core_ = new Core(this, settings, oauth_client_info, enable_job_poll); |
176 } | 176 } |
177 | 177 |
178 CloudPrintProxyBackend::~CloudPrintProxyBackend() { | 178 CloudPrintProxyBackend::~CloudPrintProxyBackend() { DCHECK(!core_.get()); } |
179 DCHECK(!core_); | |
180 } | |
181 | 179 |
182 bool CloudPrintProxyBackend::InitializeWithLsid( | 180 bool CloudPrintProxyBackend::InitializeWithLsid( |
183 const std::string& lsid, | 181 const std::string& lsid, |
184 const std::string& last_robot_refresh_token, | 182 const std::string& last_robot_refresh_token, |
185 const std::string& last_robot_email, | 183 const std::string& last_robot_email, |
186 const std::string& last_user_email) { | 184 const std::string& last_user_email) { |
187 if (!core_thread_.Start()) | 185 if (!core_thread_.Start()) |
188 return false; | 186 return false; |
189 core_thread_.message_loop()->PostTask( | 187 core_thread_.message_loop()->PostTask( |
190 FROM_HERE, | 188 FROM_HERE, |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 notification.channel.c_str())) | 568 notification.channel.c_str())) |
571 HandlePrinterNotification(notification.data); | 569 HandlePrinterNotification(notification.data); |
572 } | 570 } |
573 | 571 |
574 void CloudPrintProxyBackend::Core::OnPingResponse() { | 572 void CloudPrintProxyBackend::Core::OnPingResponse() { |
575 pending_xmpp_pings_ = 0; | 573 pending_xmpp_pings_ = 0; |
576 VLOG(1) << "CP_CONNECTOR: Ping response received."; | 574 VLOG(1) << "CP_CONNECTOR: Ping response received."; |
577 } | 575 } |
578 | 576 |
579 } // namespace cloud_print | 577 } // namespace cloud_print |
OLD | NEW |