Chromium Code Reviews| 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; |