Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] - Fix #32840: Disable Chromium Session-Restore for WebState and WebViews #20047

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions ios/browser/api/web/web_state/web_state_native.mm
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,6 @@
session_id_ =
SyncedWindowDelegateBrowserAgent::FromBrowser(browser_)->GetSessionId();

// Create session storage with an empty item storage
NSMutableArray<CRWNavigationItemStorage*>* item_storages =
[[NSMutableArray alloc] init];
CRWNavigationItemStorage* item = [[CRWNavigationItemStorage alloc] init];
[item_storages addObject:item];

CRWSessionStorage* session_storage = [[CRWSessionStorage alloc] init];
session_storage.stableIdentifier = [[NSUUID UUID] UUIDString];
session_storage.uniqueIdentifier = SessionID::NewUnique();
session_storage.itemStorages = [item_storages copy];
session_storage.userAgentType = web::UserAgentType::MOBILE;

// Create BrowserState
ChromeBrowserState* browser_state = browser->GetBrowserState();
if (off_the_record) {
Expand All @@ -60,8 +48,7 @@
// Create WebState with parameters
web::WebState::CreateParams create_params(browser_state);
create_params.last_active_time = base::Time::Now();
auto web_state =
web::WebState::CreateWithStorageSession(create_params, session_storage);
auto web_state = web::WebState::Create(create_params);
web_state->ForceRealized();

// Setup Observers of the WebState
Expand Down