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 #ifndef CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_ | 5 #ifndef CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_ |
6 #define CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_ | 6 #define CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 JobDetails job_details_; | 261 JobDetails job_details_; |
262 Delegate* delegate_; | 262 Delegate* delegate_; |
263 // Once the job has been spooled to the local spooler, this specifies the | 263 // Once the job has been spooled to the local spooler, this specifies the |
264 // job id of the job on the local spooler. | 264 // job id of the job on the local spooler. |
265 PlatformJobId local_job_id_; | 265 PlatformJobId local_job_id_; |
266 | 266 |
267 // The next response handler can either be a JSONDataHandler or a | 267 // The next response handler can either be a JSONDataHandler or a |
268 // DataHandler (depending on the current request being made). | 268 // DataHandler (depending on the current request being made). |
269 JSONDataHandler next_json_data_handler_; | 269 JSONDataHandler next_json_data_handler_; |
270 DataHandler next_data_handler_; | 270 DataHandler next_data_handler_; |
271 // The number of consecutive times that connecting to the server failed. | |
272 int server_error_count_; | |
273 // The thread on which the actual print operation happens | 271 // The thread on which the actual print operation happens |
274 base::Thread print_thread_; | 272 base::Thread print_thread_; |
275 // The Job spooler object. This is only non-NULL during a print operation. | 273 // The Job spooler object. This is only non-NULL during a print operation. |
276 // It lives and dies on |print_thread_| | 274 // It lives and dies on |print_thread_| |
277 scoped_refptr<PrintSystem::JobSpooler> job_spooler_; | 275 scoped_refptr<PrintSystem::JobSpooler> job_spooler_; |
278 // The message loop proxy representing the thread on which this object | 276 // The message loop proxy representing the thread on which this object |
279 // was created. Used by the print thread. | 277 // was created. Used by the print thread. |
280 scoped_refptr<base::MessageLoopProxy> job_handler_message_loop_proxy_; | 278 scoped_refptr<base::MessageLoopProxy> job_handler_message_loop_proxy_; |
281 | 279 |
282 // There may be pending tasks in the message queue when Shutdown is called. | 280 // There may be pending tasks in the message queue when Shutdown is called. |
283 // We set this flag so as to do nothing in those tasks. | 281 // We set this flag so as to do nothing in those tasks. |
284 bool shutting_down_; | 282 bool shutting_down_; |
285 | 283 |
286 // A string indicating the reason we are fetching jobs from the server | 284 // A string indicating the reason we are fetching jobs from the server |
287 // (used to specify the reason in the fetch URL). | 285 // (used to specify the reason in the fetch URL). |
288 std::string job_fetch_reason_; | 286 std::string job_fetch_reason_; |
289 // Flags that specify various pending server updates | 287 // Flags that specify various pending server updates |
290 bool job_check_pending_; | 288 bool job_check_pending_; |
291 bool printer_update_pending_; | 289 bool printer_update_pending_; |
292 | 290 |
293 // Number of seconds between XMPP pings (for server registration) | |
294 int xmpp_ping_interval_; | |
295 | |
296 // Some task in the state machine is in progress. | 291 // Some task in the state machine is in progress. |
297 bool task_in_progress_; | 292 bool task_in_progress_; |
298 scoped_refptr<PrintSystem::PrinterWatcher> printer_watcher_; | 293 scoped_refptr<PrintSystem::PrinterWatcher> printer_watcher_; |
299 typedef std::list< scoped_refptr<JobStatusUpdater> > JobStatusUpdaterList; | 294 typedef std::list< scoped_refptr<JobStatusUpdater> > JobStatusUpdaterList; |
300 JobStatusUpdaterList job_status_updater_list_; | 295 JobStatusUpdaterList job_status_updater_list_; |
301 | 296 |
302 // Manages parsing the job queue | 297 // Manages parsing the job queue |
303 PrinterJobQueueHandler job_queue_handler_; | 298 PrinterJobQueueHandler job_queue_handler_; |
304 | 299 |
305 base::TimeTicks last_job_fetch_time_; | 300 base::TimeTicks last_job_fetch_time_; |
306 | 301 |
307 base::Time job_start_time_; | 302 base::Time job_start_time_; |
308 base::Time spooling_start_time_; | 303 base::Time spooling_start_time_; |
309 base::Time last_caps_update_time_; | 304 base::Time last_caps_update_time_; |
310 | 305 |
311 base::WeakPtrFactory<PrinterJobHandler> weak_ptr_factory_; | 306 base::WeakPtrFactory<PrinterJobHandler> weak_ptr_factory_; |
312 | 307 |
313 DISALLOW_COPY_AND_ASSIGN(PrinterJobHandler); | 308 DISALLOW_COPY_AND_ASSIGN(PrinterJobHandler); |
314 }; | 309 }; |
315 | 310 |
316 // This typedef is to workaround the issue with certain versions of | 311 // This typedef is to workaround the issue with certain versions of |
317 // Visual Studio where it gets confused between multiple Delegate | 312 // Visual Studio where it gets confused between multiple Delegate |
318 // classes and gives a C2500 error. (I saw this error on the try bots - | 313 // classes and gives a C2500 error. (I saw this error on the try bots - |
319 // the workaround was not needed for my machine). | 314 // the workaround was not needed for my machine). |
320 typedef PrinterJobHandler::Delegate PrinterJobHandlerDelegate; | 315 typedef PrinterJobHandler::Delegate PrinterJobHandlerDelegate; |
321 | 316 |
322 } // namespace cloud_print | 317 } // namespace cloud_print |
323 | 318 |
324 #endif // CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_ | 319 #endif // CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_ |
OLD | NEW |