OLD | NEW |
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 #ifndef CHROME_BROWSER_BROWSING_DATA_INDEXED_DB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_INDEXED_DB_HELPER_H_ |
6 #define CHROME_BROWSER_BROWSING_DATA_INDEXED_DB_HELPER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_INDEXED_DB_HELPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 }; | 78 }; |
79 | 79 |
80 // This class is an implementation of BrowsingDataIndexedDBHelper that does | 80 // This class is an implementation of BrowsingDataIndexedDBHelper that does |
81 // not fetch its information from the indexed database tracker, but gets them | 81 // not fetch its information from the indexed database tracker, but gets them |
82 // passed as a parameter. | 82 // passed as a parameter. |
83 class CannedBrowsingDataIndexedDBHelper | 83 class CannedBrowsingDataIndexedDBHelper |
84 : public BrowsingDataIndexedDBHelper { | 84 : public BrowsingDataIndexedDBHelper { |
85 public: | 85 public: |
86 explicit CannedBrowsingDataIndexedDBHelper(Profile* profile); | 86 explicit CannedBrowsingDataIndexedDBHelper(Profile* profile); |
87 | 87 |
| 88 // Return a copy of the IndexedDB helper. Only one consumer can use the |
| 89 // StartFetching method at a time, so we need to create a copy of the helper |
| 90 // everytime we instantiate a cookies tree model for it. |
| 91 CannedBrowsingDataIndexedDBHelper* Clone(); |
| 92 |
88 // Add a indexed database to the set of canned indexed databases that is | 93 // Add a indexed database to the set of canned indexed databases that is |
89 // returned by this helper. | 94 // returned by this helper. |
90 void AddIndexedDB(const GURL& origin, | 95 void AddIndexedDB(const GURL& origin, |
91 const string16& description); | 96 const string16& description); |
92 | 97 |
93 // Clear the list of canned indexed databases. | 98 // Clear the list of canned indexed databases. |
94 void Reset(); | 99 void Reset(); |
95 | 100 |
96 // True if no indexed databases are currently stored. | 101 // True if no indexed databases are currently stored. |
97 bool empty() const; | 102 bool empty() const; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // Indicates whether or not we're currently fetching information: | 142 // Indicates whether or not we're currently fetching information: |
138 // it's true when StartFetching() is called in the UI thread, and it's reset | 143 // it's true when StartFetching() is called in the UI thread, and it's reset |
139 // after we notified the callback in the UI thread. | 144 // after we notified the callback in the UI thread. |
140 // This only mutates on the UI thread. | 145 // This only mutates on the UI thread. |
141 bool is_fetching_; | 146 bool is_fetching_; |
142 | 147 |
143 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataIndexedDBHelper); | 148 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataIndexedDBHelper); |
144 }; | 149 }; |
145 | 150 |
146 #endif // CHROME_BROWSER_BROWSING_DATA_INDEXED_DB_HELPER_H_ | 151 #endif // CHROME_BROWSER_BROWSING_DATA_INDEXED_DB_HELPER_H_ |
OLD | NEW |