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

Unified Diff: content/renderer/pepper/pepper_broker.cc

Issue 22300003: Move broker creation out of PepperHelperImpl to PPB_Broker_Impl in the effort to eliminate PepperHe… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 4 months 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/renderer/pepper/pepper_broker.cc
===================================================================
--- content/renderer/pepper/pepper_broker.cc (revision 215720)
+++ content/renderer/pepper/pepper_broker.cc (working copy)
@@ -5,7 +5,6 @@
#include "content/renderer/pepper/pepper_broker.h"
#include "build/build_config.h"
-#include "content/renderer/pepper/pepper_helper_impl.h"
#include "content/renderer/pepper/pepper_proxy_channel_delegate_impl.h"
#include "content/renderer/pepper/plugin_module.h"
#include "content/renderer/pepper/ppb_broker_impl.h"
@@ -107,12 +106,9 @@
return result;
}
-PepperBroker::PepperBroker(PluginModule* plugin_module,
- PepperHelperImpl* helper)
- : plugin_module_(plugin_module),
- helper_(helper->AsWeakPtr()) {
+PepperBroker::PepperBroker(PluginModule* plugin_module)
+ : plugin_module_(plugin_module) {
DCHECK(plugin_module_);
- DCHECK(helper_.get());
plugin_module_->SetBroker(this);
}
@@ -147,28 +143,6 @@
// TODO(ddorwin): Send message disconnect message using dispatcher_.
- if (pending_connects_.empty()) {
- // There are no more clients of this broker. Ensure it will be deleted even
- // if the IPC response never comes and OnPepperBrokerChannelCreated is not
- // called to remove this object from pending_connect_broker_.
- // Before the broker is connected, clients must either be in
- // pending_connects_ or not yet associated with this object. Thus, if this
- // object is in pending_connect_broker_, there can be no associated clients
- // once pending_connects_ is empty and it is thus safe to remove this from
- // pending_connect_broker_. Doing so will cause this object to be deleted,
- // removing it from the PluginModule. Any new clients will create a new
- // instance of this object.
- // This doesn't solve all potential problems, but it helps with the ones
- // we can influence.
- if (helper_.get()) {
- bool stopped = helper_->StopWaitingForBrokerConnection(this);
-
- // Verify the assumption that there are no references other than the one
- // |client| holds, which will be released below.
- DCHECK(!stopped || HasOneRef());
- }
- }
-
// Release the reference added in Connect().
// This must be the last statement because it may delete this object.
Release();

Powered by Google App Engine
This is Rietveld 408576698