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

Unified Diff: content/common/property_bag.cc

Issue 8652002: Move PropertyBag to base. Originally this was in chrome\common because only chrome used it. Now t... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: move to base namespace and forward declare where possible Created 9 years, 1 month 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/common/property_bag.h ('k') | content/common/property_bag_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/property_bag.cc
===================================================================
--- content/common/property_bag.cc (revision 111170)
+++ content/common/property_bag.cc (working copy)
@@ -1,56 +0,0 @@
-// 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.
-
-#include "base/memory/linked_ptr.h"
-#include "content/common/property_bag.h"
-
-PropertyBag::PropertyBag() {
-}
-
-PropertyBag::PropertyBag(const PropertyBag& other) {
- operator=(other);
-}
-
-PropertyBag::~PropertyBag() {
-}
-
-PropertyBag& PropertyBag::operator=(const PropertyBag& other) {
- props_.clear();
-
- // We need to make copies of each property using the virtual copy() method.
- for (PropertyMap::const_iterator i = other.props_.begin();
- i != other.props_.end(); ++i)
- props_[i->first] = linked_ptr<Prop>(i->second->copy());
- return *this;
-}
-
-void PropertyBag::SetProperty(PropID id, Prop* prop) {
- props_[id] = linked_ptr<Prop>(prop);
-}
-
-PropertyBag::Prop* PropertyBag::GetProperty(PropID id) {
- PropertyMap::const_iterator found = props_.find(id);
- if (found == props_.end())
- return NULL;
- return found->second.get();
-}
-
-const PropertyBag::Prop* PropertyBag::GetProperty(PropID id) const {
- PropertyMap::const_iterator found = props_.find(id);
- if (found == props_.end())
- return NULL;
- return found->second.get();
-}
-
-void PropertyBag::DeleteProperty(PropID id) {
- PropertyMap::iterator found = props_.find(id);
- if (found == props_.end())
- return; // Not found, nothing to do.
- props_.erase(found);
-}
-
-PropertyAccessorBase::PropertyAccessorBase() {
- static PropertyBag::PropID next_id = 1;
- prop_id_ = next_id++;
-}
« no previous file with comments | « content/common/property_bag.h ('k') | content/common/property_bag_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698