feat: add osProcessId / name properties to webFrameMain (#26093)
* feat: add osProcessId / name properties to webFrameMain * Update docs/api/web-frame-main.md Co-authored-by: Jeremy Rose <jeremya@chromium.org> Co-authored-by: Jeremy Rose <jeremya@chromium.org>
This commit is contained in:
parent
30b5e15ddc
commit
aa157c3f05
7 changed files with 32 additions and 18 deletions
|
@ -1590,18 +1590,6 @@ base::ProcessId WebContents::GetOSProcessID() const {
|
|||
return base::GetProcId(process_handle);
|
||||
}
|
||||
|
||||
base::ProcessId WebContents::GetOSProcessIdForFrame(
|
||||
const std::string& name,
|
||||
const std::string& document_url) const {
|
||||
for (auto* frame : web_contents()->GetAllFrames()) {
|
||||
if (frame->GetFrameName() == name &&
|
||||
frame->GetLastCommittedURL().spec() == document_url) {
|
||||
return base::GetProcId(frame->GetProcess()->GetProcess().Handle());
|
||||
}
|
||||
}
|
||||
return base::kNullProcessId;
|
||||
}
|
||||
|
||||
WebContents::Type WebContents::GetType() const {
|
||||
return type_;
|
||||
}
|
||||
|
@ -2941,8 +2929,6 @@ v8::Local<v8::ObjectTemplate> WebContents::FillObjectTemplate(
|
|||
&WebContents::SetBackgroundThrottling)
|
||||
.SetMethod("getProcessId", &WebContents::GetProcessID)
|
||||
.SetMethod("getOSProcessId", &WebContents::GetOSProcessID)
|
||||
.SetMethod("_getOSProcessIdForFrame",
|
||||
&WebContents::GetOSProcessIdForFrame)
|
||||
.SetMethod("equal", &WebContents::Equal)
|
||||
.SetMethod("_loadURL", &WebContents::LoadURL)
|
||||
.SetMethod("downloadURL", &WebContents::DownloadURL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue