From fd3df77805388c12b7a20149c4fc4a8c061df26d Mon Sep 17 00:00:00 2001 From: "asargent@chromium.org" Date: Thu, 8 May 2014 23:54:27 +0000 Subject: Beginning of support for extension content verification The basic idea is that the webstore will provide signed expected hashes of file content that can be checked during runtime in the browser to detect corruption due to disk errors or malware. This CL has a lot of the high-level pieces, with several of the details left out for subsequent CLs to make this one more easily digestible. The design is that there is a ContentVerifier for each BrowserContext which can be used anywhere we read from files inside an extension. It vends out ContentVerifyJob's, which need to be informed of the bytes read from each file, and will know how to check those against a set of expected block hashes. If the job detects contents that don't match what was expected, it will notify the verifier. BUG=369895 R=rvargas@chromium.org, yoz@chromium.org Review URL: https://codereview.chromium.org/266963003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269108 0039d316-1c4b-4281-b951-d872f2087c98 --- extensions/browser/info_map.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'extensions/browser/info_map.cc') diff --git a/extensions/browser/info_map.cc b/extensions/browser/info_map.cc index 408b4f1..42b85c5 100644 --- a/extensions/browser/info_map.cc +++ b/extensions/browser/info_map.cc @@ -5,6 +5,7 @@ #include "extensions/browser/info_map.h" #include "content/public/browser/browser_thread.h" +#include "extensions/browser/content_verifier.h" #include "extensions/common/constants.h" #include "extensions/common/extension.h" #include "extensions/common/extension_set.h" @@ -207,6 +208,10 @@ bool InfoMap::AreNotificationsDisabled( return false; } +void InfoMap::SetContentVerifier(ContentVerifier* verifier) { + content_verifier_ = verifier; +} + InfoMap::~InfoMap() { if (quota_service_) { BrowserThread::DeleteSoon( -- cgit v1.1