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

Side by Side Diff: chrome/common/extensions/extension_file_util.cc

Issue 8468018: chrome: Remove 10 exit time destructors and 2 static initializers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: duh Created 9 years, 1 month 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 | « chrome/browser/metrics/metrics_log.cc ('k') | chrome/common/extensions/extension_l10n_util.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/common/extensions/extension_file_util.h" 5 #include "chrome/common/extensions/extension_file_util.h"
6 6
7 #include <map> 7 #include <map>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 return true; 507 return true;
508 } 508 }
509 509
510 bool CheckForIllegalFilenames(const FilePath& extension_path, 510 bool CheckForIllegalFilenames(const FilePath& extension_path,
511 std::string* error) { 511 std::string* error) {
512 // Reserved underscore names. 512 // Reserved underscore names.
513 static const FilePath::CharType* reserved_names[] = { 513 static const FilePath::CharType* reserved_names[] = {
514 Extension::kLocaleFolder, 514 Extension::kLocaleFolder,
515 FILE_PATH_LITERAL("__MACOSX"), 515 FILE_PATH_LITERAL("__MACOSX"),
516 }; 516 };
517 static std::set<FilePath::StringType> reserved_underscore_names( 517 CR_DEFINE_STATIC_LOCAL(
518 reserved_names, reserved_names + arraysize(reserved_names)); 518 std::set<FilePath::StringType>, reserved_underscore_names,
519 (reserved_names, reserved_names + arraysize(reserved_names)));
519 520
520 // Enumerate all files and directories in the extension root. 521 // Enumerate all files and directories in the extension root.
521 // There is a problem when using pattern "_*" with FileEnumerator, so we have 522 // There is a problem when using pattern "_*" with FileEnumerator, so we have
522 // to cheat with find_first_of and match all. 523 // to cheat with find_first_of and match all.
523 file_util::FileEnumerator all_files( 524 file_util::FileEnumerator all_files(
524 extension_path, 525 extension_path,
525 false, 526 false,
526 static_cast<file_util::FileEnumerator::FileType>( 527 static_cast<file_util::FileEnumerator::FileType>(
527 file_util::FileEnumerator::DIRECTORIES | 528 file_util::FileEnumerator::DIRECTORIES |
528 file_util::FileEnumerator::FILES)); 529 file_util::FileEnumerator::FILES));
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 return temp_path; 641 return temp_path;
641 642
642 return FilePath(); 643 return FilePath();
643 } 644 }
644 645
645 void DeleteFile(const FilePath& path, bool recursive) { 646 void DeleteFile(const FilePath& path, bool recursive) {
646 file_util::Delete(path, recursive); 647 file_util::Delete(path, recursive);
647 } 648 }
648 649
649 } // namespace extension_file_util 650 } // namespace extension_file_util
OLDNEW
« no previous file with comments | « chrome/browser/metrics/metrics_log.cc ('k') | chrome/common/extensions/extension_l10n_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698