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

Side by Side Diff: chrome/utility/image_writer/image_writer_win.cc

Issue 1899083002: Convert //chrome from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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 #include <windows.h> 5 #include <windows.h>
6 #include <setupapi.h> 6 #include <setupapi.h>
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <winioctl.h> 8 #include <winioctl.h>
9 9
10 #include "chrome/utility/image_writer/error_messages.h" 10 #include "chrome/utility/image_writer/error_messages.h"
(...skipping 15 matching lines...) Expand all
26 if (!device_handle.IsValid()) { 26 if (!device_handle.IsValid()) {
27 Error(error::kOpenDevice); 27 Error(error::kOpenDevice);
28 return false; 28 return false;
29 } 29 }
30 30
31 STORAGE_PROPERTY_QUERY query = STORAGE_PROPERTY_QUERY(); 31 STORAGE_PROPERTY_QUERY query = STORAGE_PROPERTY_QUERY();
32 query.PropertyId = StorageDeviceProperty; 32 query.PropertyId = StorageDeviceProperty;
33 query.QueryType = PropertyStandardQuery; 33 query.QueryType = PropertyStandardQuery;
34 DWORD bytes_returned; 34 DWORD bytes_returned;
35 35
36 scoped_ptr<char[]> output_buf(new char[kStorageQueryBufferSize]); 36 std::unique_ptr<char[]> output_buf(new char[kStorageQueryBufferSize]);
37 BOOL status = DeviceIoControl( 37 BOOL status = DeviceIoControl(
38 device_handle.Get(), // Device handle. 38 device_handle.Get(), // Device handle.
39 IOCTL_STORAGE_QUERY_PROPERTY, // Flag to request device properties. 39 IOCTL_STORAGE_QUERY_PROPERTY, // Flag to request device properties.
40 &query, // Query parameters. 40 &query, // Query parameters.
41 sizeof(STORAGE_PROPERTY_QUERY), // query parameters size. 41 sizeof(STORAGE_PROPERTY_QUERY), // query parameters size.
42 output_buf.get(), // output buffer. 42 output_buf.get(), // output buffer.
43 kStorageQueryBufferSize, // Size of buffer. 43 kStorageQueryBufferSize, // Size of buffer.
44 &bytes_returned, // Number of bytes returned. 44 &bytes_returned, // Number of bytes returned.
45 // Must not be null. 45 // Must not be null.
46 NULL); // Optional unused overlapped perameter. 46 NULL); // Optional unused overlapped perameter.
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 191
192 if (volume_finder != INVALID_HANDLE_VALUE) { 192 if (volume_finder != INVALID_HANDLE_VALUE) {
193 FindVolumeClose(volume_finder); 193 FindVolumeClose(volume_finder);
194 } 194 }
195 195
196 if (success) 196 if (success)
197 continuation.Run(); 197 continuation.Run();
198 } 198 }
199 199
200 } // namespace image_writer 200 } // namespace image_writer
OLDNEW
« no previous file with comments | « chrome/utility/image_writer/image_writer_unittest.cc ('k') | chrome/utility/importer/edge_database_reader_unittest_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698