Browse Source

Expose getProcessId from 1.4 for render-view-deleted fix

Kevin Sawicki 8 years ago
parent
commit
5a768b3dfe

+ 5 - 0
atom/browser/api/atom_api_web_contents.cc

@@ -807,6 +807,10 @@ int WebContents::GetID() const {
   return web_contents()->GetRenderProcessHost()->GetID();
 }
 
+int WebContents::GetProcessID() const {
+  return web_contents()->GetRenderProcessHost()->GetID();
+}
+
 WebContents::Type WebContents::GetType() const {
   return type_;
 }
@@ -1469,6 +1473,7 @@ void WebContents::BuildPrototype(v8::Isolate* isolate,
   mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
       .MakeDestroyable()
       .SetMethod("getId", &WebContents::GetID)
+      .SetMethod("getProcessId", &WebContents::GetProcessID)
       .SetMethod("equal", &WebContents::Equal)
       .SetMethod("_loadURL", &WebContents::LoadURL)
       .SetMethod("downloadURL", &WebContents::DownloadURL)

+ 1 - 0
atom/browser/api/atom_api_web_contents.h

@@ -67,6 +67,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
                              v8::Local<v8::FunctionTemplate> prototype);
 
   int GetID() const;
+  int GetProcessID() const;
   Type GetType() const;
   bool Equal(const WebContents* web_contents) const;
   void LoadURL(const GURL& url, const mate::Dictionary& options);