Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_PPD_CACHE_H_ | 5 #ifndef CHROMEOS_PRINTING_PPD_CACHE_H_ |
| 6 #define CHROMEOS_PRINTING_PPD_CACHE_H_ | 6 #define CHROMEOS_PRINTING_PPD_CACHE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 // If a different PPD was previously Stored for the given reference, it | 66 // If a different PPD was previously Stored for the given reference, it |
| 67 // will be replaced. | 67 // will be replaced. |
| 68 // | 68 // |
| 69 // If a FilePath is returned, it is guaranteed to be non-empty and | 69 // If a FilePath is returned, it is guaranteed to be non-empty and |
| 70 // remain valid until the next Store() call. | 70 // remain valid until the next Store() call. |
| 71 virtual base::Optional<base::FilePath> Store( | 71 virtual base::Optional<base::FilePath> Store( |
| 72 const Printer::PpdReference& reference, | 72 const Printer::PpdReference& reference, |
| 73 const std::string& ppd_contents) = 0; | 73 const std::string& ppd_contents) = 0; |
| 74 | 74 |
| 75 // Return a map of available printers, if we have one available and it's | 75 // Return a map of available printers, if we have one available and it's |
| 76 // not too stale. | 76 // not too stale. Returns null if no map is available. |
| 77 virtual base::Optional<PpdProvider::AvailablePrintersMap> | 77 // |
| 78 FindAvailablePrinters() = 0; | 78 // If a map is returned, ownership is retained by the cache. |
| 79 virtual const PpdProvider::AvailablePrintersMap* FindAvailablePrinters() = 0; | |
|
skau
2016/11/10 20:46:37
Make a note of the expected lifetime of the map i.
Carlson
2016/11/11 01:39:27
Done.
| |
| 79 | 80 |
| 80 // Store |available_printers|, replacing any existing entry. | 81 // Store |available_printers|, replacing any existing entry. |
| 81 virtual void StoreAvailablePrinters( | 82 virtual void StoreAvailablePrinters( |
| 82 const PpdProvider::AvailablePrintersMap& available_printers) = 0; | 83 std::unique_ptr<PpdProvider::AvailablePrintersMap> |
| 84 available_printers) = 0; | |
| 83 }; | 85 }; |
| 84 | 86 |
| 85 } // namespace printing | 87 } // namespace printing |
| 86 } // namespace chromeos | 88 } // namespace chromeos |
| 87 | 89 |
| 88 #endif // CHROMEOS_PRINTING_PPD_CACHE_H_ | 90 #endif // CHROMEOS_PRINTING_PPD_CACHE_H_ |
| OLD | NEW |