refactor: remove private webContents.getId() API (#13674)

This commit is contained in:
Cheng Zhao 2018-07-23 18:08:36 +09:00 committed by GitHub
parent a88cdf2d1f
commit 305e3aad40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 14 additions and 45 deletions

View file

@ -1103,17 +1103,6 @@ void WebContents::NavigationEntryCommitted(
details.is_same_document, details.did_replace_entry);
}
int64_t WebContents::GetIDForContents(content::WebContents* web_contents) {
int64_t process_id = web_contents->GetMainFrame()->GetProcess()->GetID();
int64_t routing_id = web_contents->GetMainFrame()->GetRoutingID();
int64_t rv = (process_id << 32) + routing_id;
return rv;
}
int64_t WebContents::GetID() const {
return WebContents::GetIDForContents(web_contents());
}
int WebContents::GetProcessID() const {
return web_contents()->GetMainFrame()->GetProcess()->GetID();
}
@ -1129,7 +1118,7 @@ WebContents::Type WebContents::GetType() const {
}
bool WebContents::Equal(const WebContents* web_contents) const {
return GetID() == web_contents->GetID();
return ID() == web_contents->ID();
}
void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
@ -1992,7 +1981,6 @@ void WebContents::BuildPrototype(v8::Isolate* isolate,
prototype->SetClassName(mate::StringToV8(isolate, "WebContents"));
mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.MakeDestroyable()
.SetMethod("getId", &WebContents::GetID)
.SetMethod("getProcessId", &WebContents::GetProcessID)
.SetMethod("getOSProcessId", &WebContents::GetOSProcessID)
.SetMethod("equal", &WebContents::Equal)