Fix a crash issue in GetProcessOwner if no renderer view host is found.
This commit is contained in:
parent
4e3187fbbd
commit
28093a4d2d
1 changed files with 6 additions and 2 deletions
|
@ -58,11 +58,15 @@ enum ProcessOwner {
|
||||||
OWNER_GUEST_WEB_CONTENTS,
|
OWNER_GUEST_WEB_CONTENTS,
|
||||||
OWNER_NONE, // it might be devtools though.
|
OWNER_NONE, // it might be devtools though.
|
||||||
};
|
};
|
||||||
|
|
||||||
ProcessOwner GetProcessOwner(int process_id,
|
ProcessOwner GetProcessOwner(int process_id,
|
||||||
NativeWindow** window,
|
NativeWindow** window,
|
||||||
WebViewManager::WebViewInfo* info) {
|
WebViewManager::WebViewInfo* info) {
|
||||||
auto web_contents = content::WebContents::FromRenderViewHost(
|
content::RenderViewHost* rvh = content::RenderViewHost::FromID(
|
||||||
content::RenderViewHost::FromID(process_id, kDefaultRoutingID));
|
process_id, kDefaultRoutingID);
|
||||||
|
if (!rvh)
|
||||||
|
return OWNER_NONE;
|
||||||
|
auto web_contents = content::WebContents::FromRenderViewHost(rvh);
|
||||||
if (!web_contents)
|
if (!web_contents)
|
||||||
return OWNER_NONE;
|
return OWNER_NONE;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue