diff options
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/plugins/ppapi/plugin_module.cc | 6 | ||||
-rw-r--r-- | webkit/plugins/ppapi/plugin_module.h | 9 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppapi_unittest.cc | 2 |
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; |