Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ | 5 #ifndef CHROME_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ |
| 6 #define CHROME_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ | 6 #define CHROME_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 static const FilePath::CharType kIndexedDBDirectory[]; | 28 static const FilePath::CharType kIndexedDBDirectory[]; |
| 29 | 29 |
| 30 // The indexed db file extension. | 30 // The indexed db file extension. |
| 31 static const FilePath::CharType kIndexedDBExtension[]; | 31 static const FilePath::CharType kIndexedDBExtension[]; |
| 32 | 32 |
| 33 // Get the file name of the indexed db file for the given origin. | 33 // Get the file name of the indexed db file for the given origin. |
| 34 FilePath GetIndexedDBFilePath(const string16& origin_id) const; | 34 FilePath GetIndexedDBFilePath(const string16& origin_id) const; |
| 35 | 35 |
| 36 // Deletes all idb files except for those on the url scheme | 36 // Deletes all idb files except for those on the url scheme |
| 37 // |url_scheme_to_be_skipped|. | 37 // |url_scheme_to_be_skipped|. |
| 38 static void ClearLocalState(const FilePath& profile_path, | 38 static void ClearLocalState(const FilePath& indexeddb_path, |
|
pastarmovj
2010/11/27 20:45:15
I hope you will agree with this change. It allows
| |
| 39 const char* url_scheme_to_be_skipped); | 39 const char* url_scheme_to_be_skipped); |
| 40 | 40 |
| 41 void SetClearLocalStateOnExit(bool clear_local_state) { | |
| 42 clear_local_state_on_exit_ = clear_local_state; | |
| 43 } | |
|
pastarmovj
2010/11/27 20:45:15
Do I got that correctly that really simple setters
| |
| 44 | |
| 41 // Deletes a single indexed db file. | 45 // Deletes a single indexed db file. |
| 42 void DeleteIndexedDBFile(const FilePath& file_path); | 46 void DeleteIndexedDBFile(const FilePath& file_path); |
| 43 | 47 |
| 44 // Deletes all indexed db files for the given origin. | 48 // Deletes all indexed db files for the given origin. |
| 45 void DeleteIndexedDBForOrigin(const string16& origin_id); | 49 void DeleteIndexedDBForOrigin(const string16& origin_id); |
| 46 | 50 |
| 47 private: | 51 private: |
| 48 scoped_ptr<WebKit::WebIDBFactory> idb_factory_; | 52 scoped_ptr<WebKit::WebIDBFactory> idb_factory_; |
| 49 | 53 |
| 50 // We're owned by this WebKit context. | 54 // Path where the indexed db data is stored |
| 51 WebKitContext* webkit_context_; | 55 FilePath data_path_; |
|
pastarmovj
2010/11/27 20:45:15
I replaced the webkit context pointer with the pie
| |
| 56 | |
| 57 // True if the destructor should delete its files. | |
| 58 bool clear_local_state_on_exit_; | |
| 52 | 59 |
| 53 DISALLOW_COPY_AND_ASSIGN(IndexedDBContext); | 60 DISALLOW_COPY_AND_ASSIGN(IndexedDBContext); |
| 54 }; | 61 }; |
| 55 | 62 |
| 56 #endif // CHROME_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ | 63 #endif // CHROME_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ |
| OLD | NEW |