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

Unified Diff: content/browser/indexed_db/indexed_db_cursor.cc

Issue 18023022: Blob support for IDB [Chromium] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use ScopedVector and stl_utils for BlobDataHandles. Created 7 years 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/browser/indexed_db/indexed_db_cursor.cc
diff --git a/content/browser/indexed_db/indexed_db_cursor.cc b/content/browser/indexed_db/indexed_db_cursor.cc
index 5daf16d39dba037ad26fa7dc4c48c4f75b0a1864..b75d049597695f0ebab7d426f5c83cb4ba97de6a 100644
--- a/content/browser/indexed_db/indexed_db_cursor.cc
+++ b/content/browser/indexed_db/indexed_db_cursor.cc
@@ -10,6 +10,7 @@
#include "content/browser/indexed_db/indexed_db_database_error.h"
#include "content/browser/indexed_db/indexed_db_tracing.h"
#include "content/browser/indexed_db/indexed_db_transaction.h"
+#include "content/browser/indexed_db/indexed_db_value.h"
namespace content {
@@ -61,7 +62,7 @@ void IndexedDBCursor::CursorAdvanceOperation(
IDB_TRACE("IndexedDBCursor::CursorAdvanceOperation");
if (!cursor_ || !cursor_->Advance(count)) {
cursor_.reset();
- callbacks->OnSuccess(static_cast<std::string*>(NULL));
+ callbacks->OnSuccess(static_cast<IndexedDBValue*>(NULL));
return;
}
@@ -78,7 +79,7 @@ void IndexedDBCursor::CursorIterationOperation(
!cursor_->Continue(
key.get(), primary_key.get(), IndexedDBBackingStore::Cursor::SEEK)) {
cursor_.reset();
- callbacks->OnSuccess(static_cast<std::string*>(NULL));
+ callbacks->OnSuccess(static_cast<IndexedDBValue*>(NULL));
return;
}
@@ -106,7 +107,7 @@ void IndexedDBCursor::CursorPrefetchIterationOperation(
std::vector<IndexedDBKey> found_keys;
std::vector<IndexedDBKey> found_primary_keys;
- std::vector<std::string> found_values;
+ std::vector<IndexedDBValue> found_values;
if (cursor_)
saved_cursor_.reset(cursor_->Clone());
@@ -124,12 +125,12 @@ void IndexedDBCursor::CursorPrefetchIterationOperation(
switch (cursor_type_) {
case indexed_db::CURSOR_KEY_ONLY:
- found_values.push_back(std::string());
+ found_values.push_back(IndexedDBValue());
break;
case indexed_db::CURSOR_KEY_AND_VALUE: {
- std::string value;
+ IndexedDBValue value;
value.swap(*cursor_->Value());
- size_estimate += value.size();
+ size_estimate += value.bits.size();
jsbell 2013/12/18 23:04:40 We should include an estimate for the blob metadat
ericu 2013/12/19 05:19:11 Something like this? IndexedDBValue::SizeEstimate
found_values.push_back(value);
break;
}
@@ -144,7 +145,7 @@ void IndexedDBCursor::CursorPrefetchIterationOperation(
}
if (!found_keys.size()) {
- callbacks->OnSuccess(static_cast<std::string*>(NULL));
+ callbacks->OnSuccess(static_cast<IndexedDBValue*>(NULL));
return;
}

Powered by Google App Engine
This is Rietveld 408576698