Remove NOTIFICATION_SESSION_RESTORE_DONE from src/extensions
src/extensions should not listen for notifications from
src/chrome.
NOTIFICATION_SESSION_RESTORE_DONE is used by state_store.cc
to load per-extension state from a database at startup.
Refactor this so Chrome explicitly requests the StateStore
to initialize. Other embedders (like app_shell) don't need
this behavior.
BUG=392660
TEST=browser_tests *Extension*
Review URL: https://codereview.chromium.org/427003006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286429 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/extensions/browser/state_store.h b/extensions/browser/state_store.h
index 5f2b0dc..034b07d 100644
--- a/extensions/browser/state_store.h
+++ b/extensions/browser/state_store.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_EXTENSIONS_STATE_STORE_H_
-#define CHROME_BROWSER_EXTENSIONS_STATE_STORE_H_
+#ifndef EXTENSIONS_BROWSER_STATE_STORE_H_
+#define EXTENSIONS_BROWSER_STATE_STORE_H_
#include <set>
#include <string>
@@ -40,6 +40,11 @@
StateStore(content::BrowserContext* context, scoped_ptr<ValueStore> store);
virtual ~StateStore();
+ // Requests that the state store to be initialized after its usual delay. Can
+ // be explicitly called by an embedder when the embedder does not trigger the
+ // usual page load notifications.
+ void RequestInitAfterDelay();
+
// Register a key for removal upon extension install/uninstall. We remove
// for install to reset state when an extension upgrades.
void RegisterKey(const std::string& key);
@@ -72,6 +77,10 @@
void Init();
+ // When StateStore is constructed with |deferred_load| its initialization is
+ // delayed to avoid slowing down startup.
+ void InitAfterDelay();
+
// Removes all keys registered for the given extension.
void RemoveKeysForExtension(const std::string& extension_id);
@@ -108,4 +117,4 @@
} // namespace extensions
-#endif // CHROME_BROWSER_EXTENSIONS_STATE_STORE_H_
+#endif // EXTENSIONS_BROWSER_STATE_STORE_H_