summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-02 04:51:16 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-02 04:51:16 +0000
commitcb7defb5f3b1ea748d037150f4099b0dbdc39243 (patch)
tree4fcc5076e7e1cca510bc3d7918834c7a3ce0d935 /webkit
parent3075f39b490ed83e41c802b250b6e4f68557304e (diff)
downloadchromium_src-cb7defb5f3b1ea748d037150f4099b0dbdc39243.zip
chromium_src-cb7defb5f3b1ea748d037150f4099b0dbdc39243.tar.gz
chromium_src-cb7defb5f3b1ea748d037150f4099b0dbdc39243.tar.bz2
Set the name of the PPAPI plugin properly when running out of process. This
also does some refactoring of the plugin registry to make it more clear and to avoid recomputilg the plugin list all the time. Review URL: http://codereview.chromium.org/6246031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73427 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/plugins/ppapi/plugin_module.cc6
-rw-r--r--webkit/plugins/ppapi/plugin_module.h9
-rw-r--r--webkit/plugins/ppapi/ppapi_unittest.cc2
3 files changed, 10 insertions, 7 deletions
diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc
index 332770ff..a8d804a 100644
--- a/webkit/plugins/ppapi/plugin_module.cc
+++ b/webkit/plugins/ppapi/plugin_module.cc
@@ -360,10 +360,12 @@ PluginModule::EntryPoints::EntryPoints()
// PluginModule ----------------------------------------------------------------
-PluginModule::PluginModule(PluginDelegate::ModuleLifetime* lifetime_delegate)
+PluginModule::PluginModule(const std::string& name,
+ PluginDelegate::ModuleLifetime* lifetime_delegate)
: lifetime_delegate_(lifetime_delegate),
callback_tracker_(new CallbackTracker),
- library_(NULL) {
+ library_(NULL),
+ name_(name) {
pp_module_ = ResourceTracker::Get()->AddModule(this);
GetMainThreadMessageLoop(); // Initialize the main thread message loop.
GetLivePluginSet()->insert(this);
diff --git a/webkit/plugins/ppapi/plugin_module.h b/webkit/plugins/ppapi/plugin_module.h
index cfdfb6af..4f3e9c3 100644
--- a/webkit/plugins/ppapi/plugin_module.h
+++ b/webkit/plugins/ppapi/plugin_module.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -7,6 +7,7 @@
#include <map>
#include <set>
+#include <string>
#include "base/basictypes.h"
#include "base/native_library.h"
@@ -71,7 +72,8 @@ class PluginModule : public base::RefCounted<PluginModule>,
// The module lifetime delegate is a non-owning pointer that must outlive
// all plugin modules. In practice it will be a global singleton that
// tracks which modules are alive.
- PluginModule(PluginDelegate::ModuleLifetime* lifetime_delegate);
+ PluginModule(const std::string& name,
+ PluginDelegate::ModuleLifetime* lifetime_delegate);
~PluginModule();
@@ -98,7 +100,6 @@ class PluginModule : public base::RefCounted<PluginModule>,
// proxy needs this information to set itself up properly).
PP_Module pp_module() const { return pp_module_; }
- void set_name(const std::string& name) { name_ = name; }
const std::string& name() const { return name_; }
PluginInstance* CreateInstance(PluginDelegate* delegate);
@@ -152,7 +153,7 @@ class PluginModule : public base::RefCounted<PluginModule>,
EntryPoints entry_points_;
// The name of the module.
- std::string name_;
+ const std::string name_;
// Non-owning pointers to all instances associated with this module. When
// there are no more instances, this object should be deleted.
diff --git a/webkit/plugins/ppapi/ppapi_unittest.cc b/webkit/plugins/ppapi/ppapi_unittest.cc
index 7ad58c3..a9a3637 100644
--- a/webkit/plugins/ppapi/ppapi_unittest.cc
+++ b/webkit/plugins/ppapi/ppapi_unittest.cc
@@ -87,7 +87,7 @@ void PpapiUnittest::SetUp() {
delegate_.reset(new MockPluginDelegate);
// Initialize the mock module.
- module_ = new PluginModule(this);
+ module_ = new PluginModule("Mock plugin", this);
PluginModule::EntryPoints entry_points;
entry_points.get_interface = &MockGetInterface;
entry_points.initialize_module = &MockInitializeModule;