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

Unified Diff: content/child/indexed_db/indexed_db_dispatcher.h

Issue 17955002: Fix IndexedDB after r208777. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix unittests Created 7 years, 6 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
« no previous file with comments | « no previous file | content/child/indexed_db/indexed_db_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/indexed_db/indexed_db_dispatcher.h
===================================================================
--- content/child/indexed_db/indexed_db_dispatcher.h (revision 208777)
+++ content/child/indexed_db/indexed_db_dispatcher.h (working copy)
@@ -10,6 +10,7 @@
#include "base/gtest_prod_util.h"
#include "base/id_map.h"
+#include "base/memory/ref_counted.h"
#include "base/strings/nullable_string16.h"
#include "content/common/content_export.h"
#include "ipc/ipc_sync_message_filter.h"
@@ -35,6 +36,7 @@
class IndexedDBKeyRange;
class RendererWebIDBCursorImpl;
class RendererWebIDBDatabaseImpl;
+class ThreadSafeSender;
CONTENT_EXPORT extern const size_t kMaxIDBValueSizeInBytes;
@@ -47,10 +49,14 @@
// failing a NOTREACHED in ThreadSpecificInstance in tests that instantiate
// two copies of RenderThreadImpl on the same thread. Everyone else probably
// wants to use ThreadSpecificInstance().
- IndexedDBDispatcher();
+ explicit IndexedDBDispatcher(ThreadSafeSender* thread_safe_sender);
virtual ~IndexedDBDispatcher();
- static IndexedDBDispatcher* ThreadSpecificInstance();
+ // |thread_safe_sender| needs to be passed in because if the call leads to
+ // construction it will be needed.
+ static IndexedDBDispatcher* ThreadSpecificInstance(
+ ThreadSafeSender* thread_safe_sender);
+
// webkit_glue::WorkerTaskRunner::Observer implementation.
virtual void OnWorkerRunLoopStopped() OVERRIDE;
@@ -58,7 +64,7 @@
const IndexedDBDatabaseMetadata& idb_metadata);
void OnMessageReceived(const IPC::Message& msg);
- static bool Send(IPC::Message* msg);
+ bool Send(IPC::Message* msg);
void RequestIDBFactoryGetDatabaseNames(
WebKit::WebIDBCallbacks* callbacks,
@@ -223,6 +229,8 @@
// Reset cursor prefetch caches for all cursors except exception_cursor_id.
void ResetCursorPrefetchCaches(int32 ipc_exception_cursor_id = -1);
+ scoped_refptr<ThreadSafeSender> thread_safe_sender_;
+
// Careful! WebIDBCallbacks wraps non-threadsafe data types. It must be
// destroyed and used on the same thread it was created on.
IDMap<WebKit::WebIDBCallbacks, IDMapOwnPointer> pending_callbacks_;
« no previous file with comments | « no previous file | content/child/indexed_db/indexed_db_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698