diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 8b26b724fa0..3db913382b7 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -453,6 +453,14 @@ bool WebContents::IsAlive() const { return web_contents() != NULL; } +int WebContents::GetID() const { + return web_contents()->GetRenderProcessHost()->GetID(); +} + +bool WebContents::Equal(const WebContents* web_contents) const { + return GetID() == web_contents->GetID(); +} + void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) { content::NavigationController::LoadURLParams params(url); @@ -506,14 +514,6 @@ void WebContents::GoToOffset(int offset) { web_contents()->GetController().GoToOffset(offset); } -int WebContents::GetRoutingID() const { - return web_contents()->GetRoutingID(); -} - -int WebContents::GetProcessID() const { - return web_contents()->GetRenderProcessHost()->GetID(); -} - bool WebContents::IsCrashed() const { return web_contents()->IsCrashed(); } @@ -770,6 +770,8 @@ mate::ObjectTemplateBuilder WebContents::GetObjectTemplateBuilder( template_.Reset(isolate, mate::ObjectTemplateBuilder(isolate) .SetMethod("destroy", &WebContents::Destroy) .SetMethod("isAlive", &WebContents::IsAlive) + .SetMethod("getId", &WebContents::GetID) + .SetMethod("equal", &WebContents::Equal) .SetMethod("_loadUrl", &WebContents::LoadURL) .SetMethod("getTitle", &WebContents::GetTitle) .SetMethod("isLoading", &WebContents::IsLoading) @@ -779,8 +781,6 @@ mate::ObjectTemplateBuilder WebContents::GetObjectTemplateBuilder( .SetMethod("_goBack", &WebContents::GoBack) .SetMethod("_goForward", &WebContents::GoForward) .SetMethod("_goToOffset", &WebContents::GoToOffset) - .SetMethod("getRoutingId", &WebContents::GetRoutingID) - .SetMethod("getProcessId", &WebContents::GetProcessID) .SetMethod("isCrashed", &WebContents::IsCrashed) .SetMethod("setUserAgent", &WebContents::SetUserAgent) .SetMethod("insertCSS", &WebContents::InsertCSS) diff --git a/atom/browser/api/atom_api_web_contents.h b/atom/browser/api/atom_api_web_contents.h index 31f54134afa..a2bfda874cb 100644 --- a/atom/browser/api/atom_api_web_contents.h +++ b/atom/browser/api/atom_api_web_contents.h @@ -68,6 +68,8 @@ class WebContents : public mate::EventEmitter, void Destroy(); bool IsAlive() const; + int GetID() const; + bool Equal(const WebContents* web_contents) const; void LoadURL(const GURL& url, const mate::Dictionary& options); base::string16 GetTitle() const; bool IsLoading() const; @@ -77,8 +79,6 @@ class WebContents : public mate::EventEmitter, void GoBack(); void GoForward(); void GoToOffset(int offset); - int GetRoutingID() const; - int GetProcessID() const; bool IsCrashed() const; void SetUserAgent(const std::string& user_agent); void InsertCSS(const std::string& css); diff --git a/atom/browser/api/lib/web-contents.coffee b/atom/browser/api/lib/web-contents.coffee index 67f106f6bb8..38e6caaaa6e 100644 --- a/atom/browser/api/lib/web-contents.coffee +++ b/atom/browser/api/lib/web-contents.coffee @@ -24,10 +24,6 @@ wrapWebContents = (webContents) -> else webContents.once 'did-finish-load', @_executeJavaScript.bind(this, code) - # The processId and routingId and identify a webContents. - webContents.getId = -> @getProcessId() - webContents.equal = (other) -> @getId() is other.getId() - # The navigation controller. controller = new NavigationController(webContents) for name, method of NavigationController.prototype when method instanceof Function