commit | 845bbf83b4944d8a2a202252cf12a321a0671ebe | [log] [tgz] |
---|---|---|
author | Matt Jones <[email protected]> | Wed Jun 26 16:30:15 2024 |
committer | Chromium LUCI CQ <[email protected]> | Wed Jun 26 16:30:15 2024 |
tree | c1da69bbf56c438eaa7ddd4dbb5f93f71ac37080 | |
parent | 2b8e382170868ecfcd6566bf2ee49422a7236a63 [diff] [blame] |
Fix incorrect mojo setup for commerce internals on iOS Rather than passing an unretained pointer, this patch updates the iOS setup to use a weak pointer. This should prevent crashing when the system goes to close or rebind the interface. Bug: 348771366 Change-Id: I7ab6483e9de119076cfa8e81a5ff834f820e7b45 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5660276 Commit-Queue: Matthew Jones <[email protected]> Reviewed-by: David Maunder <[email protected]> Cr-Commit-Position: refs/heads/main@{#1319822}
diff --git a/components/commerce/ios/browser/commerce_internals_ui.mm b/components/commerce/ios/browser/commerce_internals_ui.mm index b97a5f5..63ab83d 100644 --- a/components/commerce/ios/browser/commerce_internals_ui.mm +++ b/components/commerce/ios/browser/commerce_internals_ui.mm
@@ -37,7 +37,7 @@ web::WebUIIOSDataSource::Add(browser_state, source); web_ui->GetWebState()->GetInterfaceBinderForMainFrame()->AddInterface( base::BindRepeating(&CommerceInternalsUI::BindInterface, - base::Unretained(this))); + weak_factory_.GetWeakPtr())); } CommerceInternalsUI::~CommerceInternalsUI() {