Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Unified Diff: content/browser/renderer_host/java/java_bridge_dispatcher_host.h

Issue 11359143: Make sure Java Bridge cleans up all stub object it creates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/java/java_bridge_dispatcher_host.h
diff --git a/content/browser/renderer_host/java/java_bridge_dispatcher_host.h b/content/browser/renderer_host/java/java_bridge_dispatcher_host.h
index e8927b1f61cd0a59463510196d11b25cf275b3ed..7cf99a0f026cbe59e07a41e6e785f4d35c9e5238 100644
--- a/content/browser/renderer_host/java/java_bridge_dispatcher_host.h
+++ b/content/browser/renderer_host/java/java_bridge_dispatcher_host.h
@@ -5,8 +5,11 @@
#ifndef CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_H_
#define CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_H_
+#include <vector>
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "base/string16.h"
+#include "content/common/npobject_stub.h"
#include "content/public/browser/render_view_host_observer.h"
class RouteIDGenerator;
@@ -60,8 +63,11 @@ class JavaBridgeDispatcherHost
void CreateNPVariantParam(NPObject* object, NPVariant_Param* param);
void CreateObjectStub(NPObject* object, int route_id);
+ static void CleanUpStubs(std::vector<base::WeakPtr<NPObjectStub> > stubs_);
joth 2012/11/14 00:51:27 as this is a helper for the d'tor, no need for it
acleung 2012/11/15 22:39:40 Great idea.
+
scoped_refptr<NPChannelBase> channel_;
bool is_renderer_initialized_;
+ std::vector<base::WeakPtr<NPObjectStub> > stubs_;
DISALLOW_COPY_AND_ASSIGN(JavaBridgeDispatcherHost);
};

Powered by Google App Engine
This is Rietveld 408576698