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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 // Cloud Print authenticator. | 132 // Cloud Print authenticator. |
133 scoped_refptr<CloudPrintAuth> auth_; | 133 scoped_refptr<CloudPrintAuth> auth_; |
134 | 134 |
135 // Cloud Print connector. | 135 // Cloud Print connector. |
136 scoped_refptr<CloudPrintConnector> connector_; | 136 scoped_refptr<CloudPrintConnector> connector_; |
137 | 137 |
138 // OAuth client info. | 138 // OAuth client info. |
139 gaia::OAuthClientInfo oauth_client_info_; | 139 gaia::OAuthClientInfo oauth_client_info_; |
140 // Notification (xmpp) handler. | 140 // Notification (xmpp) handler. |
141 scoped_ptr<notifier::PushClient> push_client_; | 141 std::unique_ptr<notifier::PushClient> push_client_; |
142 // Indicates whether XMPP notifications are currently enabled. | 142 // Indicates whether XMPP notifications are currently enabled. |
143 bool notifications_enabled_; | 143 bool notifications_enabled_; |
144 // The time when notifications were enabled. Valid only when | 144 // The time when notifications were enabled. Valid only when |
145 // notifications_enabled_ is true. | 145 // notifications_enabled_ is true. |
146 base::TimeTicks notifications_enabled_since_; | 146 base::TimeTicks notifications_enabled_since_; |
147 // Indicates whether a task to poll for jobs has been scheduled. | 147 // Indicates whether a task to poll for jobs has been scheduled. |
148 bool job_poll_scheduled_; | 148 bool job_poll_scheduled_; |
149 // Indicates whether we should poll for jobs when we lose XMPP connection. | 149 // Indicates whether we should poll for jobs when we lose XMPP connection. |
150 bool enable_job_poll_; | 150 bool enable_job_poll_; |
151 // Indicates whether a task to ping xmpp server has been scheduled. | 151 // Indicates whether a task to ping xmpp server has been scheduled. |
152 bool xmpp_ping_scheduled_; | 152 bool xmpp_ping_scheduled_; |
153 // Number of XMPP pings pending reply from the server. | 153 // Number of XMPP pings pending reply from the server. |
154 int pending_xmpp_pings_; | 154 int pending_xmpp_pings_; |
155 // Connector settings. | 155 // Connector settings. |
156 ConnectorSettings settings_; | 156 ConnectorSettings settings_; |
157 std::string robot_email_; | 157 std::string robot_email_; |
158 scoped_ptr<CloudPrintTokenStore> token_store_; | 158 std::unique_ptr<CloudPrintTokenStore> token_store_; |
159 | 159 |
160 DISALLOW_COPY_AND_ASSIGN(Core); | 160 DISALLOW_COPY_AND_ASSIGN(Core); |
161 }; | 161 }; |
162 | 162 |
163 CloudPrintProxyBackend::CloudPrintProxyBackend( | 163 CloudPrintProxyBackend::CloudPrintProxyBackend( |
164 CloudPrintProxyFrontend* frontend, | 164 CloudPrintProxyFrontend* frontend, |
165 const ConnectorSettings& settings, | 165 const ConnectorSettings& settings, |
166 const gaia::OAuthClientInfo& oauth_client_info, | 166 const gaia::OAuthClientInfo& oauth_client_info, |
167 bool enable_job_poll) | 167 bool enable_job_poll) |
168 : core_thread_("Chrome_CloudPrintProxyCoreThread"), | 168 : core_thread_("Chrome_CloudPrintProxyCoreThread"), |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 HandlePrinterNotification(notification.data); | 558 HandlePrinterNotification(notification.data); |
559 } | 559 } |
560 | 560 |
561 void CloudPrintProxyBackend::Core::OnPingResponse() { | 561 void CloudPrintProxyBackend::Core::OnPingResponse() { |
562 UMA_HISTOGRAM_COUNTS_100("CloudPrint.XmppPingTry", pending_xmpp_pings_); | 562 UMA_HISTOGRAM_COUNTS_100("CloudPrint.XmppPingTry", pending_xmpp_pings_); |
563 pending_xmpp_pings_ = 0; | 563 pending_xmpp_pings_ = 0; |
564 VLOG(1) << "CP_CONNECTOR: Ping response received."; | 564 VLOG(1) << "CP_CONNECTOR: Ping response received."; |
565 } | 565 } |
566 | 566 |
567 } // namespace cloud_print | 567 } // namespace cloud_print |
OLD | NEW |