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

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

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
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" 8 #include "content/public/browser/browser_thread.h"
9 9
10 namespace extensions { 10 namespace extensions {
(...skipping 14 matching lines...) Expand all
25 25
26 void DestroyPartitionsOperation::StartImpl() { 26 void DestroyPartitionsOperation::StartImpl() {
27 if (!base::CreateTemporaryFileInDir(temp_dir_.path(), &image_path_)) { 27 if (!base::CreateTemporaryFileInDir(temp_dir_.path(), &image_path_)) {
28 Error(error::kTempFileError); 28 Error(error::kTempFileError);
29 return; 29 return;
30 } 30 }
31 31
32 scoped_ptr<char[]> buffer(new char[kPartitionTableSize]); 32 scoped_ptr<char[]> buffer(new char[kPartitionTableSize]);
33 memset(buffer.get(), 0, kPartitionTableSize); 33 memset(buffer.get(), 0, kPartitionTableSize);
34 34
35 if (file_util::WriteFile(image_path_, buffer.get(), kPartitionTableSize) != 35 if (base::WriteFile(image_path_, buffer.get(), kPartitionTableSize) !=
36 kPartitionTableSize) { 36 kPartitionTableSize) {
37 Error(error::kTempFileError); 37 Error(error::kTempFileError);
38 return; 38 return;
39 } 39 }
40 40
41 content::BrowserThread::PostTask( 41 content::BrowserThread::PostTask(
42 content::BrowserThread::FILE, 42 content::BrowserThread::FILE,
43 FROM_HERE, 43 FROM_HERE,
44 base::Bind(&DestroyPartitionsOperation::Write, 44 base::Bind(&DestroyPartitionsOperation::Write,
45 this, 45 this,
46 base::Bind(&DestroyPartitionsOperation::Finish, this))); 46 base::Bind(&DestroyPartitionsOperation::Finish, this)));
47 } 47 }
48 48
49 } // namespace image_writer 49 } // namespace image_writer
50 } // namespace extensions 50 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698