diff options
author | jiayl@chromium.org <jiayl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-15 18:06:19 +0000 |
---|---|---|
committer | jiayl@chromium.org <jiayl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-15 18:06:19 +0000 |
commit | 0e17ccd993fb8d58f2186f94b8ca1f3ddb0fb178 (patch) | |
tree | a82c448bc7d27558845fdb38c4c267a3b49d8465 /extensions/browser/computed_hashes.h | |
parent | 4cce3fc9ba56aeb9f292628d59f5043da395e3f8 (diff) | |
download | chromium_src-0e17ccd993fb8d58f2186f94b8ca1f3ddb0fb178.zip chromium_src-0e17ccd993fb8d58f2186f94b8ca1f3ddb0fb178.tar.gz chromium_src-0e17ccd993fb8d58f2186f94b8ca1f3ddb0fb178.tar.bz2 |
Revert 270694 "A bunch of remaining parts of extension content v..."
> A bunch of remaining parts of extension content verification
>
> -The real guts of content_hash_fetcher.cc, which fetches the
> verified_contents.json file from the webstore if needed and also runs
> tasks to compute and cache the block-level hashes of all files in an
> extension.
>
> -The real guts of content_hash_reader.cc, which uses the work done by
> the content_hash_fetcher during validation of extension file content as
> it's read off of disk at time of use.
>
> -Code to avoid verifying transcoded files (images used in browser
> process, and message catalogs).
>
> -Don't allow downgrade of mode via kForceFieldTrials command line switch
>
> -Various bits of plumbing to support all of the above
>
> BUG=369895
> R=rockot@chromium.org
>
> Review URL: https://codereview.chromium.org/289533003
TBR=asargent@chromium.org
Review URL: https://codereview.chromium.org/284223002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270734 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/browser/computed_hashes.h')
-rw-r--r-- | extensions/browser/computed_hashes.h | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/extensions/browser/computed_hashes.h b/extensions/browser/computed_hashes.h deleted file mode 100644 index c68175c..0000000 --- a/extensions/browser/computed_hashes.h +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2014 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_BROWSER_COMPUTED_HASHES_H_ -#define EXTENSIONS_BROWSER_COMPUTED_HASHES_H_ - -#include <map> -#include <string> -#include <vector> - -#include "base/values.h" - -namespace base { -class FilePath; -} - -namespace extensions { - -// A pair of classes for serialization of a set of SHA256 block hashes computed -// over the files inside an extension. -class ComputedHashes { - public: - class Reader { - public: - Reader(); - ~Reader(); - bool InitFromFile(const base::FilePath& path); - - // The block size and hashes for |relative_path| will be copied into the - // out parameters. - bool GetHashes(const base::FilePath& relative_path, - int* block_size, - std::vector<std::string>* hashes); - - private: - typedef std::pair<int, std::vector<std::string> > HashInfo; - - // This maps a relative path to a pair of (block size, hashes) - std::map<base::FilePath, HashInfo> data_; - }; - - class Writer { - public: - Writer(); - ~Writer(); - - // Adds hashes for |relative_path|. Should not be called more than once - // for a given |relative_path|. - void AddHashes(const base::FilePath& relative_path, - int block_size, - const std::vector<std::string>& hashes); - - bool WriteToFile(const base::FilePath& path); - - private: - // The top-level object that will be serialized as JSON. - base::ListValue file_list_; - }; -}; - -} // namespace extensions - -#endif // EXTENSIONS_BROWSER_COMPUTED_HASHES_H_ |