Commit 5b9f0b57 authored by avi@chromium.org's avatar avi@chromium.org

Attached data cleanup.

Clean up comments on SupportsUserData.
Fix typos in ResourceContextImpl.
Remove use of PropertyBag from ExtensionService as it hasn't been used since r135419.
Remove use of PropertyBag from RenderWidgetHostImpl as it hasn't been used since r83122.

BUG=141177
TEST=none


Review URL: https://chromiumcodereview.appspot.com/10824342

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152421 0039d316-1c4b-4281-b951-d872f2087c98
parent 6b626b91
......@@ -20,7 +20,8 @@ class BASE_EXPORT SupportsUserData {
SupportsUserData();
// Derive from this class and add your own data members to associate extra
// information with this object. Use GetUserData(key) and SetUserData()
// information with this object. Alternatively, add this as a public base
// class to any class with a virtual destructor.
class BASE_EXPORT Data {
public:
virtual ~Data() {}
......@@ -40,7 +41,7 @@ class BASE_EXPORT SupportsUserData {
private:
typedef std::map<const void*, linked_ptr<Data> > DataMap;
// Externally-defined data accessible by key
// Externally-defined data accessible by key.
DataMap user_data_;
DISALLOW_COPY_AND_ASSIGN(SupportsUserData);
......
......@@ -2502,11 +2502,6 @@ void ExtensionService::SetHasUsedWebRequest(const Extension* extension,
extension_runtime_data_[extension->id()].has_used_webrequest = value;
}
base::PropertyBag* ExtensionService::GetPropertyBag(
const Extension* extension) {
return &extension_runtime_data_[extension->id()].property_bag;
}
void ExtensionService::RegisterNaClModule(const GURL& url,
const std::string& mime_type) {
NaClModuleInfo info;
......
......@@ -16,7 +16,6 @@
#include "base/memory/linked_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/property_bag.h"
#include "base/string16.h"
#include "base/time.h"
#include "base/tuple.h"
......@@ -272,9 +271,6 @@ class ExtensionService
bool HasUsedWebRequest(const extensions::Extension* extension) const;
void SetHasUsedWebRequest(const extensions::Extension* extension, bool value);
// Getter for the extension's runtime data PropertyBag.
base::PropertyBag* GetPropertyBag(const extensions::Extension* extension);
// Initialize and start all installed extensions.
void Init();
......@@ -639,9 +635,6 @@ class ExtensionService
// True if the extension has used the webRequest API.
bool has_used_webrequest;
// Generic bag of runtime data that users can associate with extensions.
base::PropertyBag property_bag;
ExtensionRuntimeData();
~ExtensionRuntimeData();
};
......
......@@ -15,7 +15,6 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/process_util.h"
#include "base/property_bag.h"
#include "base/string16.h"
#include "base/timer.h"
#include "build/build_config.h"
......@@ -132,12 +131,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost,
bool empty() const { return current_size_.IsEmpty(); }
// Returns the property bag for this widget, where callers can add extra data
// they may wish to associate with it. Returns a pointer rather than a
// reference since the PropertyAccessors expect this.
const base::PropertyBag* property_bag() const { return &property_bag_; }
base::PropertyBag* property_bag() { return &property_bag_; }
// Called when a renderer object already been created for this host, and we
// just need to be attached to it. Used for window.open, <select> dropdown
// menus, and other times when the renderer initiates creating an object.
......@@ -628,9 +621,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost,
// The ID of the corresponding object in the Renderer Instance.
int routing_id_;
// Stores random bits of data for others to associate with this object.
base::PropertyBag property_bag_;
// The ID of the surface corresponding to this render widget.
int surface_id_;
......
......@@ -30,7 +30,7 @@
#include "webkit/fileapi/file_system_url_request_job_factory.h"
// Key names on ResourceContext.
static const char* kAppCacheServicKeyName = "content_appcache_service_tracker";
static const char* kAppCacheServiceKeyName = "content_appcache_service_tracker";
static const char* kBlobStorageContextKeyName = "content_blob_storage_context";
static const char* kDatabaseTrackerKeyName = "content_database_tracker";
static const char* kFileSystemContextKeyName = "content_file_system_context";
......@@ -184,7 +184,7 @@ void InitializeRequestContext(
AppCacheService* ResourceContext::GetAppCacheService(ResourceContext* context) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
return UserDataAdapter<ChromeAppCacheService>::Get(
context, kAppCacheServicKeyName);
context, kAppCacheServiceKeyName);
}
ResourceContext::ResourceContext() {
......@@ -255,7 +255,7 @@ void InitializeResourceContext(BrowserContext* browser_context) {
new UserDataAdapter<webkit_database::DatabaseTracker>(
BrowserContext::GetDatabaseTracker(browser_context)));
resource_context->SetUserData(
kAppCacheServicKeyName,
kAppCacheServiceKeyName,
new UserDataAdapter<ChromeAppCacheService>(
static_cast<ChromeAppCacheService*>(
BrowserContext::GetAppCacheService(browser_context))));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment