Browse Source

Use 1.3 getId implementation to track render view deletesp

Kevin Sawicki 8 years ago
parent
commit
ac54984763

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

@@ -807,10 +807,6 @@ 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_;
 }
@@ -1473,7 +1469,6 @@ 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)

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

@@ -67,7 +67,6 @@ 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);

+ 1 - 2
lib/browser/objects-registry.js

@@ -92,9 +92,8 @@ class ObjectsRegistry {
 
   // Private: Clear the storage when webContents is reloaded/navigated.
   registerDeleteListener (webContents, webContentsId) {
-    const processId = webContents.getProcessId()
     const listener = (event, deletedProcessId) => {
-      if (deletedProcessId === processId) {
+      if (deletedProcessId === webContentsId) {
         webContents.removeListener('render-view-deleted', listener)
         this.clear(webContentsId)
       }