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

Side by Side Diff: content/renderer/browser_plugin/browser_plugin_bindings.cc

Issue 15941006: Track NPObject ownership by the originating plugins' NPP identifier. [2/3] (Chrome) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix CppBoundClass. Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/browser_plugin/browser_plugin_bindings.h" 5 #include "content/renderer/browser_plugin/browser_plugin_bindings.h"
6 6
7 #include <cstdlib> 7 #include <cstdlib>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 } 810 }
811 811
812 BrowserPluginBindings::BrowserPluginNPObject::~BrowserPluginNPObject() { 812 BrowserPluginBindings::BrowserPluginNPObject::~BrowserPluginNPObject() {
813 } 813 }
814 814
815 BrowserPluginBindings::BrowserPluginBindings(BrowserPlugin* instance) 815 BrowserPluginBindings::BrowserPluginBindings(BrowserPlugin* instance)
816 : instance_(instance), 816 : instance_(instance),
817 np_object_(NULL), 817 np_object_(NULL),
818 weak_ptr_factory_(this) { 818 weak_ptr_factory_(this) {
819 NPObject* obj = 819 NPObject* obj =
820 WebBindings::createObject(NULL, &browser_plugin_message_class); 820 WebBindings::createObject(instance->pluginNPP(),
821 &browser_plugin_message_class);
821 np_object_ = static_cast<BrowserPluginBindings::BrowserPluginNPObject*>(obj); 822 np_object_ = static_cast<BrowserPluginBindings::BrowserPluginNPObject*>(obj);
822 np_object_->message_channel = weak_ptr_factory_.GetWeakPtr(); 823 np_object_->message_channel = weak_ptr_factory_.GetWeakPtr();
823 824
824 method_bindings_.push_back(new BrowserPluginBindingAttachWindowTo); 825 method_bindings_.push_back(new BrowserPluginBindingAttachWindowTo);
825 method_bindings_.push_back(new BrowserPluginBindingBack); 826 method_bindings_.push_back(new BrowserPluginBindingBack);
826 method_bindings_.push_back(new BrowserPluginBindingCanGoBack); 827 method_bindings_.push_back(new BrowserPluginBindingCanGoBack);
827 method_bindings_.push_back(new BrowserPluginBindingCanGoForward); 828 method_bindings_.push_back(new BrowserPluginBindingCanGoForward);
828 method_bindings_.push_back(new BrowserPluginBindingForward); 829 method_bindings_.push_back(new BrowserPluginBindingForward);
829 method_bindings_.push_back(new BrowserPluginBindingGetProcessID); 830 method_bindings_.push_back(new BrowserPluginBindingGetProcessID);
830 method_bindings_.push_back(new BrowserPluginBindingGetRouteID); 831 method_bindings_.push_back(new BrowserPluginBindingGetRouteID);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 for (PropertyBindingList::iterator iter = property_bindings_.begin(); 917 for (PropertyBindingList::iterator iter = property_bindings_.begin();
917 iter != property_bindings_.end(); 918 iter != property_bindings_.end();
918 ++iter) { 919 ++iter) {
919 if ((*iter)->MatchesName(name)) 920 if ((*iter)->MatchesName(name))
920 return (*iter)->GetProperty(this, result); 921 return (*iter)->GetProperty(this, result);
921 } 922 }
922 return false; 923 return false;
923 } 924 }
924 925
925 } // namespace content 926 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin.cc ('k') | content/renderer/webplugin_delegate_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698