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

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

Issue 9909019: Add schema chrome-extension-resource:// for extension resources (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Make some test flaky for OSX Created 8 years, 7 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
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/extension_file_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) 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 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_FILE_UTIL_H_ 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_FILE_UTIL_H_
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_FILE_UTIL_H_ 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_FILE_UTIL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <map> 10 #include <map>
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 // We need to reserve the namespace of entries that start with "_" for future 93 // We need to reserve the namespace of entries that start with "_" for future
94 // use by Chrome. 94 // use by Chrome.
95 // If any files or directories are found using "_" prefix and are not on 95 // If any files or directories are found using "_" prefix and are not on
96 // reserved list we return false, and set error message. 96 // reserved list we return false, and set error message.
97 bool CheckForIllegalFilenames(const FilePath& extension_path, 97 bool CheckForIllegalFilenames(const FilePath& extension_path,
98 std::string* error); 98 std::string* error);
99 99
100 // Get a relative file path from a chrome-extension:// URL. 100 // Get a relative file path from a chrome-extension:// URL.
101 FilePath ExtensionURLToRelativeFilePath(const GURL& url); 101 FilePath ExtensionURLToRelativeFilePath(const GURL& url);
102 102
103 // Get a full file path from a chrome-extension-resource:// URL, If the URL
104 // points a file outside of root, this function will return empty FilePath.
105 FilePath ExtensionResourceURLToFilePath(const GURL& url, const FilePath& root);
106
103 // Get a path to a temp directory for unpacking an extension. 107 // Get a path to a temp directory for unpacking an extension.
104 // This is essentially PathService::Get(chrome::DIR_USER_DATA_TEMP, ...), 108 // This is essentially PathService::Get(chrome::DIR_USER_DATA_TEMP, ...),
105 // with a histogram that allows us to understand why it is failing. 109 // with a histogram that allows us to understand why it is failing.
106 // Return an empty file path on failure. 110 // Return an empty file path on failure.
107 FilePath GetUserDataTempDir(); 111 FilePath GetUserDataTempDir();
108 112
109 // Helper function to delete files. This is used to avoid ugly casts which 113 // Helper function to delete files. This is used to avoid ugly casts which
110 // would be necessary with PostMessage since file_util::Delete is overloaded. 114 // would be necessary with PostMessage since file_util::Delete is overloaded.
111 // TODO(skerner): Make a version of Delete that is not overloaded in file_util. 115 // TODO(skerner): Make a version of Delete that is not overloaded in file_util.
112 void DeleteFile(const FilePath& path, bool recursive); 116 void DeleteFile(const FilePath& path, bool recursive);
113 117
114 } // namespace extension_file_util 118 } // namespace extension_file_util
115 119
116 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_FILE_UTIL_H_ 120 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_FILE_UTIL_H_
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/extension_file_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698