Index: content/browser/indexed_db/indexed_db_database.cc |
diff --git a/content/browser/indexed_db/indexed_db_database.cc b/content/browser/indexed_db/indexed_db_database.cc |
index 8628768d91f5efb93067fb2f3764af8e3290862c..31d0e69224510ec3b28d2178b911f81455e67225 100644 |
--- a/content/browser/indexed_db/indexed_db_database.cc |
+++ b/content/browser/indexed_db/indexed_db_database.cc |
@@ -132,7 +132,8 @@ scoped_refptr<IndexedDBDatabase> IndexedDBDatabase::Create( |
const Identifier& unique_identifier, |
leveldb::Status* s) { |
scoped_refptr<IndexedDBDatabase> database = |
- new IndexedDBDatabase(name, backing_store, factory, unique_identifier); |
+ IndexedDBClassFactory::Get()->CreateIndexedDBDatabase( |
+ name, backing_store, factory, unique_identifier); |
*s = database->OpenInternal(); |
if (s->ok()) |
return database; |
@@ -227,6 +228,10 @@ IndexedDBDatabase::~IndexedDBDatabase() { |
DCHECK(pending_delete_calls_.empty()); |
} |
+size_t IndexedDBDatabase::GetMaxMessageSizeInBytes() const { |
+ return kMaxIDBMessageSizeInBytes; |
+} |
+ |
scoped_ptr<IndexedDBConnection> IndexedDBDatabase::CreateConnection( |
scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks, |
int child_process_id) { |
@@ -853,9 +858,11 @@ void IndexedDBDatabase::GetAllOperation( |
response_size += return_key.size_estimate(); |
else |
response_size += return_value.SizeEstimate(); |
- if (response_size > IPC::Channel::kMaximumMessageSize) { |
- // TODO(cmumford): Reach this limit more gracefully (crbug.com/478949) |
- break; |
+ if (response_size > GetMaxMessageSizeInBytes()) { |
+ callbacks->OnError( |
+ IndexedDBDatabaseError(blink::WebIDBDatabaseExceptionUnknownError, |
+ "Maximum IPC message size exceeded.")); |
+ return; |
} |
if (cursor_type == indexed_db::CURSOR_KEY_ONLY) |