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

Side by Side Diff: chrome/browser/printing/print_preview_data_service.h

Issue 2828693006: Use unique_ptrs in PrintPreviewDataService. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/printing/print_preview_data_service.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 (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_BROWSER_PRINTING_PRINT_PREVIEW_DATA_SERVICE_H_ 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_PREVIEW_DATA_SERVICE_H_
6 #define CHROME_BROWSER_PRINTING_PRINT_PREVIEW_DATA_SERVICE_H_ 6 #define CHROME_BROWSER_PRINTING_PRINT_PREVIEW_DATA_SERVICE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <memory>
11 #include <string> 12 #include <string>
12 13
13 #include "base/macros.h" 14 #include "base/macros.h"
14 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
15 16
16 class PrintPreviewDataStore; 17 class PrintPreviewDataStore;
17 18
18 namespace base { 19 namespace base {
19 template <typename T> 20 template <typename T>
20 struct DefaultSingletonTraits; 21 struct DefaultSingletonTraits;
(...skipping 29 matching lines...) Expand all
50 // Returns the available draft page count. 51 // Returns the available draft page count.
51 int GetAvailableDraftPageCount(int32_t preview_ui_id) const; 52 int GetAvailableDraftPageCount(int32_t preview_ui_id) const;
52 53
53 private: 54 private:
54 friend struct base::DefaultSingletonTraits<PrintPreviewDataService>; 55 friend struct base::DefaultSingletonTraits<PrintPreviewDataService>;
55 56
56 // 1:1 relationship between PrintPreviewUI and data store object. 57 // 1:1 relationship between PrintPreviewUI and data store object.
57 // Key: PrintPreviewUI ID. 58 // Key: PrintPreviewUI ID.
58 // Value: Print preview data store object. 59 // Value: Print preview data store object.
59 using PreviewDataStoreMap = 60 using PreviewDataStoreMap =
60 std::map<int32_t, scoped_refptr<PrintPreviewDataStore>>; 61 std::map<int32_t, std::unique_ptr<PrintPreviewDataStore>>;
61 62
62 PrintPreviewDataService(); 63 PrintPreviewDataService();
63 ~PrintPreviewDataService(); 64 ~PrintPreviewDataService();
64 65
65 PreviewDataStoreMap data_store_map_; 66 PreviewDataStoreMap data_store_map_;
66 67
67 DISALLOW_COPY_AND_ASSIGN(PrintPreviewDataService); 68 DISALLOW_COPY_AND_ASSIGN(PrintPreviewDataService);
68 }; 69 };
69 70
70 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_DATA_SERVICE_H_ 71 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_DATA_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/printing/print_preview_data_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698