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

Side by Side Diff: components/printing/test/mock_printer.h

Issue 1884743002: Convert a few components from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lint Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_PRINTING_TEST_MOCK_PRINTER_H_ 5 #ifndef COMPONENTS_PRINTING_TEST_MOCK_PRINTER_H_
6 #define COMPONENTS_PRINTING_TEST_MOCK_PRINTER_H_ 6 #define COMPONENTS_PRINTING_TEST_MOCK_PRINTER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory>
10 #include <string> 11 #include <string>
11 #include <vector> 12 #include <vector>
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 #include "base/memory/scoped_ptr.h"
16 #include "base/strings/string16.h" 16 #include "base/strings/string16.h"
17 #include "printing/image.h" 17 #include "printing/image.h"
18 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" 18 #include "third_party/WebKit/public/web/WebPrintScalingOption.h"
19 #include "ui/gfx/geometry/rect.h" 19 #include "ui/gfx/geometry/rect.h"
20 #include "ui/gfx/geometry/size.h" 20 #include "ui/gfx/geometry/size.h"
21 21
22 struct PrintMsg_Print_Params; 22 struct PrintMsg_Print_Params;
23 struct PrintMsg_PrintPages_Params; 23 struct PrintMsg_PrintPages_Params;
24 struct PrintHostMsg_DidPrintPage_Params; 24 struct PrintHostMsg_DidPrintPage_Params;
25 25
(...skipping 11 matching lines...) Expand all
37 int height() const { return image_.size().height(); } 37 int height() const { return image_.size().height(); }
38 const uint8_t* source_data() const { return source_data_.get(); } 38 const uint8_t* source_data() const { return source_data_.get(); }
39 uint32_t source_size() const { return source_size_; } 39 uint32_t source_size() const { return source_size_; }
40 const printing::Image& image() const { return image_; } 40 const printing::Image& image() const { return image_; }
41 41
42 private: 42 private:
43 friend class base::RefCounted<MockPrinterPage>; 43 friend class base::RefCounted<MockPrinterPage>;
44 virtual ~MockPrinterPage(); 44 virtual ~MockPrinterPage();
45 45
46 uint32_t source_size_; 46 uint32_t source_size_;
47 scoped_ptr<uint8_t[]> source_data_; 47 std::unique_ptr<uint8_t[]> source_data_;
48 printing::Image image_; 48 printing::Image image_;
49 49
50 DISALLOW_COPY_AND_ASSIGN(MockPrinterPage); 50 DISALLOW_COPY_AND_ASSIGN(MockPrinterPage);
51 }; 51 };
52 52
53 // A class which implements a pseudo-printer object used by the RenderViewTest 53 // A class which implements a pseudo-printer object used by the RenderViewTest
54 // class. 54 // class.
55 // This class consists of three parts: 55 // This class consists of three parts:
56 // 1. An IPC-message hanlder sent from the RenderView class; 56 // 1. An IPC-message hanlder sent from the RenderView class;
57 // 2. A renderer that creates a printing job into bitmaps, and; 57 // 2. A renderer that creates a printing job into bitmaps, and;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 158
159 // Used for generating invalid settings. 159 // Used for generating invalid settings.
160 bool use_invalid_settings_; 160 bool use_invalid_settings_;
161 161
162 std::vector<scoped_refptr<MockPrinterPage>> pages_; 162 std::vector<scoped_refptr<MockPrinterPage>> pages_;
163 163
164 DISALLOW_COPY_AND_ASSIGN(MockPrinter); 164 DISALLOW_COPY_AND_ASSIGN(MockPrinter);
165 }; 165 };
166 166
167 #endif // COMPONENTS_PRINTING_TEST_MOCK_PRINTER_H_ 167 #endif // COMPONENTS_PRINTING_TEST_MOCK_PRINTER_H_
OLDNEW
« no previous file with comments | « components/printing/renderer/print_web_view_helper_mac.mm ('k') | components/printing/test/print_mock_render_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698