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

Unified Diff: content/plugin/plugin_channel.cc

Issue 17208003: Track NPObject ownership by the originating plugins' NPP identifier. [4/6] (Chrome) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove DCHECKs on proxy and stub maps. Created 7 years, 6 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
« no previous file with comments | « content/plugin/plugin_channel.h ('k') | content/plugin/webplugin_delegate_stub.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/plugin/plugin_channel.cc
diff --git a/content/plugin/plugin_channel.cc b/content/plugin/plugin_channel.cc
index 0ba37737b9188bc4e228bd02ab74975afa12095b..0c4f46390730c1a0317320383b57df1ae0f1f3fd 100644
--- a/content/plugin/plugin_channel.cc
+++ b/content/plugin/plugin_channel.cc
@@ -18,6 +18,7 @@
#include "content/plugin/webplugin_delegate_stub.h"
#include "content/plugin/webplugin_proxy.h"
#include "content/public/common/content_switches.h"
+#include "third_party/WebKit/public/web/WebBindings.h"
#include "webkit/plugins/npapi/plugin_instance.h"
#if defined(OS_POSIX)
@@ -25,6 +26,8 @@
#include "ipc/ipc_channel_posix.h"
#endif
+using WebKit::WebBindings;
+
namespace content {
namespace {
@@ -237,11 +240,17 @@ PluginChannel::PluginChannel()
: renderer_id_(-1),
in_send_(0),
incognito_(false),
- filter_(new MessageFilter()) {
+ filter_(new MessageFilter()),
+ npp_(new struct _NPP) {
set_send_unblocking_only_during_unblock_dispatch();
ChildProcess::current()->AddRefProcess();
const CommandLine* command_line = CommandLine::ForCurrentProcess();
log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages);
+
+ // Register |npp_| as the default owner for any object we receive via IPC,
+ // and register it with WebBindings as a valid owner.
+ SetDefaultNPObjectOwner(npp_.get());
+ WebBindings::registerObjectOwner(npp_.get());
}
bool PluginChannel::OnControlMessageReceived(const IPC::Message& msg) {
« no previous file with comments | « content/plugin/plugin_channel.h ('k') | content/plugin/webplugin_delegate_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698