feat: add contents.getBackgroundThrottling() + backgroundThrottling property (#21036)

This commit is contained in:
Milan Burda 2020-05-14 15:11:45 +02:00 committed by GitHub
parent 7656480247
commit 4afc756094
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 59 additions and 0 deletions

View file

@ -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)