OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |