| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_SESSIONS_CONTENT_CONTENT_PLATFORM_SPECIFIC_TAB_DATA_H_ | 5 #ifndef COMPONENTS_SESSIONS_CONTENT_CONTENT_PLATFORM_SPECIFIC_TAB_DATA_H_ |
| 6 #define COMPONENTS_SESSIONS_CONTENT_CONTENT_PLATFORM_SPECIFIC_TAB_DATA_H_ | 6 #define COMPONENTS_SESSIONS_CONTENT_CONTENT_PLATFORM_SPECIFIC_TAB_DATA_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "components/sessions/core/live_tab.h" | 9 #include "components/sessions/core/live_tab.h" |
| 10 #include "components/sessions/core/sessions_export.h" | 10 #include "components/sessions/core/sessions_export.h" |
| 11 #include "content/public/browser/session_storage_namespace.h" | 11 #include "content/public/browser/session_storage_namespace.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 class WebContents; | 14 class WebContents; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace sessions { | 17 namespace sessions { |
| 18 | 18 |
| 19 // A //content-specific subclass of PlatformSpecificTabData that is used to | 19 // A //content-specific subclass of PlatformSpecificTabData that is used to |
| 20 // associate TabRestoreService::Tab instances with the | 20 // associate TabRestoreService::Tab instances with the |
| 21 // content::SessionStorageNamespace of the WebContents from which they were | 21 // content::SessionStorageNamespace of the WebContents from which they were |
| 22 // created. | 22 // created. |
| 23 class SESSIONS_EXPORT ContentPlatformSpecificTabData | 23 class SESSIONS_EXPORT ContentPlatformSpecificTabData |
| 24 : public PlatformSpecificTabData { | 24 : public PlatformSpecificTabData { |
| 25 scoped_refptr<content::SessionStorageNamespace> session_storage_namespace_; |
| 26 |
| 25 public: | 27 public: |
| 26 explicit ContentPlatformSpecificTabData(content::WebContents* web_contents); | 28 explicit ContentPlatformSpecificTabData(content::WebContents* web_contents); |
| 27 ContentPlatformSpecificTabData(); | 29 ContentPlatformSpecificTabData(); |
| 28 ~ContentPlatformSpecificTabData() override; | 30 ~ContentPlatformSpecificTabData() override; |
| 29 | 31 |
| 30 content::SessionStorageNamespace* session_storage_namespace() const { | 32 content::SessionStorageNamespace* session_storage_namespace() const { |
| 31 return session_storage_namespace_.get(); | 33 return session_storage_namespace_.get(); |
| 32 } | 34 } |
| 33 | |
| 34 private: | |
| 35 // PlatformSpecificTabData: | |
| 36 std::unique_ptr<PlatformSpecificTabData> Clone() override; | |
| 37 | |
| 38 scoped_refptr<content::SessionStorageNamespace> session_storage_namespace_; | |
| 39 }; | 35 }; |
| 40 | 36 |
| 41 } // namespace sessions | 37 } // namespace sessions |
| 42 | 38 |
| 43 #endif // COMPONENTS_SESSIONS_CONTENT_CONTENT_PLATFORM_SPECIFIC_TAB_DATA_H_ | 39 #endif // COMPONENTS_SESSIONS_CONTENT_CONTENT_PLATFORM_SPECIFIC_TAB_DATA_H_ |
| OLD | NEW |