Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3573)

Unified Diff: chrome/browser/browsing_data_indexed_db_helper.h

Issue 6246105: Only invoke WebKit methods in browsing data helpers on the WEBKIT thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 129987b01283947ea3aab289565304049392a851..e0f25b63ae1229b4b01df71ab740da3f785b64f2 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"
@@ -101,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();
bulach 2011/02/22 22:34:01 as above
+
+ 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);
};

Powered by Google App Engine
This is Rietveld 408576698