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

Side by Side Diff: win8/metro_driver/print_document_source.h

Issue 700723004: Do not use vector<scoped_ptr<>>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 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 | « media/midi/midi_manager_win.cc ('k') | win8/metro_driver/print_document_source.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_UI_METRO_DRIVER_PRINT_DOCUMENT_SOURCE_H_ 5 #ifndef CHROME_BROWSER_UI_METRO_DRIVER_PRINT_DOCUMENT_SOURCE_H_
6 #define CHROME_BROWSER_UI_METRO_DRIVER_PRINT_DOCUMENT_SOURCE_H_ 6 #define CHROME_BROWSER_UI_METRO_DRIVER_PRINT_DOCUMENT_SOURCE_H_
7 7
8 #include <documentsource.h> 8 #include <documentsource.h>
9 #include <printpreview.h> 9 #include <printpreview.h>
10 #include <windows.graphics.printing.h> 10 #include <windows.graphics.printing.h>
11 11
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/basictypes.h" 14 #include "base/basictypes.h"
15 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
16 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_vector.h"
17 #include "base/synchronization/condition_variable.h" 17 #include "base/synchronization/condition_variable.h"
18 #include "base/synchronization/waitable_event.h" 18 #include "base/synchronization/waitable_event.h"
19 #include "win8/metro_driver/winrt_utils.h" 19 #include "win8/metro_driver/winrt_utils.h"
20 20
21 // Hack to be removed once we don't need to build with an SDK earlier than 21 // Hack to be removed once we don't need to build with an SDK earlier than
22 // 8441 where the name of the interface has been changed. 22 // 8441 where the name of the interface has been changed.
23 // TODO(mad): remove once we don't run mixed SDK/OS anymore. 23 // TODO(mad): remove once we don't run mixed SDK/OS anymore.
24 #ifndef __IPrintPreviewDxgiPackageTarget_FWD_DEFINED__ 24 #ifndef __IPrintPreviewDxgiPackageTarget_FWD_DEFINED__
25 typedef IPrintPreviewDXGIPackageTarget IPrintPreviewDxgiPackageTarget; 25 typedef IPrintPreviewDXGIPackageTarget IPrintPreviewDxgiPackageTarget;
26 #endif 26 #endif
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 DirectXContext directx_context_; 118 DirectXContext directx_context_;
119 119
120 // Once page data is available, it's added to this vector. 120 // Once page data is available, it's added to this vector.
121 std::vector<mswr::ComPtr<IStream>> pages_; 121 std::vector<mswr::ComPtr<IStream>> pages_;
122 122
123 // When page count is set, the size of this vector is set to that number. 123 // When page count is set, the size of this vector is set to that number.
124 // Then, every time page data is added to pages_, the associated condition 124 // Then, every time page data is added to pages_, the associated condition
125 // variable in this vector is signaled. This is only filled when we receive 125 // variable in this vector is signaled. This is only filled when we receive
126 // the page count, so we must wait on page_count_ready_ before accessing 126 // the page count, so we must wait on page_count_ready_ before accessing
127 // the content of this vector. 127 // the content of this vector.
128 std::vector<scoped_ptr<base::ConditionVariable> > pages_ready_state_; 128 ScopedVector<base::ConditionVariable> pages_ready_state_;
129 129
130 // This event is signaled when we receive a page count from Chrome. We should 130 // This event is signaled when we receive a page count from Chrome. We should
131 // not receive any page data before the count, so we can check this event 131 // not receive any page data before the count, so we can check this event
132 // while waiting for pages too, in case we ask for page data before we got 132 // while waiting for pages too, in case we ask for page data before we got
133 // the count, so before we properly initialized pages_ready_state_. 133 // the count, so before we properly initialized pages_ready_state_.
134 base::WaitableEvent page_count_ready_; 134 base::WaitableEvent page_count_ready_;
135 135
136 // The preview target interface set from within GetPreviewPageCollection 136 // The preview target interface set from within GetPreviewPageCollection
137 // but used from within MakePage. 137 // but used from within MakePage.
138 mswr::ComPtr<IPrintPreviewDxgiPackageTarget> dxgi_preview_target_; 138 mswr::ComPtr<IPrintPreviewDxgiPackageTarget> dxgi_preview_target_;
(...skipping 16 matching lines...) Expand all
155 // asynchronous callbacks. 155 // asynchronous callbacks.
156 bool aborted_; 156 bool aborted_;
157 157
158 // TODO(mad): remove once we don't run mixed SDK/OS anymore. 158 // TODO(mad): remove once we don't run mixed SDK/OS anymore.
159 bool using_old_preview_interface_; 159 bool using_old_preview_interface_;
160 }; 160 };
161 161
162 } // namespace metro_driver 162 } // namespace metro_driver
163 163
164 #endif // CHROME_BROWSER_UI_METRO_DRIVER_PRINT_DOCUMENT_SOURCE_H_ 164 #endif // CHROME_BROWSER_UI_METRO_DRIVER_PRINT_DOCUMENT_SOURCE_H_
OLDNEW
« no previous file with comments | « media/midi/midi_manager_win.cc ('k') | win8/metro_driver/print_document_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698