Commit f3c1e7f6 authored by jsbell@chromium.org's avatar jsbell@chromium.org

IndexedDB: Fix coding style issues c/o cpplint.py

Most of these are non-const refs that should be pointers.

BUG=381456
TBR=dgrogan@chromium.org

Review URL: https://codereview.chromium.org/405433007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284179 0039d316-1c4b-4281-b951-d872f2087c98
parent 0260b7a9
...@@ -865,7 +865,7 @@ leveldb::Status IndexedDBBackingStore::DestroyBackingStore( ...@@ -865,7 +865,7 @@ leveldb::Status IndexedDBBackingStore::DestroyBackingStore(
bool IndexedDBBackingStore::ReadCorruptionInfo(const base::FilePath& path_base, bool IndexedDBBackingStore::ReadCorruptionInfo(const base::FilePath& path_base,
const GURL& origin_url, const GURL& origin_url,
std::string& message) { std::string* message) {
const base::FilePath info_path = const base::FilePath info_path =
path_base.Append(ComputeCorruptionFileName(origin_url)); path_base.Append(ComputeCorruptionFileName(origin_url));
...@@ -892,7 +892,7 @@ bool IndexedDBBackingStore::ReadCorruptionInfo(const base::FilePath& path_base, ...@@ -892,7 +892,7 @@ bool IndexedDBBackingStore::ReadCorruptionInfo(const base::FilePath& path_base,
if (val && val->GetType() == base::Value::TYPE_DICTIONARY) { if (val && val->GetType() == base::Value::TYPE_DICTIONARY) {
base::DictionaryValue* dict_val = base::DictionaryValue* dict_val =
static_cast<base::DictionaryValue*>(val.get()); static_cast<base::DictionaryValue*>(val.get());
success = dict_val->GetString("message", &message); success = dict_val->GetString("message", message);
} }
} }
file.Close(); file.Close();
...@@ -991,7 +991,7 @@ scoped_refptr<IndexedDBBackingStore> IndexedDBBackingStore::Open( ...@@ -991,7 +991,7 @@ scoped_refptr<IndexedDBBackingStore> IndexedDBBackingStore::Open(
bool is_schema_known = false; bool is_schema_known = false;
if (db) { if (db) {
std::string corruption_message; std::string corruption_message;
if (ReadCorruptionInfo(path_base, origin_url, corruption_message)) { if (ReadCorruptionInfo(path_base, origin_url, &corruption_message)) {
LOG(ERROR) << "IndexedDB recovering from a corrupted (and deleted) " LOG(ERROR) << "IndexedDB recovering from a corrupted (and deleted) "
"database."; "database.";
HistogramOpenStatus(INDEXED_DB_BACKING_STORE_OPEN_FAILED_PRIOR_CORRUPTION, HistogramOpenStatus(INDEXED_DB_BACKING_STORE_OPEN_FAILED_PRIOR_CORRUPTION,
...@@ -1874,7 +1874,7 @@ leveldb::Status IndexedDBBackingStore::PutRecord( ...@@ -1874,7 +1874,7 @@ leveldb::Status IndexedDBBackingStore::PutRecord(
int64 database_id, int64 database_id,
int64 object_store_id, int64 object_store_id,
const IndexedDBKey& key, const IndexedDBKey& key,
IndexedDBValue& value, IndexedDBValue* value,
ScopedVector<webkit_blob::BlobDataHandle>* handles, ScopedVector<webkit_blob::BlobDataHandle>* handles,
RecordIdentifier* record_identifier) { RecordIdentifier* record_identifier) {
IDB_TRACE("IndexedDBBackingStore::PutRecord"); IDB_TRACE("IndexedDBBackingStore::PutRecord");
...@@ -1894,13 +1894,13 @@ leveldb::Status IndexedDBBackingStore::PutRecord( ...@@ -1894,13 +1894,13 @@ leveldb::Status IndexedDBBackingStore::PutRecord(
std::string v; std::string v;
EncodeVarInt(version, &v); EncodeVarInt(version, &v);
v.append(value.bits); v.append(value->bits);
leveldb_transaction->Put(object_store_data_key, &v); leveldb_transaction->Put(object_store_data_key, &v);
s = transaction->PutBlobInfoIfNeeded(database_id, s = transaction->PutBlobInfoIfNeeded(database_id,
object_store_id, object_store_id,
object_store_data_key, object_store_data_key,
&value.blob_info, &value->blob_info,
handles); handles);
if (!s.ok()) if (!s.ok())
return s; return s;
...@@ -2174,14 +2174,14 @@ class IndexedDBBackingStore::Transaction::ChainedBlobWriterImpl ...@@ -2174,14 +2174,14 @@ class IndexedDBBackingStore::Transaction::ChainedBlobWriterImpl
ChainedBlobWriterImpl( ChainedBlobWriterImpl(
int64 database_id, int64 database_id,
IndexedDBBackingStore* backing_store, IndexedDBBackingStore* backing_store,
WriteDescriptorVec& blobs, WriteDescriptorVec* blobs,
scoped_refptr<IndexedDBBackingStore::BlobWriteCallback> callback) scoped_refptr<IndexedDBBackingStore::BlobWriteCallback> callback)
: waiting_for_callback_(false), : waiting_for_callback_(false),
database_id_(database_id), database_id_(database_id),
backing_store_(backing_store), backing_store_(backing_store),
callback_(callback), callback_(callback),
aborted_(false) { aborted_(false) {
blobs_.swap(blobs); blobs_.swap(*blobs);
iter_ = blobs_.begin(); iter_ = blobs_.begin();
backing_store->task_runner()->PostTask( backing_store->task_runner()->PostTask(
FROM_HERE, base::Bind(&ChainedBlobWriterImpl::WriteNextFile, this)); FROM_HERE, base::Bind(&ChainedBlobWriterImpl::WriteNextFile, this));
...@@ -2810,21 +2810,21 @@ leveldb::Status IndexedDBBackingStore::PutIndexDataForRecord( ...@@ -2810,21 +2810,21 @@ leveldb::Status IndexedDBBackingStore::PutIndexDataForRecord(
static bool FindGreatestKeyLessThanOrEqual(LevelDBTransaction* transaction, static bool FindGreatestKeyLessThanOrEqual(LevelDBTransaction* transaction,
const std::string& target, const std::string& target,
std::string* found_key, std::string* found_key,
leveldb::Status& s) { leveldb::Status* s) {
scoped_ptr<LevelDBIterator> it = transaction->CreateIterator(); scoped_ptr<LevelDBIterator> it = transaction->CreateIterator();
s = it->Seek(target); *s = it->Seek(target);
if (!s.ok()) if (!s->ok())
return false; return false;
if (!it->IsValid()) { if (!it->IsValid()) {
s = it->SeekToLast(); *s = it->SeekToLast();
if (!s.ok() || !it->IsValid()) if (!s->ok() || !it->IsValid())
return false; return false;
} }
while (CompareIndexKeys(it->Key(), target) > 0) { while (CompareIndexKeys(it->Key(), target) > 0) {
s = it->Prev(); *s = it->Prev();
if (!s.ok() || !it->IsValid()) if (!s->ok() || !it->IsValid())
return false; return false;
} }
...@@ -2832,8 +2832,8 @@ static bool FindGreatestKeyLessThanOrEqual(LevelDBTransaction* transaction, ...@@ -2832,8 +2832,8 @@ static bool FindGreatestKeyLessThanOrEqual(LevelDBTransaction* transaction,
*found_key = it->Key().as_string(); *found_key = it->Key().as_string();
// There can be several index keys that compare equal. We want the last one. // There can be several index keys that compare equal. We want the last one.
s = it->Next(); *s = it->Next();
} while (s.ok() && it->IsValid() && !CompareIndexKeys(it->Key(), target)); } while (s->ok() && it->IsValid() && !CompareIndexKeys(it->Key(), target));
return true; return true;
} }
...@@ -3627,7 +3627,7 @@ bool ObjectStoreCursorOptions( ...@@ -3627,7 +3627,7 @@ bool ObjectStoreCursorOptions(
if (!FindGreatestKeyLessThanOrEqual(transaction, if (!FindGreatestKeyLessThanOrEqual(transaction,
cursor_options->high_key, cursor_options->high_key,
&cursor_options->high_key, &cursor_options->high_key,
s)) &s))
return false; return false;
cursor_options->high_open = false; cursor_options->high_open = false;
} }
...@@ -3641,7 +3641,7 @@ bool ObjectStoreCursorOptions( ...@@ -3641,7 +3641,7 @@ bool ObjectStoreCursorOptions(
std::string found_high_key; std::string found_high_key;
// TODO(cmumford): Handle this error (crbug.com/363397) // TODO(cmumford): Handle this error (crbug.com/363397)
if (!FindGreatestKeyLessThanOrEqual( if (!FindGreatestKeyLessThanOrEqual(
transaction, cursor_options->high_key, &found_high_key, s)) transaction, cursor_options->high_key, &found_high_key, &s))
return false; return false;
// If the target key should not be included, but we end up with a smaller // If the target key should not be included, but we end up with a smaller
...@@ -3703,7 +3703,7 @@ bool IndexCursorOptions( ...@@ -3703,7 +3703,7 @@ bool IndexCursorOptions(
if (!FindGreatestKeyLessThanOrEqual(transaction, if (!FindGreatestKeyLessThanOrEqual(transaction,
cursor_options->high_key, cursor_options->high_key,
&cursor_options->high_key, &cursor_options->high_key,
s)) &s))
return false; return false;
cursor_options->high_open = false; cursor_options->high_open = false;
} }
...@@ -3716,7 +3716,7 @@ bool IndexCursorOptions( ...@@ -3716,7 +3716,7 @@ bool IndexCursorOptions(
// Seek to the *last* key in the set of non-unique keys // Seek to the *last* key in the set of non-unique keys
// TODO(cmumford): Handle this error (crbug.com/363397) // TODO(cmumford): Handle this error (crbug.com/363397)
if (!FindGreatestKeyLessThanOrEqual( if (!FindGreatestKeyLessThanOrEqual(
transaction, cursor_options->high_key, &found_high_key, s)) transaction, cursor_options->high_key, &found_high_key, &s))
return false; return false;
// If the target key should not be included, but we end up with a smaller // If the target key should not be included, but we end up with a smaller
...@@ -4040,7 +4040,7 @@ leveldb::Status IndexedDBBackingStore::Transaction::CommitPhaseOne( ...@@ -4040,7 +4040,7 @@ leveldb::Status IndexedDBBackingStore::Transaction::CommitPhaseOne(
if (new_files_to_write.size()) { if (new_files_to_write.size()) {
// This kicks off the writes of the new blobs, if any. // This kicks off the writes of the new blobs, if any.
// This call will zero out new_blob_entries and new_files_to_write. // This call will zero out new_blob_entries and new_files_to_write.
WriteNewBlobs(new_blob_entries, new_files_to_write, callback); WriteNewBlobs(&new_blob_entries, &new_files_to_write, callback);
// Remove the add journal, if any; once the blobs are written, and we // Remove the add journal, if any; once the blobs are written, and we
// commit, this will do the cleanup. // commit, this will do the cleanup.
ClearBlobJournal(transaction_.get(), BlobJournalKey::Encode()); ClearBlobJournal(transaction_.get(), BlobJournalKey::Encode());
...@@ -4114,14 +4114,14 @@ class IndexedDBBackingStore::Transaction::BlobWriteCallbackWrapper ...@@ -4114,14 +4114,14 @@ class IndexedDBBackingStore::Transaction::BlobWriteCallbackWrapper
}; };
void IndexedDBBackingStore::Transaction::WriteNewBlobs( void IndexedDBBackingStore::Transaction::WriteNewBlobs(
BlobEntryKeyValuePairVec& new_blob_entries, BlobEntryKeyValuePairVec* new_blob_entries,
WriteDescriptorVec& new_files_to_write, WriteDescriptorVec* new_files_to_write,
scoped_refptr<BlobWriteCallback> callback) { scoped_refptr<BlobWriteCallback> callback) {
DCHECK_GT(new_files_to_write.size(), 0UL); DCHECK_GT(new_files_to_write->size(), 0UL);
DCHECK_GT(database_id_, 0); DCHECK_GT(database_id_, 0);
BlobEntryKeyValuePairVec::iterator blob_entry_iter; BlobEntryKeyValuePairVec::iterator blob_entry_iter;
for (blob_entry_iter = new_blob_entries.begin(); for (blob_entry_iter = new_blob_entries->begin();
blob_entry_iter != new_blob_entries.end(); blob_entry_iter != new_blob_entries->end();
++blob_entry_iter) { ++blob_entry_iter) {
// Add the new blob-table entry for each blob to the main transaction, or // Add the new blob-table entry for each blob to the main transaction, or
// remove any entry that may exist if there's no new one. // remove any entry that may exist if there's no new one.
......
...@@ -190,7 +190,7 @@ class CONTENT_EXPORT IndexedDBBackingStore ...@@ -190,7 +190,7 @@ class CONTENT_EXPORT IndexedDBBackingStore
int64 database_id, int64 database_id,
int64 object_store_id, int64 object_store_id,
const IndexedDBKey& key, const IndexedDBKey& key,
IndexedDBValue& value, IndexedDBValue* value,
ScopedVector<webkit_blob::BlobDataHandle>* handles, ScopedVector<webkit_blob::BlobDataHandle>* handles,
RecordIdentifier* record) WARN_UNUSED_RESULT; RecordIdentifier* record) WARN_UNUSED_RESULT;
virtual leveldb::Status ClearObjectStore( virtual leveldb::Status ClearObjectStore(
...@@ -488,8 +488,8 @@ class CONTENT_EXPORT IndexedDBBackingStore ...@@ -488,8 +488,8 @@ class CONTENT_EXPORT IndexedDBBackingStore
// Returns true on success, false on failure. // Returns true on success, false on failure.
bool CollectBlobFilesToRemove(); bool CollectBlobFilesToRemove();
// The callback will be called eventually on success or failure. // The callback will be called eventually on success or failure.
void WriteNewBlobs(BlobEntryKeyValuePairVec& new_blob_entries, void WriteNewBlobs(BlobEntryKeyValuePairVec* new_blob_entries,
WriteDescriptorVec& new_files_to_write, WriteDescriptorVec* new_files_to_write,
scoped_refptr<BlobWriteCallback> callback); scoped_refptr<BlobWriteCallback> callback);
leveldb::Status SortBlobsToRemove(); leveldb::Status SortBlobsToRemove();
...@@ -538,7 +538,7 @@ class CONTENT_EXPORT IndexedDBBackingStore ...@@ -538,7 +538,7 @@ class CONTENT_EXPORT IndexedDBBackingStore
static bool ReadCorruptionInfo(const base::FilePath& path_base, static bool ReadCorruptionInfo(const base::FilePath& path_base,
const GURL& origin_url, const GURL& origin_url,
std::string& message); std::string* message);
leveldb::Status FindKeyInIndex( leveldb::Status FindKeyInIndex(
IndexedDBBackingStore::Transaction* transaction, IndexedDBBackingStore::Transaction* transaction,
......
...@@ -374,7 +374,7 @@ TEST_F(IndexedDBBackingStoreTest, PutGetConsistency) { ...@@ -374,7 +374,7 @@ TEST_F(IndexedDBBackingStoreTest, PutGetConsistency) {
ScopedVector<webkit_blob::BlobDataHandle> handles; ScopedVector<webkit_blob::BlobDataHandle> handles;
IndexedDBBackingStore::RecordIdentifier record; IndexedDBBackingStore::RecordIdentifier record;
leveldb::Status s = backing_store_->PutRecord( leveldb::Status s = backing_store_->PutRecord(
&transaction1, 1, 1, m_key1, m_value1, &handles, &record); &transaction1, 1, 1, m_key1, &m_value1, &handles, &record);
EXPECT_TRUE(s.ok()); EXPECT_TRUE(s.ok());
scoped_refptr<TestCallback> callback(new TestCallback()); scoped_refptr<TestCallback> callback(new TestCallback());
EXPECT_TRUE(transaction1.CommitPhaseOne(callback).ok()); EXPECT_TRUE(transaction1.CommitPhaseOne(callback).ok());
...@@ -409,7 +409,7 @@ TEST_F(IndexedDBBackingStoreTest, PutGetConsistencyWithBlobs) { ...@@ -409,7 +409,7 @@ TEST_F(IndexedDBBackingStoreTest, PutGetConsistencyWithBlobs) {
1, 1,
1, 1,
m_key3, m_key3,
m_value3, &m_value3,
&handles, &handles,
&record).ok()); &record).ok());
scoped_refptr<TestCallback> callback(new TestCallback()); scoped_refptr<TestCallback> callback(new TestCallback());
...@@ -494,28 +494,28 @@ TEST_F(IndexedDBBackingStoreTest, DeleteRange) { ...@@ -494,28 +494,28 @@ TEST_F(IndexedDBBackingStoreTest, DeleteRange) {
1, 1,
i + 1, i + 1,
key0, key0,
value0, &value0,
&handles, &handles,
&record).ok()); &record).ok());
EXPECT_TRUE(backing_store_->PutRecord(&transaction1, EXPECT_TRUE(backing_store_->PutRecord(&transaction1,
1, 1,
i + 1, i + 1,
key1, key1,
value1, &value1,
&handles, &handles,
&record).ok()); &record).ok());
EXPECT_TRUE(backing_store_->PutRecord(&transaction1, EXPECT_TRUE(backing_store_->PutRecord(&transaction1,
1, 1,
i + 1, i + 1,
key2, key2,
value2, &value2,
&handles, &handles,
&record).ok()); &record).ok());
EXPECT_TRUE(backing_store_->PutRecord(&transaction1, EXPECT_TRUE(backing_store_->PutRecord(&transaction1,
1, 1,
i + 1, i + 1,
key3, key3,
value3, &value3,
&handles, &handles,
&record).ok()); &record).ok());
scoped_refptr<TestCallback> callback(new TestCallback()); scoped_refptr<TestCallback> callback(new TestCallback());
...@@ -584,28 +584,28 @@ TEST_F(IndexedDBBackingStoreTest, DeleteRangeEmptyRange) { ...@@ -584,28 +584,28 @@ TEST_F(IndexedDBBackingStoreTest, DeleteRangeEmptyRange) {
1, 1,
i + 1, i + 1,
key0, key0,
value0, &value0,
&handles, &handles,
&record).ok()); &record).ok());
EXPECT_TRUE(backing_store_->PutRecord(&transaction1, EXPECT_TRUE(backing_store_->PutRecord(&transaction1,
1, 1,
i + 1, i + 1,
key1, key1,
value1, &value1,
&handles, &handles,
&record).ok()); &record).ok());
EXPECT_TRUE(backing_store_->PutRecord(&transaction1, EXPECT_TRUE(backing_store_->PutRecord(&transaction1,
1, 1,
i + 1, i + 1,
key2, key2,
value2, &value2,
&handles, &handles,
&record).ok()); &record).ok());
EXPECT_TRUE(backing_store_->PutRecord(&transaction1, EXPECT_TRUE(backing_store_->PutRecord(&transaction1,
1, 1,
i + 1, i + 1,
key3, key3,
value3, &value3,
&handles, &handles,
&record).ok()); &record).ok());
scoped_refptr<TestCallback> callback(new TestCallback()); scoped_refptr<TestCallback> callback(new TestCallback());
...@@ -643,7 +643,7 @@ TEST_F(IndexedDBBackingStoreTest, LiveBlobJournal) { ...@@ -643,7 +643,7 @@ TEST_F(IndexedDBBackingStoreTest, LiveBlobJournal) {
1, 1,
1, 1,
m_key3, m_key3,
m_value3, &m_value3,
&handles, &handles,
&record).ok()); &record).ok());
scoped_refptr<TestCallback> callback(new TestCallback()); scoped_refptr<TestCallback> callback(new TestCallback());
...@@ -722,7 +722,7 @@ TEST_F(IndexedDBBackingStoreTest, HighIds) { ...@@ -722,7 +722,7 @@ TEST_F(IndexedDBBackingStoreTest, HighIds) {
high_database_id, high_database_id,
high_object_store_id, high_object_store_id,
m_key1, m_key1,
m_value1, &m_value1,
&handles, &handles,
&record); &record);
EXPECT_TRUE(s.ok()); EXPECT_TRUE(s.ok());
...@@ -811,23 +811,23 @@ TEST_F(IndexedDBBackingStoreTest, InvalidIds) { ...@@ -811,23 +811,23 @@ TEST_F(IndexedDBBackingStoreTest, InvalidIds) {
database_id, database_id,
KeyPrefix::kInvalidId, KeyPrefix::kInvalidId,
m_key1, m_key1,
m_value1, &m_value1,
&handles, &handles,
&record); &record);
EXPECT_FALSE(s.ok()); EXPECT_FALSE(s.ok());
s = backing_store_->PutRecord( s = backing_store_->PutRecord(
&transaction1, database_id, 0, m_key1, m_value1, &handles, &record); &transaction1, database_id, 0, m_key1, &m_value1, &handles, &record);
EXPECT_FALSE(s.ok()); EXPECT_FALSE(s.ok());
s = backing_store_->PutRecord(&transaction1, s = backing_store_->PutRecord(&transaction1,
KeyPrefix::kInvalidId, KeyPrefix::kInvalidId,
object_store_id, object_store_id,
m_key1, m_key1,
m_value1, &m_value1,
&handles, &handles,
&record); &record);
EXPECT_FALSE(s.ok()); EXPECT_FALSE(s.ok());
s = backing_store_->PutRecord( s = backing_store_->PutRecord(
&transaction1, 0, object_store_id, m_key1, m_value1, &handles, &record); &transaction1, 0, object_store_id, m_key1, &m_value1, &handles, &record);
EXPECT_FALSE(s.ok()); EXPECT_FALSE(s.ok());
s = backing_store_->GetRecord( s = backing_store_->GetRecord(
......
...@@ -548,9 +548,8 @@ static scoped_ptr<net::test_server::HttpResponse> CorruptDBRequestHandler( ...@@ -548,9 +548,8 @@ static scoped_ptr<net::test_server::HttpResponse> CorruptDBRequestHandler(
failure_method = FAIL_METHOD_GET; failure_method = FAIL_METHOD_GET;
else if (fail_method == "Commit") else if (fail_method == "Commit")
failure_method = FAIL_METHOD_COMMIT; failure_method = FAIL_METHOD_COMMIT;
else { else
NOTREACHED() << "Unknown method: \"" << fail_method << "\""; NOTREACHED() << "Unknown method: \"" << fail_method << "\"";
}
} else if (fail_class == "LevelDBIterator") { } else if (fail_class == "LevelDBIterator") {
failure_class = FAIL_CLASS_LEVELDB_ITERATOR; failure_class = FAIL_CLASS_LEVELDB_ITERATOR;
if (fail_method == "Seek") if (fail_method == "Seek")
......
...@@ -201,7 +201,7 @@ static std::string CreateBlobData( ...@@ -201,7 +201,7 @@ static std::string CreateBlobData(
// We're sending back a live blob, not a reference into our backing store. // We're sending back a live blob, not a reference into our backing store.
scoped_ptr<webkit_blob::BlobDataHandle> blob_data_handle( scoped_ptr<webkit_blob::BlobDataHandle> blob_data_handle(
blob_storage_context->GetBlobDataFromUUID(uuid)); blob_storage_context->GetBlobDataFromUUID(uuid));
dispatcher_host->HoldBlobDataHandle(uuid, blob_data_handle); dispatcher_host->HoldBlobDataHandle(uuid, blob_data_handle.Pass());
return uuid; return uuid;
} }
scoped_refptr<ShareableFileReference> shareable_file = scoped_refptr<ShareableFileReference> shareable_file =
...@@ -222,7 +222,7 @@ static std::string CreateBlobData( ...@@ -222,7 +222,7 @@ static std::string CreateBlobData(
blob_info.file_path(), 0, blob_info.size(), blob_info.last_modified()); blob_info.file_path(), 0, blob_info.size(), blob_info.last_modified());
scoped_ptr<webkit_blob::BlobDataHandle> blob_data_handle( scoped_ptr<webkit_blob::BlobDataHandle> blob_data_handle(
blob_storage_context->AddFinishedBlob(blob_data.get())); blob_storage_context->AddFinishedBlob(blob_data.get()));
dispatcher_host->HoldBlobDataHandle(uuid, blob_data_handle); dispatcher_host->HoldBlobDataHandle(uuid, blob_data_handle.Pass());
return uuid; return uuid;
} }
...@@ -404,9 +404,9 @@ void IndexedDBCallbacks::OnSuccess(const IndexedDBKey& key, ...@@ -404,9 +404,9 @@ void IndexedDBCallbacks::OnSuccess(const IndexedDBKey& key,
void IndexedDBCallbacks::OnSuccessWithPrefetch( void IndexedDBCallbacks::OnSuccessWithPrefetch(
const std::vector<IndexedDBKey>& keys, const std::vector<IndexedDBKey>& keys,
const std::vector<IndexedDBKey>& primary_keys, const std::vector<IndexedDBKey>& primary_keys,
std::vector<IndexedDBValue>& values) { std::vector<IndexedDBValue>* values) {
DCHECK_EQ(keys.size(), primary_keys.size()); DCHECK_EQ(keys.size(), primary_keys.size());
DCHECK_EQ(keys.size(), values.size()); DCHECK_EQ(keys.size(), values->size());
DCHECK(dispatcher_host_.get()); DCHECK(dispatcher_host_.get());
...@@ -432,14 +432,14 @@ void IndexedDBCallbacks::OnSuccessWithPrefetch( ...@@ -432,14 +432,14 @@ void IndexedDBCallbacks::OnSuccessWithPrefetch(
params->keys = msgKeys; params->keys = msgKeys;
params->primary_keys = msgPrimaryKeys; params->primary_keys = msgPrimaryKeys;
std::vector<std::string>& values_bits = params->values; std::vector<std::string>& values_bits = params->values;
values_bits.resize(values.size()); values_bits.resize(values->size());
std::vector<std::vector<IndexedDBMsg_BlobOrFileInfo> >& values_blob_infos = std::vector<std::vector<IndexedDBMsg_BlobOrFileInfo> >& values_blob_infos =
params->blob_or_file_infos; params->blob_or_file_infos;
values_blob_infos.resize(values.size()); values_blob_infos.resize(values->size());
bool found_blob_info = false; bool found_blob_info = false;
std::vector<IndexedDBValue>::iterator iter = values.begin(); std::vector<IndexedDBValue>::iterator iter = values->begin();
for (size_t i = 0; iter != values.end(); ++iter, ++i) { for (size_t i = 0; iter != values->end(); ++iter, ++i) {
values_bits[i].swap(iter->bits); values_bits[i].swap(iter->bits);
if (iter->blob_info.size()) { if (iter->blob_info.size()) {
found_blob_info = true; found_blob_info = true;
...@@ -455,13 +455,12 @@ void IndexedDBCallbacks::OnSuccessWithPrefetch( ...@@ -455,13 +455,12 @@ void IndexedDBCallbacks::OnSuccessWithPrefetch(
} }
if (found_blob_info) { if (found_blob_info) {
BrowserThread::PostTask( BrowserThread::PostTask(BrowserThread::IO,
BrowserThread::IO, FROM_HERE,
FROM_HERE, base::Bind(BlobLookupForCursorPrefetch,
base::Bind(BlobLookupForCursorPrefetch, base::Owned(params.release()),
base::Owned(params.release()), dispatcher_host_,
dispatcher_host_, *values));
values));
} else { } else {
dispatcher_host_->Send( dispatcher_host_->Send(
new IndexedDBMsg_CallbacksSuccessCursorPrefetch(*params.get())); new IndexedDBMsg_CallbacksSuccessCursorPrefetch(*params.get()));
......
...@@ -83,7 +83,7 @@ class CONTENT_EXPORT IndexedDBCallbacks ...@@ -83,7 +83,7 @@ class CONTENT_EXPORT IndexedDBCallbacks
virtual void OnSuccessWithPrefetch( virtual void OnSuccessWithPrefetch(
const std::vector<IndexedDBKey>& keys, const std::vector<IndexedDBKey>& keys,
const std::vector<IndexedDBKey>& primary_keys, const std::vector<IndexedDBKey>& primary_keys,
std::vector<IndexedDBValue>& values); std::vector<IndexedDBValue>* values);
// IndexedDBDatabase::Get (with key injection) // IndexedDBDatabase::Get (with key injection)
virtual void OnSuccess(IndexedDBValue* value, virtual void OnSuccess(IndexedDBValue* value,
......
...@@ -170,7 +170,7 @@ void IndexedDBCursor::CursorPrefetchIterationOperation( ...@@ -170,7 +170,7 @@ void IndexedDBCursor::CursorPrefetchIterationOperation(
} }
callbacks->OnSuccessWithPrefetch( callbacks->OnSuccessWithPrefetch(
found_keys, found_primary_keys, found_values); found_keys, found_primary_keys, &found_values);
} }
leveldb::Status IndexedDBCursor::PrefetchReset(int used_prefetches, leveldb::Status IndexedDBCursor::PrefetchReset(int used_prefetches,
......
...@@ -848,7 +848,7 @@ void IndexedDBDatabase::PutOperation(scoped_ptr<PutOperationParams> params, ...@@ -848,7 +848,7 @@ void IndexedDBDatabase::PutOperation(scoped_ptr<PutOperationParams> params,
id(), id(),
params->object_store_id, params->object_store_id,
*key, *key,
params->value, &params->value,
&params->handles, &params->handles,
&record_identifier); &record_identifier);
if (!s.ok()) { if (!s.ok()) {
......
...@@ -211,7 +211,7 @@ uint32 IndexedDBDispatcherHost::TransactionIdToProcessId( ...@@ -211,7 +211,7 @@ uint32 IndexedDBDispatcherHost::TransactionIdToProcessId(
void IndexedDBDispatcherHost::HoldBlobDataHandle( void IndexedDBDispatcherHost::HoldBlobDataHandle(
const std::string& uuid, const std::string& uuid,
scoped_ptr<webkit_blob::BlobDataHandle>& blob_data_handle) { scoped_ptr<webkit_blob::BlobDataHandle> blob_data_handle) {
DCHECK(!ContainsKey(blob_data_handle_map_, uuid)); DCHECK(!ContainsKey(blob_data_handle_map_, uuid));
blob_data_handle_map_[uuid] = blob_data_handle.release(); blob_data_handle_map_[uuid] = blob_data_handle.release();
} }
......
...@@ -96,7 +96,7 @@ class IndexedDBDispatcherHost : public BrowserMessageFilter { ...@@ -96,7 +96,7 @@ class IndexedDBDispatcherHost : public BrowserMessageFilter {
void HoldBlobDataHandle( void HoldBlobDataHandle(
const std::string& uuid, const std::string& uuid,
scoped_ptr<webkit_blob::BlobDataHandle>& blob_data_handle); scoped_ptr<webkit_blob::BlobDataHandle> blob_data_handle);
void DropBlobDataHandle(const std::string& uuid); void DropBlobDataHandle(const std::string& uuid);
private: private:
......
...@@ -82,7 +82,7 @@ leveldb::Status IndexedDBFakeBackingStore::PutRecord( ...@@ -82,7 +82,7 @@ leveldb::Status IndexedDBFakeBackingStore::PutRecord(
int64 database_id, int64 database_id,
int64 object_store_id, int64 object_store_id,
const IndexedDBKey& key, const IndexedDBKey& key,
IndexedDBValue& value, IndexedDBValue* value,
ScopedVector<webkit_blob::BlobDataHandle>* handles, ScopedVector<webkit_blob::BlobDataHandle>* handles,
RecordIdentifier* record) { RecordIdentifier* record) {
return leveldb::Status::OK(); return leveldb::Status::OK();
......
...@@ -53,7 +53,7 @@ class IndexedDBFakeBackingStore : public IndexedDBBackingStore { ...@@ -53,7 +53,7 @@ class IndexedDBFakeBackingStore : public IndexedDBBackingStore {
int64 database_id, int64 database_id,
int64 object_store_id, int64 object_store_id,
const IndexedDBKey& key, const IndexedDBKey& key,
IndexedDBValue& value, IndexedDBValue* value,
ScopedVector<webkit_blob::BlobDataHandle>* handles, ScopedVector<webkit_blob::BlobDataHandle>* handles,
RecordIdentifier* record) OVERRIDE; RecordIdentifier* record) OVERRIDE;
...@@ -152,6 +152,7 @@ class IndexedDBFakeBackingStore : public IndexedDBBackingStore { ...@@ -152,6 +152,7 @@ class IndexedDBFakeBackingStore : public IndexedDBBackingStore {
friend class base::RefCounted<IndexedDBFakeBackingStore>; friend class base::RefCounted<IndexedDBFakeBackingStore>;
virtual ~IndexedDBFakeBackingStore(); virtual ~IndexedDBFakeBackingStore();
private:
DISALLOW_COPY_AND_ASSIGN(IndexedDBFakeBackingStore); DISALLOW_COPY_AND_ASSIGN(IndexedDBFakeBackingStore);
}; };
......
...@@ -24,7 +24,6 @@ class LevelDBWriteBatch; ...@@ -24,7 +24,6 @@ class LevelDBWriteBatch;
class CONTENT_EXPORT LevelDBTransaction class CONTENT_EXPORT LevelDBTransaction
: public base::RefCounted<LevelDBTransaction> { : public base::RefCounted<LevelDBTransaction> {
public: public:
void Put(const base::StringPiece& key, std::string* value); void Put(const base::StringPiece& key, std::string* value);
void Remove(const base::StringPiece& key); void Remove(const base::StringPiece& key);
virtual leveldb::Status Get(const base::StringPiece& key, virtual leveldb::Status Get(const base::StringPiece& key,
......
...@@ -101,7 +101,7 @@ class LevelDBTraceTansaction : public LevelDBTransaction { ...@@ -101,7 +101,7 @@ class LevelDBTraceTansaction : public LevelDBTransaction {
private: private:
virtual ~LevelDBTraceTansaction() {} virtual ~LevelDBTraceTansaction() {}
const static std::string s_class_name; static const std::string s_class_name;
FunctionTracer commit_tracer_; FunctionTracer commit_tracer_;
FunctionTracer get_tracer_; FunctionTracer get_tracer_;
...@@ -152,7 +152,7 @@ class LevelDBTraceIteratorImpl : public LevelDBIteratorImpl { ...@@ -152,7 +152,7 @@ class LevelDBTraceIteratorImpl : public LevelDBIteratorImpl {
return LevelDBIteratorImpl::Value(); return LevelDBIteratorImpl::Value();
} }
const static std::string s_class_name; static const std::string s_class_name;
mutable FunctionTracer is_valid_tracer_; mutable FunctionTracer is_valid_tracer_;
mutable FunctionTracer seek_to_last_tracer_; mutable FunctionTracer seek_to_last_tracer_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment