diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-27 23:40:50 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-27 23:40:50 +0000 |
commit | fb90c94fa3047eca1a40cb82441677a5ac49b9e8 (patch) | |
tree | 5956e91c4747fb1d6f04e49d818e5cfc5aa0608f /content/browser/appcache | |
parent | 21b8d16c96464322fbdb8d970c3d0637cceed714 (diff) | |
download | chromium_src-fb90c94fa3047eca1a40cb82441677a5ac49b9e8.zip chromium_src-fb90c94fa3047eca1a40cb82441677a5ac49b9e8.tar.gz chromium_src-fb90c94fa3047eca1a40cb82441677a5ac49b9e8.tar.bz2 |
RefCounted types should not have public destructors, content/browser part 1
BUG=123295
TEST=none
Review URL: http://codereview.chromium.org/10068037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134395 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/appcache')
4 files changed, 33 insertions, 27 deletions
diff --git a/content/browser/appcache/appcache_dispatcher_host.cc b/content/browser/appcache/appcache_dispatcher_host.cc index 0ac5d94..577746d 100644 --- a/content/browser/appcache/appcache_dispatcher_host.cc +++ b/content/browser/appcache/appcache_dispatcher_host.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -21,8 +21,6 @@ AppCacheDispatcherHost::AppCacheDispatcherHost( process_id_(process_id) { } -AppCacheDispatcherHost::~AppCacheDispatcherHost() {} - void AppCacheDispatcherHost::OnChannelConnected(int32 peer_pid) { BrowserMessageFilter::OnChannelConnected(peer_pid); if (appcache_service_.get()) { @@ -64,6 +62,8 @@ bool AppCacheDispatcherHost::OnMessageReceived(const IPC::Message& message, return handled; } +AppCacheDispatcherHost::~AppCacheDispatcherHost() {} + void AppCacheDispatcherHost::BadMessageReceived() { content::RecordAction(UserMetricsAction("BadMessageTerminate_ACDH")); BrowserMessageFilter::BadMessageReceived(); diff --git a/content/browser/appcache/appcache_dispatcher_host.h b/content/browser/appcache/appcache_dispatcher_host.h index 0ba101b..f9bb5f4 100644 --- a/content/browser/appcache/appcache_dispatcher_host.h +++ b/content/browser/appcache/appcache_dispatcher_host.h @@ -25,17 +25,19 @@ class AppCacheDispatcherHost : public content::BrowserMessageFilter { public: AppCacheDispatcherHost(ChromeAppCacheService* appcache_service, int process_id); - virtual ~AppCacheDispatcherHost(); // BrowserIOMessageFilter implementation virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; virtual bool OnMessageReceived(const IPC::Message& message, bool* message_was_ok) OVERRIDE; - private: + protected: + virtual ~AppCacheDispatcherHost(); + // content::BrowserMessageFilter override. virtual void BadMessageReceived() OVERRIDE; + private: // IPC message handlers void OnRegisterHost(int host_id); void OnUnregisterHost(int host_id); diff --git a/content/browser/appcache/chrome_appcache_service.cc b/content/browser/appcache/chrome_appcache_service.cc index 6fa5ebc..c4512b0 100644 --- a/content/browser/appcache/chrome_appcache_service.cc +++ b/content/browser/appcache/chrome_appcache_service.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -39,18 +39,6 @@ void ChromeAppCacheService::InitializeOnIOThread( set_special_storage_policy(special_storage_policy); } -ChromeAppCacheService::~ChromeAppCacheService() { -} - -void ChromeAppCacheService::DeleteOnCorrectThread() const { - if (BrowserThread::IsMessageLoopValid(BrowserThread::IO) && - !BrowserThread::CurrentlyOn(BrowserThread::IO)) { - BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); - return; - } - delete this; -} - bool ChromeAppCacheService::CanLoadAppCache(const GURL& manifest_url, const GURL& first_party) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); @@ -65,3 +53,14 @@ bool ChromeAppCacheService::CanCreateAppCache( return content::GetContentClient()->browser()->AllowAppCache( manifest_url, first_party, resource_context_); } + +ChromeAppCacheService::~ChromeAppCacheService() {} + +void ChromeAppCacheService::DeleteOnCorrectThread() const { + if (BrowserThread::IsMessageLoopValid(BrowserThread::IO) && + !BrowserThread::CurrentlyOn(BrowserThread::IO)) { + BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); + return; + } + delete this; +} diff --git a/content/browser/appcache/chrome_appcache_service.h b/content/browser/appcache/chrome_appcache_service.h index 6fb7785..d30b3d3 100644 --- a/content/browser/appcache/chrome_appcache_service.h +++ b/content/browser/appcache/chrome_appcache_service.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -35,30 +35,35 @@ struct ChromeAppCacheServiceDeleter; // TODO(dpranke): Fix dependencies on AppCacheService so that we don't have // to worry about clients calling AppCacheService methods. class CONTENT_EXPORT ChromeAppCacheService - : public base::RefCountedThreadSafe< - ChromeAppCacheService, ChromeAppCacheServiceDeleter>, + : public base::RefCountedThreadSafe<ChromeAppCacheService, + ChromeAppCacheServiceDeleter>, NON_EXPORTED_BASE(public appcache::AppCacheService), NON_EXPORTED_BASE(public appcache::AppCachePolicy) { public: explicit ChromeAppCacheService(quota::QuotaManagerProxy* proxy); - virtual ~ChromeAppCacheService(); void InitializeOnIOThread( const FilePath& cache_path, // may be empty to use in-memory structures content::ResourceContext* resource_context, scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy); - private: - friend struct ChromeAppCacheServiceDeleter; - - void DeleteOnCorrectThread() const; - // AppCachePolicy overrides virtual bool CanLoadAppCache(const GURL& manifest_url, const GURL& first_party) OVERRIDE; virtual bool CanCreateAppCache(const GURL& manifest_url, const GURL& first_party) OVERRIDE; + protected: + virtual ~ChromeAppCacheService(); + + private: + friend class base::DeleteHelper<ChromeAppCacheService>; + friend class base::RefCountedThreadSafe<ChromeAppCacheService, + ChromeAppCacheServiceDeleter>; + friend struct ChromeAppCacheServiceDeleter; + + void DeleteOnCorrectThread() const; + content::ResourceContext* resource_context_; FilePath cache_path_; |