Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: chrome/browser/chromeos/printing/cups_print_job_manager_impl.h

Issue 2943843002: Convert to CupsPrintJobManagerImpl to TaskScheduler. (Closed)
Patch Set: add an io assertion Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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_BROWSER_CHROMEOS_PRINTING_CUPS_PRINT_JOB_MANAGER_IMPL_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_PRINTING_CUPS_PRINT_JOB_MANAGER_IMPL_H_
6 #define CHROME_BROWSER_CHROMEOS_PRINTING_CUPS_PRINT_JOB_MANAGER_IMPL_H_ 6 #define CHROME_BROWSER_CHROMEOS_PRINTING_CUPS_PRINT_JOB_MANAGER_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
11 #include <unordered_map> 11 #include <unordered_map>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/memory/ref_counted.h"
14 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "base/sequenced_task_runner.h"
15 #include "chrome/browser/chromeos/printing/cups_print_job.h" 17 #include "chrome/browser/chromeos/printing/cups_print_job.h"
16 #include "chrome/browser/chromeos/printing/cups_print_job_manager.h" 18 #include "chrome/browser/chromeos/printing/cups_print_job_manager.h"
17 #include "chrome/browser/chromeos/printing/printers_manager.h" 19 #include "chrome/browser/chromeos/printing/printers_manager.h"
18 #include "content/public/browser/notification_observer.h" 20 #include "content/public/browser/notification_observer.h"
19 #include "content/public/browser/notification_registrar.h" 21 #include "content/public/browser/notification_registrar.h"
20 #include "printing/backend/cups_connection.h" 22 #include "printing/backend/cups_connection.h"
21 23
22 class Profile; 24 class Profile;
23 25
24 namespace chromeos { 26 namespace chromeos {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 std::map<std::string, std::unique_ptr<CupsPrintJob>> jobs_; 89 std::map<std::string, std::unique_ptr<CupsPrintJob>> jobs_;
88 90
89 // Prevents multiple queries from being scheduled simultaneously. 91 // Prevents multiple queries from being scheduled simultaneously.
90 bool in_query_ = false; 92 bool in_query_ = false;
91 93
92 // Records the number of consecutive times the GetJobs query has failed. 94 // Records the number of consecutive times the GetJobs query has failed.
93 int retry_count_ = 0; 95 int retry_count_ = 0;
94 96
95 ::printing::CupsConnection cups_connection_; 97 ::printing::CupsConnection cups_connection_;
96 content::NotificationRegistrar registrar_; 98 content::NotificationRegistrar registrar_;
99 scoped_refptr<base::SequencedTaskRunner> query_runner_;
97 base::WeakPtrFactory<CupsPrintJobManagerImpl> weak_ptr_factory_; 100 base::WeakPtrFactory<CupsPrintJobManagerImpl> weak_ptr_factory_;
98 101
99 DISALLOW_COPY_AND_ASSIGN(CupsPrintJobManagerImpl); 102 DISALLOW_COPY_AND_ASSIGN(CupsPrintJobManagerImpl);
100 }; 103 };
101 104
102 } // namespace chromeos 105 } // namespace chromeos
103 106
104 #endif // CHROME_BROWSER_CHROMEOS_PRINTING_CUPS_PRINT_JOB_MANAGER_IMPL_H_ 107 #endif // CHROME_BROWSER_CHROMEOS_PRINTING_CUPS_PRINT_JOB_MANAGER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698