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

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

Issue 2449953008: Port messages sent by WebIDBDatabaseImpl to Mojo. (Closed)
Patch Set: Address more comments from dcheng@. Created 4 years, 1 month 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: content/child/indexed_db/webidbdatabase_impl.h
diff --git a/content/child/indexed_db/webidbdatabase_impl.h b/content/child/indexed_db/webidbdatabase_impl.h
index 386f938023a836f13c216f71af6c4e026febe296..e8a04e3e9a6392d8200c079b85e7d3f4d5b9415d 100644
--- a/content/child/indexed_db/webidbdatabase_impl.h
+++ b/content/child/indexed_db/webidbdatabase_impl.h
@@ -10,6 +10,9 @@
#include <set>
#include "base/memory/ref_counted.h"
+#include "content/common/content_export.h"
+#include "content/common/indexed_db/indexed_db.mojom.h"
+#include "content/common/indexed_db/indexed_db_constants.h"
#include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBCursor.h"
#include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBDatabase.h"
#include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h"
@@ -24,10 +27,12 @@ class WebString;
namespace content {
class ThreadSafeSender;
-class WebIDBDatabaseImpl : public blink::WebIDBDatabase {
+class CONTENT_EXPORT WebIDBDatabaseImpl
+ : public NON_EXPORTED_BASE(blink::WebIDBDatabase) {
public:
- WebIDBDatabaseImpl(int32_t ipc_database_id,
- ThreadSafeSender* thread_safe_sender);
+ WebIDBDatabaseImpl(indexed_db::mojom::DatabaseAssociatedPtrInfo database,
+ scoped_refptr<base::SingleThreadTaskRunner> io_runner,
+ scoped_refptr<ThreadSafeSender> thread_safe_sender);
~WebIDBDatabaseImpl() override;
// blink::WebIDBDatabase
@@ -123,8 +128,20 @@ class WebIDBDatabaseImpl : public blink::WebIDBDatabase {
const blink::WebVector<blink::WebString>& uuids) override;
private:
- int32_t ipc_database_id_;
+ FRIEND_TEST_ALL_PREFIXES(WebIDBDatabaseImplTest, ValueSizeTest);
+ FRIEND_TEST_ALL_PREFIXES(WebIDBDatabaseImplTest, KeyAndValueSizeTest);
+
+ class IOThreadHelper;
+
+ // Maximum size (in bytes) of value/key pair allowed for put requests. Any
+ // requests larger than this size will be rejected.
+ // Used by unit tests to exercise behavior without allocating huge chunks
+ // of memory.
+ size_t max_put_value_size_ = kMaxIDBMessageSizeInBytes;
+
+ IOThreadHelper* helper_;
std::set<int32_t> observer_ids_;
+ scoped_refptr<base::SingleThreadTaskRunner> io_runner_;
scoped_refptr<ThreadSafeSender> thread_safe_sender_;
};
« no previous file with comments | « content/child/indexed_db/indexed_db_dispatcher_unittest.cc ('k') | content/child/indexed_db/webidbdatabase_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698