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

Unified Diff: extensions/browser/content_hash_fetcher.cc

Issue 407043002: Content Verification: Don't access UI-thread objects on the IO thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added DCHECK Created 6 years, 5 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/browser/content_hash_fetcher.h ('k') | extensions/browser/content_verifier.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/content_hash_fetcher.cc
diff --git a/extensions/browser/content_hash_fetcher.cc b/extensions/browser/content_hash_fetcher.cc
index 041393ed50a31bd2af406d707b42a03996d48d4d..68b0c92f9fb556e2b827b93fbfdb5b750b21525f 100644
--- a/extensions/browser/content_hash_fetcher.cc
+++ b/extensions/browser/content_hash_fetcher.cc
@@ -23,6 +23,7 @@
#include "crypto/sha2.h"
#include "extensions/browser/computed_hashes.h"
#include "extensions/browser/content_hash_tree.h"
+#include "extensions/browser/content_verifier_delegate.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/verified_contents.h"
#include "extensions/common/constants.h"
@@ -51,7 +52,7 @@ class ContentHashFetcherJob
public:
typedef base::Callback<void(ContentHashFetcherJob*)> CompletionCallback;
ContentHashFetcherJob(net::URLRequestContextGetter* request_context,
- ContentVerifierKey key,
+ const ContentVerifierKey& key,
const std::string& extension_id,
const base::FilePath& extension_path,
const GURL& fetch_url,
@@ -156,7 +157,7 @@ class ContentHashFetcherJob
ContentHashFetcherJob::ContentHashFetcherJob(
net::URLRequestContextGetter* request_context,
- ContentVerifierKey key,
+ const ContentVerifierKey& key,
const std::string& extension_id,
const base::FilePath& extension_path,
const GURL& fetch_url,
@@ -419,7 +420,6 @@ ContentHashFetcher::ContentHashFetcher(content::BrowserContext* context,
: context_(context),
delegate_(delegate),
fetch_callback_(callback),
- observer_(this),
weak_ptr_factory_(this) {
}
@@ -429,11 +429,6 @@ ContentHashFetcher::~ContentHashFetcher() {
}
}
-void ContentHashFetcher::Start() {
- ExtensionRegistry* registry = ExtensionRegistry::Get(context_);
- observer_.Add(registry);
-}
-
void ContentHashFetcher::DoFetch(const Extension* extension, bool force) {
DCHECK(extension);
@@ -471,17 +466,12 @@ void ContentHashFetcher::DoFetch(const Extension* extension, bool force) {
job->Start();
}
-void ContentHashFetcher::OnExtensionLoaded(
- content::BrowserContext* browser_context,
- const Extension* extension) {
+void ContentHashFetcher::ExtensionLoaded(const Extension* extension) {
CHECK(extension);
DoFetch(extension, false);
}
-void ContentHashFetcher::OnExtensionUnloaded(
- content::BrowserContext* browser_context,
- const Extension* extension,
- UnloadedExtensionInfo::Reason reason) {
+void ContentHashFetcher::ExtensionUnloaded(const Extension* extension) {
CHECK(extension);
IdAndVersion key(extension->id(), extension->version()->GetString());
JobMap::iterator found = jobs_.find(key);
« no previous file with comments | « extensions/browser/content_hash_fetcher.h ('k') | extensions/browser/content_verifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698