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

Unified Diff: webkit/glue/plugins/plugin_group.cc

Issue 5918003: Bugfixes for recent PluginGroup refactoring. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years 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 | « webkit/glue/plugins/plugin_group.h ('k') | webkit/glue/plugins/plugin_group_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/plugin_group.cc
diff --git a/webkit/glue/plugins/plugin_group.cc b/webkit/glue/plugins/plugin_group.cc
index 548e624a81fd239a9406a24dd134e5cf0503f374..22a5d973fca6e4cd52f6cc853ec64ab8ed5d30ca 100644
--- a/webkit/glue/plugins/plugin_group.cc
+++ b/webkit/glue/plugins/plugin_group.cc
@@ -109,13 +109,10 @@ void PluginGroup::InitFrom(const PluginGroup& other) {
description_ = other.description_;
update_url_ = other.update_url_;
enabled_ = other.enabled_;
- for (size_t i = 0; i < other.version_ranges_.size(); ++i)
- version_ranges_.push_back(other.version_ranges_[i]);
- DCHECK_EQ(other.web_plugin_infos_.size(), other.web_plugin_positions_.size());
- for (size_t i = 0; i < other.web_plugin_infos_.size(); ++i)
- AddPlugin(other.web_plugin_infos_[i], other.web_plugin_positions_[i]);
- if (!version_.get())
- version_.reset(Version::GetVersionFromString("0"));
+ version_ranges_ = other.version_ranges_;
+ version_.reset(other.version_->Clone());
+ web_plugin_infos_ = other.web_plugin_infos_;
+ web_plugin_positions_ = other.web_plugin_positions_;
}
PluginGroup::PluginGroup(const PluginGroup& other) {
@@ -123,7 +120,6 @@ PluginGroup::PluginGroup(const PluginGroup& other) {
}
PluginGroup& PluginGroup::operator=(const PluginGroup& other) {
- version_ranges_.clear();
InitFrom(other);
return *this;
}
@@ -252,6 +248,10 @@ void PluginGroup::AddPlugin(const WebPluginInfo& plugin, int position) {
UpdateActivePlugin(plugin);
}
+bool PluginGroup::IsEmpty() const {
+ return web_plugin_infos_.empty();
+}
+
string16 PluginGroup::GetGroupName() const {
if (!group_name_.empty())
return group_name_;
« no previous file with comments | « webkit/glue/plugins/plugin_group.h ('k') | webkit/glue/plugins/plugin_group_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698