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

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

Issue 197753011: Add IndexedDBValue wrapper class to group blob info with bits. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Yet still happier clang, I hope. Created 6 years, 9 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 | « content/browser/indexed_db/indexed_db_cursor.h ('k') | content/browser/indexed_db/indexed_db_database.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0853b810f285e20279f88a58764a037a4db1d903..b32c7c2a0f14d2e848ac66591bb6f7b0e45f0160 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;
saved_cursor_.reset();
const size_t max_size_estimate = 10 * 1024 * 1024;
@@ -129,12 +130,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.SizeEstimate();
found_values.push_back(value);
break;
}
@@ -149,7 +150,7 @@ void IndexedDBCursor::CursorPrefetchIterationOperation(
}
if (!found_keys.size()) {
- callbacks->OnSuccess(static_cast<std::string*>(NULL));
+ callbacks->OnSuccess(static_cast<IndexedDBValue*>(NULL));
return;
}
« no previous file with comments | « content/browser/indexed_db/indexed_db_cursor.h ('k') | content/browser/indexed_db/indexed_db_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698