From 687b96058845cdaa59f9d81c468f81222e60bdfd Mon Sep 17 00:00:00 2001 From: "satish@chromium.org" Date: Wed, 8 Dec 2010 10:43:08 +0000 Subject: Add a new GetInstance() method for singleton classes, take 2. This is a small step towards making all singleton classes use the Singleton pattern within their code and not expect the callers to know about it. This CL includes all files except those under chrome/browser, chrome/net, chrome/service and third_party/WebKit (these will be done in future CLs). Suggested files to focus for reviewers: - joi@ for files under src/ceee - tommi@ for files under src/chrome_frame - maruel@ for the rest of the files. BUG=65298 TEST=all existing tests should continue to pass. Review URL: http://codereview.chromium.org/5581008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68577 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/glue/plugins/pepper_resource_tracker.cc | 5 +++++ webkit/glue/plugins/pepper_resource_tracker.h | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'webkit/glue/plugins') diff --git a/webkit/glue/plugins/pepper_resource_tracker.cc b/webkit/glue/plugins/pepper_resource_tracker.cc index ba6f8f0..f9d24ed 100644 --- a/webkit/glue/plugins/pepper_resource_tracker.cc +++ b/webkit/glue/plugins/pepper_resource_tracker.cc @@ -29,6 +29,11 @@ ResourceTracker::ResourceTracker() ResourceTracker::~ResourceTracker() { } +// static +ResourceTracker* ResourceTracker::Get() { + return Singleton::get(); +} + PP_Resource ResourceTracker::AddResource(Resource* resource) { // If the plugin manages to create 4B resources... if (last_id_ == std::numeric_limits::max()) { diff --git a/webkit/glue/plugins/pepper_resource_tracker.h b/webkit/glue/plugins/pepper_resource_tracker.h index ad25d1a..8e294855 100644 --- a/webkit/glue/plugins/pepper_resource_tracker.h +++ b/webkit/glue/plugins/pepper_resource_tracker.h @@ -29,9 +29,7 @@ class Resource; class ResourceTracker { public: // Returns the pointer to the singleton object. - static ResourceTracker* Get() { - return Singleton::get(); - } + static ResourceTracker* Get(); // PP_Resources -------------------------------------------------------------- -- cgit v1.1