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

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

Issue 11412297: Revert 170694 (requested by acleung on irc, breaks content tests on linux) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years 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
« no previous file with comments | « content/browser/renderer_host/java/java_bridge_dispatcher_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/java/java_bridge_dispatcher_host.cc
===================================================================
--- content/browser/renderer_host/java/java_bridge_dispatcher_host.cc (revision 170698)
+++ content/browser/renderer_host/java/java_bridge_dispatcher_host.cc (working copy)
@@ -29,15 +29,6 @@
Stop();
}
};
-
-void CleanUpStubs(const std::vector<base::WeakPtr<NPObjectStub> > & stubs) {
- for (size_t i = 0; i < stubs.size(); ++i) {
- if (stubs[i]) {
- stubs[i]->DeleteSoon();
- }
- }
-}
-
base::LazyInstance<JavaBridgeThread> g_background_thread =
LAZY_INSTANCE_INITIALIZER;
} // namespace
@@ -49,9 +40,6 @@
}
JavaBridgeDispatcherHost::~JavaBridgeDispatcherHost() {
- g_background_thread.Get().message_loop()->PostTask(
- FROM_HERE,
- base::Bind(&CleanUpStubs, stubs_));
}
void JavaBridgeDispatcherHost::AddNamedObject(const string16& name,
@@ -145,19 +133,13 @@
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
}
- // In a typical scenario, the lifetime of each NPObjectStub is governed by
- // that of the NPObjectProxy in the renderer, via the channel. However,
- // we cannot guaranteed that the renderer always terminates cleanly
- // (crashes / sometimes just unavoidable). We keep a weak reference to
- // it now and schedule a delete on it when this host is getting deleted.
-
+ // NPObjectStub takes a ref to the NPObject. The lifetime of the NPObjectStub
+ // is governed by that of the NPObjectProxy in the renderer, via the channel.
// Pass 0 for the containing window, as it's only used by plugins to pump the
// window message queue when a method on a renderer-side object causes a
// dialog to be displayed, and the Java Bridge does not need this
// functionality. The page URL is also not required.
- stubs_.push_back(
- (new NPObjectStub(object, channel_, route_id, 0, GURL()))->AsWeakPtr());
-
+ new NPObjectStub(object, channel_, route_id, 0, GURL());
// The NPObjectStub takes a reference to the NPObject. Release the ref added
// in CreateNPVariantParam().
WebKit::WebBindings::releaseObject(object);
« no previous file with comments | « content/browser/renderer_host/java/java_bridge_dispatcher_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698