Commit 4e9b403f authored by edchin's avatar edchin Committed by Commit Bot

[ios] Fix snapshotCache in tab grid mediator

crrev.com/c/2001849 broke snapshotCache in the tab grid mediator.
The snapshotCache needs the browserState to be set before
it is initialized.

This CL fixes the order of setting the browserState then initializing
the snapshotCache.

Fixed: 1046349
Change-Id: Ie257b18c862e071a90dc67b12e4d39ebc429e28b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2076446Reviewed-by: default avataredchin <edchin@chromium.org>
Reviewed-by: default avatarChris Lu <thegreenfrog@chromium.org>
Commit-Queue: edchin <edchin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#744925}
parent e525a289
......@@ -166,9 +166,9 @@ web::WebState* GetWebStateWithId(WebStateList* web_state_list,
_scopedWebStateListObserver->RemoveAll();
_scopedWebStateObserver->RemoveAll();
_browser = browser;
[self.snapshotCache addObserver:self];
_webStateList = browser ? browser->GetWebStateList() : nullptr;
_browserState = browser ? browser->GetBrowserState() : nullptr;
[self.snapshotCache addObserver:self];
if (_webStateList) {
_scopedWebStateListObserver->Add(_webStateList);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment