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

Side by Side Diff: chrome/browser/extensions/extension_creator.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/browser/extensions/extension_creator.h" 5 #include "chrome/browser/extensions/extension_creator.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 173 }
174 std::string pem_output; 174 std::string pem_output;
175 if (!Extension::FormatPEMForFileOutput(private_key, &pem_output, 175 if (!Extension::FormatPEMForFileOutput(private_key, &pem_output,
176 false)) { 176 false)) {
177 error_message_ = 177 error_message_ =
178 l10n_util::GetStringUTF8(IDS_EXTENSION_PRIVATE_KEY_FAILED_TO_OUTPUT); 178 l10n_util::GetStringUTF8(IDS_EXTENSION_PRIVATE_KEY_FAILED_TO_OUTPUT);
179 return NULL; 179 return NULL;
180 } 180 }
181 181
182 if (!output_private_key_path.empty()) { 182 if (!output_private_key_path.empty()) {
183 if (-1 == file_util::WriteFile(output_private_key_path, 183 if (-1 == base::WriteFile(output_private_key_path,
184 pem_output.c_str(), pem_output.size())) { 184 pem_output.c_str(), pem_output.size())) {
185 error_message_ = 185 error_message_ =
186 l10n_util::GetStringUTF8(IDS_EXTENSION_PRIVATE_KEY_FAILED_TO_OUTPUT); 186 l10n_util::GetStringUTF8(IDS_EXTENSION_PRIVATE_KEY_FAILED_TO_OUTPUT);
187 return NULL; 187 return NULL;
188 } 188 }
189 } 189 }
190 190
191 return key_pair.release(); 191 return key_pair.release();
192 } 192 }
193 193
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 SignZip(zip_path, key_pair.get(), &signature) && 323 SignZip(zip_path, key_pair.get(), &signature) &&
324 WriteCRX(zip_path, key_pair.get(), signature, crx_path)) { 324 WriteCRX(zip_path, key_pair.get(), signature, crx_path)) {
325 result = true; 325 result = true;
326 } 326 }
327 327
328 base::DeleteFile(zip_path, false); 328 base::DeleteFile(zip_path, false);
329 return result; 329 return result;
330 } 330 }
331 331
332 } // namespace extensions 332 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/convert_web_app.cc ('k') | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698