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

Side by Side Diff: chrome/browser/appcache/chrome_appcache_service.h

Issue 6077005: Refactored app cache clear on exit code to happen in the object owning the files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved clean up code to ChromeAppCacheService class. Created 9 years, 11 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_ 5 #ifndef CHROME_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_
6 #define CHROME_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_ 6 #define CHROME_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/ref_counted.h" 9 #include "base/ref_counted.h"
10 #include "chrome/browser/browser_thread.h" 10 #include "chrome/browser/browser_thread.h"
(...skipping 17 matching lines...) Expand all
28 : public base::RefCountedThreadSafe<ChromeAppCacheService, 28 : public base::RefCountedThreadSafe<ChromeAppCacheService,
29 BrowserThread::DeleteOnIOThread>, 29 BrowserThread::DeleteOnIOThread>,
30 public appcache::AppCacheService, 30 public appcache::AppCacheService,
31 public appcache::AppCachePolicy, 31 public appcache::AppCachePolicy,
32 public NotificationObserver { 32 public NotificationObserver {
33 public: 33 public:
34 ChromeAppCacheService(); 34 ChromeAppCacheService();
35 35
36 void InitializeOnIOThread( 36 void InitializeOnIOThread(
37 const FilePath& profile_path, bool is_incognito, 37 const FilePath& profile_path, bool is_incognito,
38 scoped_refptr<HostContentSettingsMap> content_settings_map); 38 scoped_refptr<HostContentSettingsMap> content_settings_map,
39 bool clear_local_state_on_exit);
39 40
40 // Helpers used by the extension service to grant and revoke 41 // Helpers used by the extension service to grant and revoke
41 // unlimited storage to app extensions. 42 // unlimited storage to app extensions.
42 void SetOriginQuotaInMemory(const GURL& origin, int64 quota); 43 void SetOriginQuotaInMemory(const GURL& origin, int64 quota);
43 void ResetOriginQuotaInMemory(const GURL& origin); 44 void ResetOriginQuotaInMemory(const GURL& origin);
44 45
45 static void ClearLocalState(const FilePath& profile_path); 46 void SetClearLocalStateOnExit(bool clear_local_state) {
47 clear_local_state_on_exit_ = clear_local_state;
48 }
46 49
47 private: 50 private:
48 friend class BrowserThread; 51 friend class BrowserThread;
49 friend class DeleteTask<ChromeAppCacheService>; 52 friend class DeleteTask<ChromeAppCacheService>;
50 53
51 virtual ~ChromeAppCacheService(); 54 virtual ~ChromeAppCacheService();
52 55
53 // AppCachePolicy overrides 56 // AppCachePolicy overrides
54 virtual bool CanLoadAppCache(const GURL& manifest_url); 57 virtual bool CanLoadAppCache(const GURL& manifest_url);
55 virtual int CanCreateAppCache(const GURL& manifest_url, 58 virtual int CanCreateAppCache(const GURL& manifest_url,
56 net::CompletionCallback* callback); 59 net::CompletionCallback* callback);
57 60
58 // NotificationObserver override 61 // NotificationObserver override
59 virtual void Observe(NotificationType type, 62 virtual void Observe(NotificationType type,
60 const NotificationSource& source, 63 const NotificationSource& source,
61 const NotificationDetails& details); 64 const NotificationDetails& details);
62 65
63 scoped_refptr<HostContentSettingsMap> host_contents_settings_map_; 66 scoped_refptr<HostContentSettingsMap> host_contents_settings_map_;
64 NotificationRegistrar registrar_; 67 NotificationRegistrar registrar_;
68 bool clear_local_state_on_exit_;
jochen (gone - plz use gerrit) 2011/01/04 14:32:53 this is accessed on both IO and UI threads, so you
69 FilePath cache_path_;
65 }; 70 };
66 71
67 #endif // CHROME_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_ 72 #endif // CHROME_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/appcache/chrome_appcache_service.cc » ('j') | chrome/browser/appcache/chrome_appcache_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698