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

Unified Diff: chrome/browser/extensions/webstore_standalone_installer.h

Issue 389613006: Prevent duplicate concurrent installs of the same extension (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed update of webstore_result 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
Index: chrome/browser/extensions/webstore_standalone_installer.h
diff --git a/chrome/browser/extensions/webstore_standalone_installer.h b/chrome/browser/extensions/webstore_standalone_installer.h
index 7df7bff9f6322f76e83ccbd435849dc9c669a523..36ddf0807f6b89247ee5741856127cd2ed83c08a 100644
--- a/chrome/browser/extensions/webstore_standalone_installer.h
+++ b/chrome/browser/extensions/webstore_standalone_installer.h
@@ -10,6 +10,7 @@
#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/extensions/active_install_data.h"
#include "chrome/browser/extensions/extension_install_prompt.h"
#include "chrome/browser/extensions/webstore_data_fetcher_delegate.h"
#include "chrome/browser/extensions/webstore_install_helper.h"
@@ -64,6 +65,11 @@ class WebstoreStandaloneInstaller
// Called when the install should be aborted. The callback is cleared.
void AbortInstall();
+ // Checks InstallTracker and returns true if the same extension is not
+ // currently being installed. Registers this install with the InstallTracker.
+ bool EnsureUniqueInstall(webstore_install::Result* reason,
+ std::string* error);
+
// Called when the install is complete.
virtual void CompleteInstall(webstore_install::Result result,
const std::string& error);
@@ -78,6 +84,10 @@ class WebstoreStandaloneInstaller
// Template Method's hooks to be implemented by subclasses.
+ // Called when this install is about to be registered with the InstallTracker.
+ // Allows subclasses to set properties of the install data.
+ virtual void InitInstallData(ActiveInstallData* install_data) const;
+
// Called at certain check points of the workflow to decide whether it makes
// sense to proceed with installation. A requestor can be a website that
// initiated an inline installation, or a command line option.
@@ -228,6 +238,9 @@ class WebstoreStandaloneInstaller
scoped_ptr<base::DictionaryValue> manifest_;
SkBitmap icon_;
+ // Active install registered with the InstallTracker.
+ scoped_ptr<ScopedActiveInstall> scoped_active_install_;
+
// Created by ShowInstallUI() when a prompt is shown (if
// the implementor returns a non-NULL in CreateInstallPrompt()).
scoped_refptr<Extension> localized_extension_for_display_;
« no previous file with comments | « chrome/browser/extensions/webstore_install_result.h ('k') | chrome/browser/extensions/webstore_standalone_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698