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

Unified Diff: extensions/common/id_util.h

Issue 12578008: Move CrxFile, FileReader, ExtensionResource to src/extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/common/extension_resource_unittest.cc ('k') | extensions/common/id_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/id_util.h
diff --git a/extensions/common/id_util.h b/extensions/common/id_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..74e690dbf6012133b4261771da8cd2c4d87995c5
--- /dev/null
+++ b/extensions/common/id_util.h
@@ -0,0 +1,35 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef EXTENSIONS_COMMON_ID_UTIL_H_
+#define EXTENSIONS_COMMON_ID_UTIL_H_
+
+#include <string>
+
+namespace base {
+class FilePath;
+}
+
+namespace extensions {
+namespace id_util {
+
+// The number of bytes in a legal id.
+extern const size_t kIdSize;
+
+// Generates an extension ID from arbitrary input. The same input string will
+// always generate the same output ID.
+std::string GenerateId(const std::string& input);
+
+// Generate an ID for an extension in the given path.
+// Used while developing extensions, before they have a key.
+std::string GenerateIdForPath(const base::FilePath& path);
+
+// Normalize the path for use by the extension. On Windows, this will make
+// sure the drive letter is uppercase.
+base::FilePath MaybeNormalizePath(const base::FilePath& path);
+
+} // namespace id_util
+} // namespace extensions
+
+#endif // EXTENSIONS_COMMON_ID_UTIL_H_
« no previous file with comments | « extensions/common/extension_resource_unittest.cc ('k') | extensions/common/id_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698