summaryrefslogtreecommitdiffstats
path: root/webkit/appcache
diff options
context:
space:
mode:
authorsatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-13 08:18:55 +0000
committersatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-13 08:18:55 +0000
commit8e8bb6d329bdad0efe5bddd5d39e0efe64d9846a (patch)
treea7425d106d83f1f031516e18ea9600363341fdb8 /webkit/appcache
parent1bc1c69f95dab2c34232a5c8793cf9db51af2386 (diff)
downloadchromium_src-8e8bb6d329bdad0efe5bddd5d39e0efe64d9846a.zip
chromium_src-8e8bb6d329bdad0efe5bddd5d39e0efe64d9846a.tar.gz
chromium_src-8e8bb6d329bdad0efe5bddd5d39e0efe64d9846a.tar.bz2
Rename all methods accessing Singleton<T> as GetInstance().
This is in preparation to a subsequent CL where Singleton<T> will restrict access to only the type being made singleton. I also moved pepper::ResourceTracker to a lazy instance since there were too many places in code where this class was being accessed from and this was a smaller change than renaming methods in that case. BUG=65298 TEST=all existing tests should pass. Review URL: http://codereview.chromium.org/5685007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68982 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache')
-rw-r--r--webkit/appcache/appcache_interceptor.cc9
-rw-r--r--webkit/appcache/appcache_interceptor.h8
2 files changed, 10 insertions, 7 deletions
diff --git a/webkit/appcache/appcache_interceptor.cc b/webkit/appcache/appcache_interceptor.cc
index 969b513..1c76df4 100644
--- a/webkit/appcache/appcache_interceptor.cc
+++ b/webkit/appcache/appcache_interceptor.cc
@@ -13,15 +13,20 @@
namespace appcache {
+// static
+AppCacheInterceptor* AppCacheInterceptor::GetInstance() {
+ return Singleton<AppCacheInterceptor>::get();
+}
+
void AppCacheInterceptor::SetHandler(
net::URLRequest* request, AppCacheRequestHandler* handler) {
- request->SetUserData(instance(), handler); // request takes ownership
+ request->SetUserData(GetInstance(), handler); // request takes ownership
}
AppCacheRequestHandler* AppCacheInterceptor::GetHandler(
net::URLRequest* request) {
return reinterpret_cast<AppCacheRequestHandler*>(
- request->GetUserData(instance()));
+ request->GetUserData(GetInstance()));
}
void AppCacheInterceptor::SetExtraRequestInfo(
diff --git a/webkit/appcache/appcache_interceptor.h b/webkit/appcache/appcache_interceptor.h
index 5a7acfd..a13dcc6 100644
--- a/webkit/appcache/appcache_interceptor.h
+++ b/webkit/appcache/appcache_interceptor.h
@@ -22,7 +22,7 @@ class AppCacheInterceptor : public net::URLRequest::Interceptor {
// Registers a singleton instance with the net library.
// Should be called early in the IO thread prior to initiating requests.
static void EnsureRegistered() {
- CHECK(instance());
+ CHECK(GetInstance());
}
// Must be called to make a request eligible for retrieval from an appcache.
@@ -38,6 +38,8 @@ class AppCacheInterceptor : public net::URLRequest::Interceptor {
int64* cache_id,
GURL* manifest_url);
+ static AppCacheInterceptor* GetInstance();
+
protected:
// Overridde from net::URLRequest::Interceptor:
virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request);
@@ -48,10 +50,6 @@ class AppCacheInterceptor : public net::URLRequest::Interceptor {
private:
friend struct DefaultSingletonTraits<AppCacheInterceptor>;
- static AppCacheInterceptor* instance() {
- return Singleton<AppCacheInterceptor>::get();
- }
-
AppCacheInterceptor();
virtual ~AppCacheInterceptor();