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

Side by Side Diff: chromeos/printing/fake_printer_discoverer.h

Issue 2466993005: [CUPS] Fix the occasional crash when switching between different dialogs. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | chromeos/printing/fake_printer_discoverer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 CHROMEOS_PRINTING_FAKE_PRINTER_DISCOVERER_H_ 5 #ifndef CHROMEOS_PRINTING_FAKE_PRINTER_DISCOVERER_H_
6 #define CHROMEOS_PRINTING_FAKE_PRINTER_DISCOVERER_H_ 6 #define CHROMEOS_PRINTING_FAKE_PRINTER_DISCOVERER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "chromeos/printing/printer_configuration.h" 12 #include "chromeos/printing/printer_configuration.h"
13 #include "chromeos/printing/printer_discoverer.h" 13 #include "chromeos/printing/printer_discoverer.h"
14 14
15 namespace chromeos { 15 namespace chromeos {
16 16
17 class FakePrinterDiscoverer : public PrinterDiscoverer { 17 class FakePrinterDiscoverer : public PrinterDiscoverer {
18 public: 18 public:
19 FakePrinterDiscoverer(); 19 FakePrinterDiscoverer();
20 ~FakePrinterDiscoverer(); 20 ~FakePrinterDiscoverer() override;
21 21
22 bool StartDiscovery() override; 22 bool StartDiscovery() override;
23 bool StopDiscovery() override; 23 bool StopDiscovery() override;
24 void AddObserver(PrinterDiscoverer::Observer* observer) override; 24 void AddObserver(PrinterDiscoverer::Observer* observer) override;
25 void RemoveObserver(PrinterDiscoverer::Observer* observer) override; 25 void RemoveObserver(PrinterDiscoverer::Observer* observer) override;
26 26
27 private: 27 private:
28 void EmitPrinters(size_t start, size_t end); 28 void EmitPrinters(size_t start, size_t end);
29 29
30 std::vector<chromeos::Printer> printers_; 30 std::vector<chromeos::Printer> printers_;
31 bool discovery_running_; 31 bool discovery_running_;
32 std::vector<PrinterDiscoverer::Observer*> observers_; 32 std::vector<PrinterDiscoverer::Observer*> observers_;
33 33
34 base::WeakPtrFactory<FakePrinterDiscoverer> weak_ptr_factory_; 34 base::WeakPtrFactory<FakePrinterDiscoverer> weak_ptr_factory_;
35 35
36 DISALLOW_COPY_AND_ASSIGN(FakePrinterDiscoverer); 36 DISALLOW_COPY_AND_ASSIGN(FakePrinterDiscoverer);
37 }; 37 };
38 38
39 } // namespace chromeos 39 } // namespace chromeos
40 40
41 #endif // CHROMEOS_PRINTING_FAKE_PRINTER_DISCOVERER_H_ 41 #endif // CHROMEOS_PRINTING_FAKE_PRINTER_DISCOVERER_H_
OLDNEW
« no previous file with comments | « no previous file | chromeos/printing/fake_printer_discoverer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698