mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
refactor: WebContents::From returns pointer (#24605)
This commit is contained in:
@@ -143,10 +143,9 @@ void ToDictionary(gin::Dictionary* details, extensions::WebRequestInfo* info) {
|
||||
auto* web_contents = content::WebContents::FromRenderFrameHost(
|
||||
content::RenderFrameHost::FromID(info->render_process_id,
|
||||
info->frame_id));
|
||||
int32_t id = api::WebContents::GetIDFromWrappedClass(web_contents);
|
||||
// id must be greater than zero.
|
||||
if (id > 0)
|
||||
details->Set("webContentsId", id);
|
||||
auto* api_web_contents = WebContents::From(web_contents);
|
||||
if (api_web_contents)
|
||||
details->Set("webContentsId", api_web_contents->ID());
|
||||
}
|
||||
|
||||
void ToDictionary(gin::Dictionary* details,
|
||||
|
||||
Reference in New Issue
Block a user