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

Side by Side Diff: content/browser/appcache/chrome_appcache_service.cc

Issue 10068037: RefCounted types should not have public destructors, content/browser part 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: MSVC fixes Created 8 years, 8 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/appcache/chrome_appcache_service.h" 5 #include "content/browser/appcache/chrome_appcache_service.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "content/public/browser/content_browser_client.h" 9 #include "content/public/browser/content_browser_client.h"
10 #include "content/public/browser/resource_context.h" 10 #include "content/public/browser/resource_context.h"
(...skipping 21 matching lines...) Expand all
32 // Init our base class. 32 // Init our base class.
33 Initialize( 33 Initialize(
34 cache_path_, 34 cache_path_,
35 BrowserThread::GetMessageLoopProxyForThread( 35 BrowserThread::GetMessageLoopProxyForThread(
36 BrowserThread::FILE_USER_BLOCKING), 36 BrowserThread::FILE_USER_BLOCKING),
37 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); 37 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE));
38 set_appcache_policy(this); 38 set_appcache_policy(this);
39 set_special_storage_policy(special_storage_policy); 39 set_special_storage_policy(special_storage_policy);
40 } 40 }
41 41
42 ChromeAppCacheService::~ChromeAppCacheService() {
43 }
44
45 void ChromeAppCacheService::DeleteOnCorrectThread() const {
46 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO) &&
47 !BrowserThread::CurrentlyOn(BrowserThread::IO)) {
48 BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this);
49 return;
50 }
51 delete this;
52 }
53
54 bool ChromeAppCacheService::CanLoadAppCache(const GURL& manifest_url, 42 bool ChromeAppCacheService::CanLoadAppCache(const GURL& manifest_url,
55 const GURL& first_party) { 43 const GURL& first_party) {
56 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 44 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
57 // We don't prompt for read access. 45 // We don't prompt for read access.
58 return content::GetContentClient()->browser()->AllowAppCache( 46 return content::GetContentClient()->browser()->AllowAppCache(
59 manifest_url, first_party, resource_context_); 47 manifest_url, first_party, resource_context_);
60 } 48 }
61 49
62 bool ChromeAppCacheService::CanCreateAppCache( 50 bool ChromeAppCacheService::CanCreateAppCache(
63 const GURL& manifest_url, const GURL& first_party) { 51 const GURL& manifest_url, const GURL& first_party) {
64 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 52 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
65 return content::GetContentClient()->browser()->AllowAppCache( 53 return content::GetContentClient()->browser()->AllowAppCache(
66 manifest_url, first_party, resource_context_); 54 manifest_url, first_party, resource_context_);
67 } 55 }
56
57 ChromeAppCacheService::~ChromeAppCacheService() {}
58
59 void ChromeAppCacheService::DeleteOnCorrectThread() const {
60 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO) &&
61 !BrowserThread::CurrentlyOn(BrowserThread::IO)) {
62 BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this);
63 return;
64 }
65 delete this;
66 }
OLDNEW
« no previous file with comments | « content/browser/appcache/chrome_appcache_service.h ('k') | content/browser/browser_thread_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698