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

Side by Side Diff: chrome/utility/extensions/unpacker.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 (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 #include "chrome/utility/extensions/unpacker.h" 5 #include "chrome/utility/extensions/unpacker.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_enumerator.h" 10 #include "base/files/file_enumerator.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 ++i; 81 ++i;
82 } 82 }
83 } 83 }
84 84
85 return false; 85 return false;
86 } 86 }
87 87
88 bool WritePickle(const IPC::Message& pickle, const base::FilePath& dest_path) { 88 bool WritePickle(const IPC::Message& pickle, const base::FilePath& dest_path) {
89 int size = base::checked_cast<int>(pickle.size()); 89 int size = base::checked_cast<int>(pickle.size());
90 const char* data = static_cast<const char*>(pickle.data()); 90 const char* data = static_cast<const char*>(pickle.data());
91 int bytes_written = file_util::WriteFile(dest_path, data, size); 91 int bytes_written = base::WriteFile(dest_path, data, size);
92 return (bytes_written == size); 92 return (bytes_written == size);
93 } 93 }
94 94
95 } // namespace 95 } // namespace
96 96
97 struct Unpacker::InternalData { 97 struct Unpacker::InternalData {
98 DecodedImages decoded_images; 98 DecodedImages decoded_images;
99 }; 99 };
100 100
101 Unpacker::Unpacker(const base::FilePath& extension_path, 101 Unpacker::Unpacker(const base::FilePath& extension_path,
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 320
321 void Unpacker::SetError(const std::string &error) { 321 void Unpacker::SetError(const std::string &error) {
322 SetUTF16Error(base::UTF8ToUTF16(error)); 322 SetUTF16Error(base::UTF8ToUTF16(error));
323 } 323 }
324 324
325 void Unpacker::SetUTF16Error(const base::string16& error) { 325 void Unpacker::SetUTF16Error(const base::string16& error) {
326 error_message_ = error; 326 error_message_ = error;
327 } 327 }
328 328
329 } // namespace extensions 329 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/tools/safe_browsing/sb_sigutil.cc ('k') | chrome/utility/extensions/unpacker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698