Index: chrome/browser/browsing_data_indexed_db_helper.h |
diff --git a/chrome/browser/browsing_data_indexed_db_helper.h b/chrome/browser/browsing_data_indexed_db_helper.h |
index 6be7bbeedd927357bce71adac434d0b662b8c0e5..dad187b1260699ef524a5d323f9b2631fb943e78 100644 |
--- a/chrome/browser/browsing_data_indexed_db_helper.h |
+++ b/chrome/browser/browsing_data_indexed_db_helper.h |
@@ -7,6 +7,7 @@ |
#pragma once |
#include <list> |
+#include <set> |
#include <string> |
#include "base/callback.h" |
@@ -16,7 +17,6 @@ |
#include "base/memory/scoped_ptr.h" |
#include "base/synchronization/lock.h" |
#include "base/time.h" |
-#include "chrome/common/url_constants.h" |
#include "googleurl/src/gurl.h" |
class Profile; |
@@ -66,6 +66,17 @@ class BrowsingDataIndexedDBHelper |
class CannedBrowsingDataIndexedDBHelper |
: public BrowsingDataIndexedDBHelper { |
public: |
+ // Contains information about an indexed database. |
+ struct PendingIndexedDBInfo { |
+ PendingIndexedDBInfo(const GURL& origin, const string16& name); |
+ ~PendingIndexedDBInfo(); |
+ |
+ bool operator<(const PendingIndexedDBInfo& other) const; |
+ |
+ GURL origin; |
+ string16 name; |
+ }; |
+ |
CannedBrowsingDataIndexedDBHelper(); |
// Return a copy of the IndexedDB helper. Only one consumer can use the |
@@ -76,7 +87,7 @@ class CannedBrowsingDataIndexedDBHelper |
// Add a indexed database to the set of canned indexed databases that is |
// returned by this helper. |
void AddIndexedDB(const GURL& origin, |
- const string16& description); |
+ const string16& name); |
// Clear the list of canned indexed databases. |
void Reset(); |
@@ -87,22 +98,18 @@ class CannedBrowsingDataIndexedDBHelper |
// Returns the number of currently stored indexed databases. |
size_t GetIndexedDBCount() const; |
+ // Returns the current list of indexed data bases. |
+ const std::set<CannedBrowsingDataIndexedDBHelper::PendingIndexedDBInfo>& |
+ GetIndexedDBInfo() const; |
+ |
// BrowsingDataIndexedDBHelper methods. |
virtual void StartFetching( |
const base::Callback<void(const std::list<IndexedDBInfo>&)>& |
callback) OVERRIDE; |
+ |
virtual void DeleteIndexedDB(const GURL& origin) OVERRIDE {} |
private: |
- struct PendingIndexedDBInfo { |
- PendingIndexedDBInfo(); |
- PendingIndexedDBInfo(const GURL& origin, const string16& description); |
- ~PendingIndexedDBInfo(); |
- |
- GURL origin; |
- string16 description; |
- }; |
- |
virtual ~CannedBrowsingDataIndexedDBHelper(); |
// Convert the pending indexed db info to indexed db info objects. |
@@ -113,10 +120,10 @@ class CannedBrowsingDataIndexedDBHelper |
// Lock to protect access to pending_indexed_db_info_; |
mutable base::Lock lock_; |
- // This may mutate on WEBKIT and UI threads. |
- std::list<PendingIndexedDBInfo> pending_indexed_db_info_; |
+ // This only mutates on the UI thread. But it is read on the Webkit thread. |
+ std::set<PendingIndexedDBInfo> pending_indexed_db_info_; |
- // This only mutates on the WEBKIT thread. |
+ // This only mutates on the UI thread. |
std::list<IndexedDBInfo> indexed_db_info_; |
// This only mutates on the UI thread. |