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

Unified Diff: chrome/browser/background/background_contents_service.h

Issue 23427003: Reload force-installed extensions on crash/force-close (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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/background/background_contents_service.h
diff --git a/chrome/browser/background/background_contents_service.h b/chrome/browser/background/background_contents_service.h
index 0d99a92bfa02024994266a5295ff8b83db5c6abe..e5ff29455f1f413cca5232fa83e4dd40129847e8 100644
--- a/chrome/browser/background/background_contents_service.h
+++ b/chrome/browser/background/background_contents_service.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_BACKGROUND_BACKGROUND_CONTENTS_SERVICE_H_
#include <map>
+#include <queue>
#include <string>
#include <vector>
@@ -52,6 +53,9 @@ class BackgroundContentsService : private content::NotificationObserver,
BackgroundContentsService(Profile* profile, const CommandLine* command_line);
virtual ~BackgroundContentsService();
+ static void SetCrashDelaysForTesting(const base::TimeDelta& restart_delay,
bartfab (slow) 2013/08/26 13:26:53 Nit 1: Add comment that explain what this does. N
anitawoodruff 2013/08/26 21:45:23 Done.
+ const base::TimeDelta& crash_window);
+
// Returns the BackgroundContents associated with the passed application id,
// or NULL if none.
BackgroundContents* GetAppBackgroundContents(const string16& appid);
@@ -170,6 +174,9 @@ class BackgroundContentsService : private content::NotificationObserver,
// set of background apps as new background contents are opened/closed).
void SendChangeNotification(Profile* profile);
+ static base::TimeDelta restart_delay_;
bartfab (slow) 2013/08/26 13:26:53 Static initializers are not allowed in Chrome. You
anitawoodruff 2013/08/26 21:45:23 Done. Made them ints, and only convert to TimeDelt
bartfab (slow) 2013/08/27 09:21:29 For PODs, passing by reference is not necessary.
+ static base::TimeDelta crash_window_;
+
// PrefService used to store list of background pages (or NULL if this is
// running under an incognito profile).
PrefService* prefs_;
@@ -190,6 +197,15 @@ class BackgroundContentsService : private content::NotificationObserver,
typedef std::map<string16, BackgroundContentsInfo> BackgroundContentsMap;
BackgroundContentsMap contents_map_;
+ // Map associating extension IDs with their most recent crash timestamps.
bartfab (slow) 2013/08/26 13:26:53 Nit: Add a note that this is used for force-instal
anitawoodruff 2013/08/26 21:45:23 Done.
+ // Key: extension id.
+ // Value: queue containing up to 5 most recent crash timestamps.
+ std::map<std::string, std::queue<base::TimeTicks> > extension_crashlog_map_;
bartfab (slow) 2013/08/26 13:26:53 Nit 1: #include <queue> Nit 2: #include "base/time
anitawoodruff 2013/08/26 21:45:23 Done Nit 2. <queue> I'd already included on line 9
+
+ // Map containing ids of extensions for which we have already sent
+ // 'Extension is misbehaving' notifications.
bartfab (slow) 2013/08/26 13:26:53 Nit 1: Instead of "sent notifications," better say
anitawoodruff 2013/08/26 21:45:23 Done. I've changed the wording of comments to say
bartfab (slow) 2013/08/27 09:21:29 The variable naming is OK. Comments are for verbos
+ std::set<std::string> misbehaving_extensions_;
bartfab (slow) 2013/08/26 13:26:53 Nit: #include <set>
anitawoodruff 2013/08/26 21:45:23 Done.
+
DISALLOW_COPY_AND_ASSIGN(BackgroundContentsService);
};

Powered by Google App Engine
This is Rietveld 408576698