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

Unified Diff: ios/web/web_state/web_state_impl.h

Issue 1360993002: Moved NavigationManagerImpl serialization out of CRWSessionController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fix Created 3 years, 11 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: ios/web/web_state/web_state_impl.h
diff --git a/ios/web/web_state/web_state_impl.h b/ios/web/web_state/web_state_impl.h
index 7abae97806b59ffe00b90912400f650713bfe022..94ac0165d3bc98da74585990d694094f68b6f6c0 100644
--- a/ios/web/web_state/web_state_impl.h
+++ b/ios/web/web_state/web_state_impl.h
@@ -19,12 +19,14 @@
#include "base/values.h"
#import "ios/web/navigation/navigation_manager_delegate.h"
#import "ios/web/navigation/navigation_manager_impl.h"
+#import "ios/web/navigation/navigation_manager_serialization_builder.h"
#import "ios/web/public/java_script_dialog_callback.h"
#include "ios/web/public/java_script_dialog_type.h"
#import "ios/web/public/web_state/web_state.h"
#import "ios/web/public/web_state/web_state_delegate.h"
#include "url/gurl.h"
+@class CRWNavigationManagerSerialization;
@class CRWWebController;
@protocol CRWWebViewProxy;
@class NSURLRequest;
@@ -62,7 +64,11 @@ class WebUIIOS;
// writing them out for session saves.
class WebStateImpl : public WebState, public NavigationManagerDelegate {
public:
+ // Constructor for WebStateImpls created for new sessions.
WebStateImpl(BrowserState* browser_state);
+ // Constructor for WebStatesImpls created for deserialized sessions
+ WebStateImpl(BrowserState* browser_state,
+ CRWNavigationManagerSerialization* serialized_session);
~WebStateImpl() override;
// Gets/Sets the CRWWebController that backs this object.
@@ -73,13 +79,6 @@ class WebStateImpl : public WebState, public NavigationManagerDelegate {
WebStateFacadeDelegate* GetFacadeDelegate() const;
void SetFacadeDelegate(WebStateFacadeDelegate* facade_delegate);
- // Returns a WebStateImpl that doesn't have a browser context, web
- // controller, or facade set, but which otherwise has the same state variables
- // as the calling object (including copies of the NavigationManager and its
- // attendant CRWSessionController).
- // TODO(crbug.com/546377): Clean up this method.
- WebStateImpl* CopyForSessionWindow();
-
// Notifies the observers that a provisional navigation has started.
void OnProvisionalNavigationStarted(const GURL& url);
@@ -206,6 +205,8 @@ class WebStateImpl : public WebState, public NavigationManagerDelegate {
void Stop() override;
const NavigationManager* GetNavigationManager() const override;
NavigationManager* GetNavigationManager() override;
+ CRWNavigationManagerSerialization* BuildSerializedNavigationManager()
Eugene But (OOO till 7-30) 2017/01/25 19:24:30 Is this analogue of WebContentsImpl::GetSessionSto
kkhorimoto 2017/01/26 07:19:10 Yes
+ override;
CRWJSInjectionReceiver* GetJSInjectionReceiver() const override;
void ExecuteJavaScript(const base::string16& javascript) override;
void ExecuteJavaScript(const base::string16& javascript,
@@ -306,7 +307,8 @@ class WebStateImpl : public WebState, public NavigationManagerDelegate {
// The CRWWebController that backs this object.
base::scoped_nsobject<CRWWebController> web_controller_;
- NavigationManagerImpl navigation_manager_;
+ // The NavigationManagerImpl that stores session info for this WebStateImpl.
+ std::unique_ptr<NavigationManagerImpl> navigation_manager_;
// |web::WebUIIOS| object for the current page if it is a WebUI page that
// uses the web-based WebUI framework, or nullptr otherwise.
@@ -351,6 +353,9 @@ class WebStateImpl : public WebState, public NavigationManagerDelegate {
// Image Fetcher used to images.
std::unique_ptr<ImageDataFetcher> image_fetcher_;
+ // The serialization builder.
+ NavigationManagerSerializationBuilder serialization_builder_;
Eugene But (OOO till 7-30) 2017/01/25 19:24:30 Do we need this to be a member? Should this be a l
kkhorimoto 2017/01/26 07:19:10 Done.
+
DISALLOW_COPY_AND_ASSIGN(WebStateImpl);
};

Powered by Google App Engine
This is Rietveld 408576698