summaryrefslogtreecommitdiffstats
path: root/extensions/browser/crx_file_info.h
diff options
context:
space:
mode:
authorginkage <ginkage@chromium.org>2015-02-04 04:39:09 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-04 12:40:13 +0000
commit553af32002b282cf9bdd823e475f5646e1ab7182 (patch)
tree562ba6ee8b81d756c9385cc866989df913f170f5 /extensions/browser/crx_file_info.h
parent6ef9302baebb894ced09f28741f86bbb626ed82a (diff)
downloadchromium_src-553af32002b282cf9bdd823e475f5646e1ab7182.zip
chromium_src-553af32002b282cf9bdd823e475f5646e1ab7182.tar.gz
chromium_src-553af32002b282cf9bdd823e475f5646e1ab7182.tar.bz2
Validate hash_sha256 checksum on .crx update.
BUG=338837 Review URL: https://codereview.chromium.org/829583002 Cr-Commit-Position: refs/heads/master@{#314547}
Diffstat (limited to 'extensions/browser/crx_file_info.h')
-rw-r--r--extensions/browser/crx_file_info.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/extensions/browser/crx_file_info.h b/extensions/browser/crx_file_info.h
new file mode 100644
index 0000000..49a5341
--- /dev/null
+++ b/extensions/browser/crx_file_info.h
@@ -0,0 +1,34 @@
+// Copyright (c) 2015 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_CRX_FILE_INFO_H_
+#define EXTENSIONS_BROWSER_CRX_FILE_INFO_H_
+
+#include <string>
+
+#include "base/files/file_path.h"
+
+namespace extensions {
+
+// CRXFileInfo holds general information about a cached CRX file
+struct CRXFileInfo {
+ CRXFileInfo();
+ CRXFileInfo(const std::string& extension_id,
+ const base::FilePath& path,
+ const std::string& hash);
+ CRXFileInfo(const std::string& extension_id, const base::FilePath& path);
+ explicit CRXFileInfo(const base::FilePath& path);
+
+ bool operator==(const CRXFileInfo& that) const;
+
+ // The only mandatory field is the file path, whereas extension_id and hash
+ // are only being checked if those are non-empty.
+ std::string extension_id;
+ base::FilePath path;
+ std::string expected_hash;
+};
+
+} // namespace extensions
+
+#endif // EXTENSIONS_BROWSER_CRX_FILE_H_