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

Unified Diff: ios/chrome/browser/tabs/tab.mm

Issue 2705113004: Do not use TabModel inside BlockedPopupInfo handler block. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | ios/chrome/browser/ui/browser_view_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/tabs/tab.mm
diff --git a/ios/chrome/browser/tabs/tab.mm b/ios/chrome/browser/tabs/tab.mm
index a6eda18221461e7f4268aae932b9dd11ecab1fdc..484c358e7a393ba71d59de82cd339c2edb8410fa 100644
--- a/ios/chrome/browser/tabs/tab.mm
+++ b/ios/chrome/browser/tabs/tab.mm
@@ -1494,20 +1494,16 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
base::WeakNSObject<Tab> weakSelf(self);
// TODO(crbug.com/692117): Remove |window_name| from constructor.
web::BlockedPopupInfo poupInfo(popupURL, referrer, nil /* window_name */, ^{
- base::scoped_nsobject<Tab> strongSelf([weakSelf retain]);
- if (!strongSelf) {
- return;
+ web::WebState* webState = [weakSelf webState];
+ if (webState) {
+ web::WebState::OpenURLParams params(
+ localPopupURL, referrer, WindowOpenDisposition::NEW_POPUP,
+ ui::PAGE_TRANSITION_LINK, true /* is_renderer_initiated */);
+ params.url = localPopupURL;
+ params.referrer = referrer;
+ params.transition = ui::PAGE_TRANSITION_LINK;
+ webState->OpenURL(params);
}
- [strongSelf updateSnapshotWithOverlay:YES visibleFrameOnly:YES];
- [strongSelf.get()->parentTabModel_
- insertOrUpdateTabWithURL:localPopupURL
- referrer:referrer
- transition:ui::PAGE_TRANSITION_LINK
- windowName:nil
- opener:self
- openedByDOM:YES
- atIndex:TabModelConstants::kTabPositionAutomatically
- inBackground:NO];
});
BlockedPopupTabHelper::FromWebState(self.webState)->HandlePopup(poupInfo);
}
« no previous file with comments | « no previous file | ios/chrome/browser/ui/browser_view_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698