| Index: extensions/browser/verified_contents.h
|
| diff --git a/extensions/browser/verified_contents.h b/extensions/browser/verified_contents.h
|
| index 1cf0bdb16f867554a24d163fe9e5868fd409f74c..7e7b7f95bca4e311d0be5b5d5a56cde29dfac218 100644
|
| --- a/extensions/browser/verified_contents.h
|
| +++ b/extensions/browser/verified_contents.h
|
| @@ -46,9 +46,10 @@ class VerifiedContents {
|
| const std::string& extension_id() const { return extension_id_; }
|
| const base::Version& version() const { return version_; }
|
|
|
| - // This returns a pointer to the binary form of an expected sha256 root hash
|
| - // for |relative_path| computing using a tree hash algorithm.
|
| - const std::string* GetTreeHashRoot(const base::FilePath& relative_path);
|
| + bool HasTreeHashRoot(const base::FilePath& relative_path) const;
|
| +
|
| + bool TreeHashRootEquals(const base::FilePath& relative_path,
|
| + const std::string& expected) const;
|
|
|
| // If InitFrom has not been called yet, or was used in "ignore invalid
|
| // signature" mode, this can return false.
|
| @@ -83,8 +84,17 @@ class VerifiedContents {
|
| std::string extension_id_;
|
| base::Version version_;
|
|
|
| - // The expected treehash root hashes for each file.
|
| - std::map<base::FilePath, std::string> root_hashes_;
|
| + // The expected treehash root hashes for each file, lower cased so we can do
|
| + // case-insensitive lookups.
|
| + //
|
| + // We use a multi-map here so that we can do fast lookups of paths from
|
| + // requests on case-insensitive systems (windows, mac) where the request path
|
| + // might not have the exact right capitalization, but not break
|
| + // case-sensitive systems (linux, chromeos). TODO(asargent) - we should give
|
| + // developers client-side warnings in each of those cases, and have the
|
| + // webstore reject the cases they can statically detect. See crbug.com/29941
|
| + typedef std::multimap<base::FilePath::StringType, std::string> RootHashes;
|
| + RootHashes root_hashes_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(VerifiedContents);
|
| };
|
|
|