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

Side by Side Diff: content/browser/in_process_webkit/indexed_db_context_impl.h

Issue 10447117: Unwire the clear on exit preference from the storage systems. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_IMPL_H_ 5 #ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_IMPL_H_
6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_IMPL_H_ 6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_IMPL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 base::MessageLoopProxy* webkit_thread_loop); 43 base::MessageLoopProxy* webkit_thread_loop);
44 44
45 WebKit::WebIDBFactory* GetIDBFactory(); 45 WebKit::WebIDBFactory* GetIDBFactory();
46 46
47 // The indexed db directory. 47 // The indexed db directory.
48 static const FilePath::CharType kIndexedDBDirectory[]; 48 static const FilePath::CharType kIndexedDBDirectory[];
49 49
50 // The indexed db file extension. 50 // The indexed db file extension.
51 static const FilePath::CharType kIndexedDBExtension[]; 51 static const FilePath::CharType kIndexedDBExtension[];
52 52
53 void set_clear_local_state_on_exit(bool clear_local_state) {
54 clear_local_state_on_exit_ = clear_local_state;
55 }
56
57 // Disables the exit-time deletion for all data (also session-only data). 53 // Disables the exit-time deletion for all data (also session-only data).
58 void SaveSessionState() { 54 void SaveSessionState() {
59 save_session_state_ = true; 55 save_session_state_ = true;
60 } 56 }
61 57
62 // IndexedDBContext implementation: 58 // IndexedDBContext implementation:
63 virtual std::vector<GURL> GetAllOrigins() OVERRIDE; 59 virtual std::vector<GURL> GetAllOrigins() OVERRIDE;
64 virtual int64 GetOriginDiskUsage(const GURL& origin_url) OVERRIDE; 60 virtual int64 GetOriginDiskUsage(const GURL& origin_url) OVERRIDE;
65 virtual base::Time GetOriginLastModified(const GURL& origin_url) OVERRIDE; 61 virtual base::Time GetOriginLastModified(const GURL& origin_url) OVERRIDE;
66 virtual void DeleteForOrigin(const GURL& origin_url) OVERRIDE; 62 virtual void DeleteForOrigin(const GURL& origin_url) OVERRIDE;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 bool IsInOriginSet(const GURL& origin_url) { 110 bool IsInOriginSet(const GURL& origin_url) {
115 std::set<GURL>* set = GetOriginSet(); 111 std::set<GURL>* set = GetOriginSet();
116 return set->find(origin_url) != set->end(); 112 return set->find(origin_url) != set->end();
117 } 113 }
118 114
119 // Only for testing. 115 // Only for testing.
120 void ResetCaches(); 116 void ResetCaches();
121 117
122 scoped_ptr<WebKit::WebIDBFactory> idb_factory_; 118 scoped_ptr<WebKit::WebIDBFactory> idb_factory_;
123 FilePath data_path_; 119 FilePath data_path_;
124 bool clear_local_state_on_exit_;
125 // If true, nothing (not even session-only data) should be deleted on exit. 120 // If true, nothing (not even session-only data) should be deleted on exit.
126 bool save_session_state_; 121 bool save_session_state_;
127 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; 122 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_;
128 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; 123 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_;
129 scoped_ptr<std::set<GURL> > origin_set_; 124 scoped_ptr<std::set<GURL> > origin_set_;
130 OriginToSizeMap origin_size_map_; 125 OriginToSizeMap origin_size_map_;
131 OriginToSizeMap space_available_map_; 126 OriginToSizeMap space_available_map_;
132 std::map<GURL, unsigned int> connection_count_; 127 std::map<GURL, unsigned int> connection_count_;
133 128
134 DISALLOW_COPY_AND_ASSIGN(IndexedDBContextImpl); 129 DISALLOW_COPY_AND_ASSIGN(IndexedDBContextImpl);
135 }; 130 };
136 131
137 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_IMPL_H_ 132 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698