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

Side by Side Diff: trunk/src/chrome/browser/extensions/api/image_writer_private/destroy_partitions_operation.cc

Issue 175423004: Revert 252466 "In order to support writing on windows we need to..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | trunk/src/chrome/browser/extensions/api/image_writer_private/destroy_partitions_operation_unittest.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 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 "base/file_util.h" 5 #include "base/file_util.h"
6 #include "chrome/browser/extensions/api/image_writer_private/destroy_partitions_ operation.h" 6 #include "chrome/browser/extensions/api/image_writer_private/destroy_partitions_ operation.h"
7 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h" 7 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h"
8 #include "content/public/browser/browser_thread.h"
9 8
10 namespace extensions { 9 namespace extensions {
11 namespace image_writer { 10 namespace image_writer {
12 11
13 // Number of bytes for the maximum partition table size. By wiping this many 12 // Number of bytes for the maximum partition table size. By wiping this many
14 // bytes we can essentially guarantee the header and associated information will 13 // bytes we can essentially guarantee the header and associated information will
15 // be wiped. See http://crbug.com/328246 for more information. 14 // be wiped. See http://crbug.com/328246 for more information.
16 const int kPartitionTableSize = 1 * 1024; 15 const int kPartitionTableSize = 1 * 1024;
17 16
18 DestroyPartitionsOperation::DestroyPartitionsOperation( 17 DestroyPartitionsOperation::DestroyPartitionsOperation(
(...skipping 12 matching lines...) Expand all
31 30
32 scoped_ptr<char[]> buffer(new char[kPartitionTableSize]); 31 scoped_ptr<char[]> buffer(new char[kPartitionTableSize]);
33 memset(buffer.get(), 0, kPartitionTableSize); 32 memset(buffer.get(), 0, kPartitionTableSize);
34 33
35 if (file_util::WriteFile(image_path_, buffer.get(), kPartitionTableSize) != 34 if (file_util::WriteFile(image_path_, buffer.get(), kPartitionTableSize) !=
36 kPartitionTableSize) { 35 kPartitionTableSize) {
37 Error(error::kTempFileError); 36 Error(error::kTempFileError);
38 return; 37 return;
39 } 38 }
40 39
41 content::BrowserThread::PostTask( 40 Write(base::Bind(&DestroyPartitionsOperation::Finish, this));
42 content::BrowserThread::FILE,
43 FROM_HERE,
44 base::Bind(&DestroyPartitionsOperation::Write,
45 this,
46 base::Bind(&DestroyPartitionsOperation::Finish, this)));
47 } 41 }
48 42
49 } // namespace image_writer 43 } // namespace image_writer
50 } // namespace extensions 44 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | trunk/src/chrome/browser/extensions/api/image_writer_private/destroy_partitions_operation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698