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

Unified Diff: components/sessions/core/tab_restore_service_client.h

Issue 1343833002: Abstract content::SessionStorageNamespace from core TabRestore code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@extension_tab_helper
Patch Set: Hopefully fix Windows Created 5 years, 3 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 | « components/sessions/content/content_tab_client_data.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sessions/core/tab_restore_service_client.h
diff --git a/components/sessions/core/tab_restore_service_client.h b/components/sessions/core/tab_restore_service_client.h
index 99f1089c08adb12aa109f7944f18e23b8bdd2424..121cf509c7ea90ae875c8504fd06c8ec162de53c 100644
--- a/components/sessions/core/tab_restore_service_client.h
+++ b/components/sessions/core/tab_restore_service_client.h
@@ -7,8 +7,10 @@
#include "base/callback.h"
#include "base/files/file_path.h"
+#include "base/memory/ref_counted.h"
#include "base/memory/scoped_vector.h"
#include "components/sessions/session_id.h"
+#include "components/sessions/sessions_export.h"
namespace base {
class CancelableTaskTracker;
@@ -37,9 +39,19 @@ struct SessionWindow;
typedef base::Callback<void(ScopedVector<SessionWindow>, SessionID::id_type)>
GetLastSessionCallback;
+// A class that is used to associate embedder-specific data with
+// TabRestoreService::Tab. See TabRestoreServiceClient::GetClientData().
+class SESSIONS_EXPORT TabClientData : public base::RefCounted<TabClientData> {
blundell 2015/09/15 19:38:57 Note that this class needs to be refcounted becaus
sky 2015/09/15 21:59:49 I hate to propagate that. How about a Clone() meth
blundell 2015/09/16 11:53:51 Done.
+ protected:
+ virtual ~TabClientData() {}
+
+ private:
+ friend class base::RefCounted<TabClientData>;
+};
+
// A client interface that needs to be supplied to the tab restore service by
// the embedder.
-class TabRestoreServiceClient {
+class SESSIONS_EXPORT TabRestoreServiceClient {
public:
virtual ~TabRestoreServiceClient() {}
@@ -81,6 +93,12 @@ class TabRestoreServiceClient {
virtual std::string GetExtensionAppIDForWebContents(
content::WebContents* web_contents) = 0;
+ // Returns any client data that should be associated with the
+ // TabRestoreService::Tab corresponding to |web_contents|. That tab will own
+ // this reference to the returned data.
+ virtual scoped_refptr<TabClientData> GetTabClientDataForWebContents(
+ content::WebContents* web_contents) = 0;
+
// Get the sequenced worker pool for running tasks on the backend thread as
// long as the system is not shutting down.
virtual base::SequencedWorkerPool* GetBlockingPool() = 0;
« no previous file with comments | « components/sessions/content/content_tab_client_data.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698