| OLD | NEW |
| 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 CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_INDEXED_DB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_INDEXED_DB_HELPER_H_ |
| 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_INDEXED_DB_HELPER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_INDEXED_DB_HELPER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 // This class is an implementation of BrowsingDataIndexedDBHelper that does | 50 // This class is an implementation of BrowsingDataIndexedDBHelper that does |
| 51 // not fetch its information from the indexed database tracker, but gets them | 51 // not fetch its information from the indexed database tracker, but gets them |
| 52 // passed as a parameter. | 52 // passed as a parameter. |
| 53 class CannedBrowsingDataIndexedDBHelper | 53 class CannedBrowsingDataIndexedDBHelper |
| 54 : public BrowsingDataIndexedDBHelper { | 54 : public BrowsingDataIndexedDBHelper { |
| 55 public: | 55 public: |
| 56 // Contains information about an indexed database. | 56 // Contains information about an indexed database. |
| 57 struct PendingIndexedDBInfo { | 57 struct PendingIndexedDBInfo { |
| 58 PendingIndexedDBInfo(const GURL& origin, const string16& name); | 58 PendingIndexedDBInfo(const GURL& origin, const base::string16& name); |
| 59 ~PendingIndexedDBInfo(); | 59 ~PendingIndexedDBInfo(); |
| 60 | 60 |
| 61 bool operator<(const PendingIndexedDBInfo& other) const; | 61 bool operator<(const PendingIndexedDBInfo& other) const; |
| 62 | 62 |
| 63 GURL origin; | 63 GURL origin; |
| 64 string16 name; | 64 base::string16 name; |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 CannedBrowsingDataIndexedDBHelper(); | 67 CannedBrowsingDataIndexedDBHelper(); |
| 68 | 68 |
| 69 // Return a copy of the IndexedDB helper. Only one consumer can use the | 69 // Return a copy of the IndexedDB helper. Only one consumer can use the |
| 70 // StartFetching method at a time, so we need to create a copy of the helper | 70 // StartFetching method at a time, so we need to create a copy of the helper |
| 71 // every time we instantiate a cookies tree model for it. | 71 // every time we instantiate a cookies tree model for it. |
| 72 CannedBrowsingDataIndexedDBHelper* Clone(); | 72 CannedBrowsingDataIndexedDBHelper* Clone(); |
| 73 | 73 |
| 74 // Add a indexed database to the set of canned indexed databases that is | 74 // Add a indexed database to the set of canned indexed databases that is |
| 75 // returned by this helper. | 75 // returned by this helper. |
| 76 void AddIndexedDB(const GURL& origin, | 76 void AddIndexedDB(const GURL& origin, |
| 77 const string16& name); | 77 const base::string16& name); |
| 78 | 78 |
| 79 // Clear the list of canned indexed databases. | 79 // Clear the list of canned indexed databases. |
| 80 void Reset(); | 80 void Reset(); |
| 81 | 81 |
| 82 // True if no indexed databases are currently stored. | 82 // True if no indexed databases are currently stored. |
| 83 bool empty() const; | 83 bool empty() const; |
| 84 | 84 |
| 85 // Returns the number of currently stored indexed databases. | 85 // Returns the number of currently stored indexed databases. |
| 86 size_t GetIndexedDBCount() const; | 86 size_t GetIndexedDBCount() const; |
| 87 | 87 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 // Indicates whether or not we're currently fetching information: | 119 // Indicates whether or not we're currently fetching information: |
| 120 // it's true when StartFetching() is called in the UI thread, and it's reset | 120 // it's true when StartFetching() is called in the UI thread, and it's reset |
| 121 // after we notified the callback in the UI thread. | 121 // after we notified the callback in the UI thread. |
| 122 // This only mutates on the UI thread. | 122 // This only mutates on the UI thread. |
| 123 bool is_fetching_; | 123 bool is_fetching_; |
| 124 | 124 |
| 125 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataIndexedDBHelper); | 125 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataIndexedDBHelper); |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_INDEXED_DB_HELPER_H_ | 128 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_INDEXED_DB_HELPER_H_ |
| OLD | NEW |