summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browsing_data_indexed_db_helper.h
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2011-05-31 20:30:28 +0100
committerKristian Monsen <kristianm@google.com>2011-06-14 20:31:41 -0700
commit72a454cd3513ac24fbdd0e0cb9ad70b86a99b801 (patch)
tree382278a54ce7a744d62fa510a9a80688cc12434b /chrome/browser/browsing_data_indexed_db_helper.h
parentc4becdd46e31d261b930e4b5a539cbc1d45c23a6 (diff)
downloadexternal_chromium-72a454cd3513ac24fbdd0e0cb9ad70b86a99b801.zip
external_chromium-72a454cd3513ac24fbdd0e0cb9ad70b86a99b801.tar.gz
external_chromium-72a454cd3513ac24fbdd0e0cb9ad70b86a99b801.tar.bz2
Merge Chromium.org at r11.0.672.0: Initial merge by git.
Change-Id: I8b4aaf611a2a405fe3fe10e8a94ea7658645c192
Diffstat (limited to 'chrome/browser/browsing_data_indexed_db_helper.h')
-rw-r--r--chrome/browser/browsing_data_indexed_db_helper.h47
1 files changed, 36 insertions, 11 deletions
diff --git a/chrome/browser/browsing_data_indexed_db_helper.h b/chrome/browser/browsing_data_indexed_db_helper.h
index 932c00b..e0f25b6 100644
--- a/chrome/browser/browsing_data_indexed_db_helper.h
+++ b/chrome/browser/browsing_data_indexed_db_helper.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -12,6 +12,8 @@
#include "base/callback.h"
#include "base/file_path.h"
#include "base/ref_counted.h"
+#include "base/scoped_ptr.h"
+#include "base/synchronization/lock.h"
#include "base/time.h"
#include "chrome/common/url_constants.h"
#include "googleurl/src/gurl.h"
@@ -37,16 +39,8 @@ class BrowsingDataIndexedDBHelper
const std::string& origin,
const FilePath& file_path,
int64 size,
- base::Time last_modified)
- : protocol(protocol),
- host(host),
- port(port),
- database_identifier(database_identifier),
- origin(origin),
- file_path(file_path),
- size(size),
- last_modified(last_modified) {
- }
+ base::Time last_modified);
+ ~IndexedDBInfo();
bool IsFileSchemeData() {
return protocol == chrome::kFileScheme;
@@ -109,12 +103,43 @@ class CannedBrowsingDataIndexedDBHelper
virtual void DeleteIndexedDBFile(const FilePath& file_path) {}
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.
+ void ConvertPendingInfoInWebKitThread();
+
+ void NotifyInUIThread();
+
Profile* profile_;
+ // Lock to protect access to pending_indexed_db_info_;
+ mutable base::Lock lock_;
+
+ // This may mutate on WEBKIT and UI threads.
+ std::vector<PendingIndexedDBInfo> pending_indexed_db_info_;
+
+ // This only mutates on the WEBKIT thread.
std::vector<IndexedDBInfo> indexed_db_info_;
+ // This only mutates on the UI thread.
+ scoped_ptr<Callback1<const std::vector<IndexedDBInfo>& >::Type >
+ completion_callback_;
+
+ // Indicates whether or not we're currently fetching information:
+ // it's true when StartFetching() is called in the UI thread, and it's reset
+ // after we notified the callback in the UI thread.
+ // This only mutates on the UI thread.
+ bool is_fetching_;
+
DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataIndexedDBHelper);
};