feat: add contents.getBackgroundThrottling() + backgroundThrottling property (#21036)
This commit is contained in:
parent
7656480247
commit
4afc756094
7 changed files with 59 additions and 0 deletions
|
@ -1439,6 +1439,10 @@ void WebContents::NavigationEntryCommitted(
|
|||
details.is_same_document, details.did_replace_entry);
|
||||
}
|
||||
|
||||
bool WebContents::GetBackgroundThrottling() const {
|
||||
return background_throttling_;
|
||||
}
|
||||
|
||||
void WebContents::SetBackgroundThrottling(bool allowed) {
|
||||
background_throttling_ = allowed;
|
||||
|
||||
|
@ -2719,6 +2723,8 @@ void WebContents::BuildPrototype(v8::Isolate* isolate,
|
|||
prototype->SetClassName(gin::StringToV8(isolate, "WebContents"));
|
||||
gin_helper::Destroyable::MakeDestroyable(isolate, prototype);
|
||||
gin_helper::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
|
||||
.SetMethod("getBackgroundThrottling",
|
||||
&WebContents::GetBackgroundThrottling)
|
||||
.SetMethod("setBackgroundThrottling",
|
||||
&WebContents::SetBackgroundThrottling)
|
||||
.SetMethod("getProcessId", &WebContents::GetProcessID)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue