OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/indexed_db/indexed_db_backing_store.h" | 5 #include "content/browser/indexed_db/indexed_db_backing_store.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> |
8 | 9 |
9 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
11 #include "base/format_macros.h" | 12 #include "base/format_macros.h" |
12 #include "base/json/json_reader.h" | 13 #include "base/json/json_reader.h" |
13 #include "base/json/json_writer.h" | 14 #include "base/json/json_writer.h" |
14 #include "base/logging.h" | 15 #include "base/logging.h" |
15 #include "base/macros.h" | 16 #include "base/macros.h" |
16 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
17 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 net::URLRequestContext* request_context, | 761 net::URLRequestContext* request_context, |
761 scoped_ptr<LevelDBDatabase> db, | 762 scoped_ptr<LevelDBDatabase> db, |
762 scoped_ptr<LevelDBComparator> comparator, | 763 scoped_ptr<LevelDBComparator> comparator, |
763 base::SequencedTaskRunner* task_runner) | 764 base::SequencedTaskRunner* task_runner) |
764 : indexed_db_factory_(indexed_db_factory), | 765 : indexed_db_factory_(indexed_db_factory), |
765 origin_url_(origin_url), | 766 origin_url_(origin_url), |
766 blob_path_(blob_path), | 767 blob_path_(blob_path), |
767 origin_identifier_(ComputeOriginIdentifier(origin_url)), | 768 origin_identifier_(ComputeOriginIdentifier(origin_url)), |
768 request_context_(request_context), | 769 request_context_(request_context), |
769 task_runner_(task_runner), | 770 task_runner_(task_runner), |
770 db_(db.Pass()), | 771 db_(std::move(db)), |
771 comparator_(comparator.Pass()), | 772 comparator_(std::move(comparator)), |
772 active_blob_registry_(this), | 773 active_blob_registry_(this), |
773 committing_transaction_count_(0) { | 774 committing_transaction_count_(0) {} |
774 } | |
775 | 775 |
776 IndexedDBBackingStore::~IndexedDBBackingStore() { | 776 IndexedDBBackingStore::~IndexedDBBackingStore() { |
777 if (!blob_path_.empty() && !child_process_ids_granted_.empty()) { | 777 if (!blob_path_.empty() && !child_process_ids_granted_.empty()) { |
778 ChildProcessSecurityPolicyImpl* policy = | 778 ChildProcessSecurityPolicyImpl* policy = |
779 ChildProcessSecurityPolicyImpl::GetInstance(); | 779 ChildProcessSecurityPolicyImpl::GetInstance(); |
780 for (const auto& pid : child_process_ids_granted_) | 780 for (const auto& pid : child_process_ids_granted_) |
781 policy->RevokeAllPermissionsForFile(pid, blob_path_); | 781 policy->RevokeAllPermissionsForFile(pid, blob_path_); |
782 } | 782 } |
783 STLDeleteContainerPairSecondPointers(incognito_blob_map_.begin(), | 783 STLDeleteContainerPairSecondPointers(incognito_blob_map_.begin(), |
784 incognito_blob_map_.end()); | 784 incognito_blob_map_.end()); |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 LOG(ERROR) << "IndexedDB backing store reopen after recovery failed"; | 1099 LOG(ERROR) << "IndexedDB backing store reopen after recovery failed"; |
1100 HistogramOpenStatus(INDEXED_DB_BACKING_STORE_OPEN_CLEANUP_REOPEN_FAILED, | 1100 HistogramOpenStatus(INDEXED_DB_BACKING_STORE_OPEN_CLEANUP_REOPEN_FAILED, |
1101 origin_url); | 1101 origin_url); |
1102 return scoped_refptr<IndexedDBBackingStore>(); | 1102 return scoped_refptr<IndexedDBBackingStore>(); |
1103 } | 1103 } |
1104 HistogramOpenStatus(INDEXED_DB_BACKING_STORE_OPEN_CLEANUP_REOPEN_SUCCESS, | 1104 HistogramOpenStatus(INDEXED_DB_BACKING_STORE_OPEN_CLEANUP_REOPEN_SUCCESS, |
1105 origin_url); | 1105 origin_url); |
1106 } | 1106 } |
1107 | 1107 |
1108 scoped_refptr<IndexedDBBackingStore> backing_store = | 1108 scoped_refptr<IndexedDBBackingStore> backing_store = |
1109 Create(indexed_db_factory, | 1109 Create(indexed_db_factory, origin_url, blob_path, request_context, |
1110 origin_url, | 1110 std::move(db), std::move(comparator), task_runner, status); |
1111 blob_path, | |
1112 request_context, | |
1113 db.Pass(), | |
1114 comparator.Pass(), | |
1115 task_runner, | |
1116 status); | |
1117 | 1111 |
1118 if (clean_journal && backing_store.get()) { | 1112 if (clean_journal && backing_store.get()) { |
1119 *status = backing_store->CleanUpBlobJournal(LiveBlobJournalKey::Encode()); | 1113 *status = backing_store->CleanUpBlobJournal(LiveBlobJournalKey::Encode()); |
1120 if (!status->ok()) { | 1114 if (!status->ok()) { |
1121 HistogramOpenStatus( | 1115 HistogramOpenStatus( |
1122 INDEXED_DB_BACKING_STORE_OPEN_FAILED_CLEANUP_JOURNAL_ERROR, | 1116 INDEXED_DB_BACKING_STORE_OPEN_FAILED_CLEANUP_JOURNAL_ERROR, |
1123 origin_url); | 1117 origin_url); |
1124 return scoped_refptr<IndexedDBBackingStore>(); | 1118 return scoped_refptr<IndexedDBBackingStore>(); |
1125 } | 1119 } |
1126 } | 1120 } |
(...skipping 22 matching lines...) Expand all Loading... |
1149 scoped_ptr<LevelDBDatabase> db = | 1143 scoped_ptr<LevelDBDatabase> db = |
1150 LevelDBDatabase::OpenInMemory(comparator.get()); | 1144 LevelDBDatabase::OpenInMemory(comparator.get()); |
1151 if (!db) { | 1145 if (!db) { |
1152 LOG(ERROR) << "LevelDBDatabase::OpenInMemory failed."; | 1146 LOG(ERROR) << "LevelDBDatabase::OpenInMemory failed."; |
1153 HistogramOpenStatus(INDEXED_DB_BACKING_STORE_OPEN_MEMORY_FAILED, | 1147 HistogramOpenStatus(INDEXED_DB_BACKING_STORE_OPEN_MEMORY_FAILED, |
1154 origin_url); | 1148 origin_url); |
1155 return scoped_refptr<IndexedDBBackingStore>(); | 1149 return scoped_refptr<IndexedDBBackingStore>(); |
1156 } | 1150 } |
1157 HistogramOpenStatus(INDEXED_DB_BACKING_STORE_OPEN_MEMORY_SUCCESS, origin_url); | 1151 HistogramOpenStatus(INDEXED_DB_BACKING_STORE_OPEN_MEMORY_SUCCESS, origin_url); |
1158 | 1152 |
1159 return Create(NULL /* indexed_db_factory */, | 1153 return Create(NULL /* indexed_db_factory */, origin_url, base::FilePath(), |
1160 origin_url, | 1154 NULL /* request_context */, std::move(db), |
1161 base::FilePath(), | 1155 std::move(comparator), task_runner, status); |
1162 NULL /* request_context */, | |
1163 db.Pass(), | |
1164 comparator.Pass(), | |
1165 task_runner, | |
1166 status); | |
1167 } | 1156 } |
1168 | 1157 |
1169 // static | 1158 // static |
1170 scoped_refptr<IndexedDBBackingStore> IndexedDBBackingStore::Create( | 1159 scoped_refptr<IndexedDBBackingStore> IndexedDBBackingStore::Create( |
1171 IndexedDBFactory* indexed_db_factory, | 1160 IndexedDBFactory* indexed_db_factory, |
1172 const GURL& origin_url, | 1161 const GURL& origin_url, |
1173 const base::FilePath& blob_path, | 1162 const base::FilePath& blob_path, |
1174 net::URLRequestContext* request_context, | 1163 net::URLRequestContext* request_context, |
1175 scoped_ptr<LevelDBDatabase> db, | 1164 scoped_ptr<LevelDBDatabase> db, |
1176 scoped_ptr<LevelDBComparator> comparator, | 1165 scoped_ptr<LevelDBComparator> comparator, |
1177 base::SequencedTaskRunner* task_runner, | 1166 base::SequencedTaskRunner* task_runner, |
1178 leveldb::Status* status) { | 1167 leveldb::Status* status) { |
1179 // TODO(jsbell): Handle comparator name changes. | 1168 // TODO(jsbell): Handle comparator name changes. |
1180 scoped_refptr<IndexedDBBackingStore> backing_store( | 1169 scoped_refptr<IndexedDBBackingStore> backing_store(new IndexedDBBackingStore( |
1181 new IndexedDBBackingStore(indexed_db_factory, | 1170 indexed_db_factory, origin_url, blob_path, request_context, std::move(db), |
1182 origin_url, | 1171 std::move(comparator), task_runner)); |
1183 blob_path, | |
1184 request_context, | |
1185 db.Pass(), | |
1186 comparator.Pass(), | |
1187 task_runner)); | |
1188 *status = backing_store->SetUpMetadata(); | 1172 *status = backing_store->SetUpMetadata(); |
1189 if (!status->ok()) | 1173 if (!status->ok()) |
1190 return scoped_refptr<IndexedDBBackingStore>(); | 1174 return scoped_refptr<IndexedDBBackingStore>(); |
1191 | 1175 |
1192 return backing_store; | 1176 return backing_store; |
1193 } | 1177 } |
1194 | 1178 |
1195 void IndexedDBBackingStore::GrantChildProcessPermissions(int child_process_id) { | 1179 void IndexedDBBackingStore::GrantChildProcessPermissions(int child_process_id) { |
1196 if (!child_process_ids_granted_.count(child_process_id)) { | 1180 if (!child_process_ids_granted_.count(child_process_id)) { |
1197 child_process_ids_granted_.insert(child_process_id); | 1181 child_process_ids_granted_.insert(child_process_id); |
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2381 const base::Time& last_modified, | 2365 const base::Time& last_modified, |
2382 net::URLRequestContext* request_context) { | 2366 net::URLRequestContext* request_context) { |
2383 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 2367 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
2384 scoped_ptr<storage::FileStreamWriter> writer( | 2368 scoped_ptr<storage::FileStreamWriter> writer( |
2385 storage::FileStreamWriter::CreateForLocalFile( | 2369 storage::FileStreamWriter::CreateForLocalFile( |
2386 task_runner_.get(), | 2370 task_runner_.get(), |
2387 file_path, | 2371 file_path, |
2388 0, | 2372 0, |
2389 storage::FileStreamWriter::CREATE_NEW_FILE)); | 2373 storage::FileStreamWriter::CREATE_NEW_FILE)); |
2390 scoped_ptr<FileWriterDelegate> delegate(new FileWriterDelegate( | 2374 scoped_ptr<FileWriterDelegate> delegate(new FileWriterDelegate( |
2391 writer.Pass(), storage::FlushPolicy::FLUSH_ON_COMPLETION)); | 2375 std::move(writer), storage::FlushPolicy::FLUSH_ON_COMPLETION)); |
2392 | 2376 |
2393 DCHECK(blob_url.is_valid()); | 2377 DCHECK(blob_url.is_valid()); |
2394 scoped_ptr<net::URLRequest> blob_request(request_context->CreateRequest( | 2378 scoped_ptr<net::URLRequest> blob_request(request_context->CreateRequest( |
2395 blob_url, net::DEFAULT_PRIORITY, delegate.get())); | 2379 blob_url, net::DEFAULT_PRIORITY, delegate.get())); |
2396 | 2380 |
2397 this->file_path_ = file_path; | 2381 this->file_path_ = file_path; |
2398 this->last_modified_ = last_modified; | 2382 this->last_modified_ = last_modified; |
2399 | 2383 |
2400 delegate->Start(blob_request.Pass(), | 2384 delegate->Start(std::move(blob_request), |
2401 base::Bind(&LocalWriteClosure::Run, this)); | 2385 base::Bind(&LocalWriteClosure::Run, this)); |
2402 chained_blob_writer_->set_delegate(delegate.Pass()); | 2386 chained_blob_writer_->set_delegate(std::move(delegate)); |
2403 } | 2387 } |
2404 | 2388 |
2405 private: | 2389 private: |
2406 virtual ~LocalWriteClosure() { | 2390 virtual ~LocalWriteClosure() { |
2407 // Make sure the last reference to a ChainedBlobWriter is released (and | 2391 // Make sure the last reference to a ChainedBlobWriter is released (and |
2408 // deleted) on the IDB thread since it owns a transaction which has thread | 2392 // deleted) on the IDB thread since it owns a transaction which has thread |
2409 // affinity. | 2393 // affinity. |
2410 IndexedDBBackingStore::Transaction::ChainedBlobWriter* raw_tmp = | 2394 IndexedDBBackingStore::Transaction::ChainedBlobWriter* raw_tmp = |
2411 chained_blob_writer_.get(); | 2395 chained_blob_writer_.get(); |
2412 raw_tmp->AddRef(); | 2396 raw_tmp->AddRef(); |
(...skipping 1545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3958 object_store_id, | 3942 object_store_id, |
3959 range, | 3943 range, |
3960 direction, | 3944 direction, |
3961 &cursor_options)) | 3945 &cursor_options)) |
3962 return scoped_ptr<IndexedDBBackingStore::Cursor>(); | 3946 return scoped_ptr<IndexedDBBackingStore::Cursor>(); |
3963 scoped_ptr<ObjectStoreCursorImpl> cursor(new ObjectStoreCursorImpl( | 3947 scoped_ptr<ObjectStoreCursorImpl> cursor(new ObjectStoreCursorImpl( |
3964 this, transaction, database_id, cursor_options)); | 3948 this, transaction, database_id, cursor_options)); |
3965 if (!cursor->FirstSeek(s)) | 3949 if (!cursor->FirstSeek(s)) |
3966 return scoped_ptr<IndexedDBBackingStore::Cursor>(); | 3950 return scoped_ptr<IndexedDBBackingStore::Cursor>(); |
3967 | 3951 |
3968 return cursor.Pass(); | 3952 return std::move(cursor); |
3969 } | 3953 } |
3970 | 3954 |
3971 scoped_ptr<IndexedDBBackingStore::Cursor> | 3955 scoped_ptr<IndexedDBBackingStore::Cursor> |
3972 IndexedDBBackingStore::OpenObjectStoreKeyCursor( | 3956 IndexedDBBackingStore::OpenObjectStoreKeyCursor( |
3973 IndexedDBBackingStore::Transaction* transaction, | 3957 IndexedDBBackingStore::Transaction* transaction, |
3974 int64_t database_id, | 3958 int64_t database_id, |
3975 int64_t object_store_id, | 3959 int64_t object_store_id, |
3976 const IndexedDBKeyRange& range, | 3960 const IndexedDBKeyRange& range, |
3977 blink::WebIDBCursorDirection direction, | 3961 blink::WebIDBCursorDirection direction, |
3978 leveldb::Status* s) { | 3962 leveldb::Status* s) { |
3979 IDB_TRACE("IndexedDBBackingStore::OpenObjectStoreKeyCursor"); | 3963 IDB_TRACE("IndexedDBBackingStore::OpenObjectStoreKeyCursor"); |
3980 *s = leveldb::Status::OK(); | 3964 *s = leveldb::Status::OK(); |
3981 LevelDBTransaction* leveldb_transaction = transaction->transaction(); | 3965 LevelDBTransaction* leveldb_transaction = transaction->transaction(); |
3982 IndexedDBBackingStore::Cursor::CursorOptions cursor_options; | 3966 IndexedDBBackingStore::Cursor::CursorOptions cursor_options; |
3983 if (!ObjectStoreCursorOptions(leveldb_transaction, | 3967 if (!ObjectStoreCursorOptions(leveldb_transaction, |
3984 database_id, | 3968 database_id, |
3985 object_store_id, | 3969 object_store_id, |
3986 range, | 3970 range, |
3987 direction, | 3971 direction, |
3988 &cursor_options)) | 3972 &cursor_options)) |
3989 return scoped_ptr<IndexedDBBackingStore::Cursor>(); | 3973 return scoped_ptr<IndexedDBBackingStore::Cursor>(); |
3990 scoped_ptr<ObjectStoreKeyCursorImpl> cursor(new ObjectStoreKeyCursorImpl( | 3974 scoped_ptr<ObjectStoreKeyCursorImpl> cursor(new ObjectStoreKeyCursorImpl( |
3991 this, transaction, database_id, cursor_options)); | 3975 this, transaction, database_id, cursor_options)); |
3992 if (!cursor->FirstSeek(s)) | 3976 if (!cursor->FirstSeek(s)) |
3993 return scoped_ptr<IndexedDBBackingStore::Cursor>(); | 3977 return scoped_ptr<IndexedDBBackingStore::Cursor>(); |
3994 | 3978 |
3995 return cursor.Pass(); | 3979 return std::move(cursor); |
3996 } | 3980 } |
3997 | 3981 |
3998 scoped_ptr<IndexedDBBackingStore::Cursor> | 3982 scoped_ptr<IndexedDBBackingStore::Cursor> |
3999 IndexedDBBackingStore::OpenIndexKeyCursor( | 3983 IndexedDBBackingStore::OpenIndexKeyCursor( |
4000 IndexedDBBackingStore::Transaction* transaction, | 3984 IndexedDBBackingStore::Transaction* transaction, |
4001 int64_t database_id, | 3985 int64_t database_id, |
4002 int64_t object_store_id, | 3986 int64_t object_store_id, |
4003 int64_t index_id, | 3987 int64_t index_id, |
4004 const IndexedDBKeyRange& range, | 3988 const IndexedDBKeyRange& range, |
4005 blink::WebIDBCursorDirection direction, | 3989 blink::WebIDBCursorDirection direction, |
4006 leveldb::Status* s) { | 3990 leveldb::Status* s) { |
4007 IDB_TRACE("IndexedDBBackingStore::OpenIndexKeyCursor"); | 3991 IDB_TRACE("IndexedDBBackingStore::OpenIndexKeyCursor"); |
4008 *s = leveldb::Status::OK(); | 3992 *s = leveldb::Status::OK(); |
4009 LevelDBTransaction* leveldb_transaction = transaction->transaction(); | 3993 LevelDBTransaction* leveldb_transaction = transaction->transaction(); |
4010 IndexedDBBackingStore::Cursor::CursorOptions cursor_options; | 3994 IndexedDBBackingStore::Cursor::CursorOptions cursor_options; |
4011 if (!IndexCursorOptions(leveldb_transaction, | 3995 if (!IndexCursorOptions(leveldb_transaction, |
4012 database_id, | 3996 database_id, |
4013 object_store_id, | 3997 object_store_id, |
4014 index_id, | 3998 index_id, |
4015 range, | 3999 range, |
4016 direction, | 4000 direction, |
4017 &cursor_options)) | 4001 &cursor_options)) |
4018 return scoped_ptr<IndexedDBBackingStore::Cursor>(); | 4002 return scoped_ptr<IndexedDBBackingStore::Cursor>(); |
4019 scoped_ptr<IndexKeyCursorImpl> cursor( | 4003 scoped_ptr<IndexKeyCursorImpl> cursor( |
4020 new IndexKeyCursorImpl(this, transaction, database_id, cursor_options)); | 4004 new IndexKeyCursorImpl(this, transaction, database_id, cursor_options)); |
4021 if (!cursor->FirstSeek(s)) | 4005 if (!cursor->FirstSeek(s)) |
4022 return scoped_ptr<IndexedDBBackingStore::Cursor>(); | 4006 return scoped_ptr<IndexedDBBackingStore::Cursor>(); |
4023 | 4007 |
4024 return cursor.Pass(); | 4008 return std::move(cursor); |
4025 } | 4009 } |
4026 | 4010 |
4027 scoped_ptr<IndexedDBBackingStore::Cursor> | 4011 scoped_ptr<IndexedDBBackingStore::Cursor> |
4028 IndexedDBBackingStore::OpenIndexCursor( | 4012 IndexedDBBackingStore::OpenIndexCursor( |
4029 IndexedDBBackingStore::Transaction* transaction, | 4013 IndexedDBBackingStore::Transaction* transaction, |
4030 int64_t database_id, | 4014 int64_t database_id, |
4031 int64_t object_store_id, | 4015 int64_t object_store_id, |
4032 int64_t index_id, | 4016 int64_t index_id, |
4033 const IndexedDBKeyRange& range, | 4017 const IndexedDBKeyRange& range, |
4034 blink::WebIDBCursorDirection direction, | 4018 blink::WebIDBCursorDirection direction, |
4035 leveldb::Status* s) { | 4019 leveldb::Status* s) { |
4036 IDB_TRACE("IndexedDBBackingStore::OpenIndexCursor"); | 4020 IDB_TRACE("IndexedDBBackingStore::OpenIndexCursor"); |
4037 LevelDBTransaction* leveldb_transaction = transaction->transaction(); | 4021 LevelDBTransaction* leveldb_transaction = transaction->transaction(); |
4038 IndexedDBBackingStore::Cursor::CursorOptions cursor_options; | 4022 IndexedDBBackingStore::Cursor::CursorOptions cursor_options; |
4039 if (!IndexCursorOptions(leveldb_transaction, | 4023 if (!IndexCursorOptions(leveldb_transaction, |
4040 database_id, | 4024 database_id, |
4041 object_store_id, | 4025 object_store_id, |
4042 index_id, | 4026 index_id, |
4043 range, | 4027 range, |
4044 direction, | 4028 direction, |
4045 &cursor_options)) | 4029 &cursor_options)) |
4046 return scoped_ptr<IndexedDBBackingStore::Cursor>(); | 4030 return scoped_ptr<IndexedDBBackingStore::Cursor>(); |
4047 scoped_ptr<IndexCursorImpl> cursor( | 4031 scoped_ptr<IndexCursorImpl> cursor( |
4048 new IndexCursorImpl(this, transaction, database_id, cursor_options)); | 4032 new IndexCursorImpl(this, transaction, database_id, cursor_options)); |
4049 if (!cursor->FirstSeek(s)) | 4033 if (!cursor->FirstSeek(s)) |
4050 return scoped_ptr<IndexedDBBackingStore::Cursor>(); | 4034 return scoped_ptr<IndexedDBBackingStore::Cursor>(); |
4051 | 4035 |
4052 return cursor.Pass(); | 4036 return std::move(cursor); |
4053 } | 4037 } |
4054 | 4038 |
4055 IndexedDBBackingStore::Transaction::Transaction( | 4039 IndexedDBBackingStore::Transaction::Transaction( |
4056 IndexedDBBackingStore* backing_store) | 4040 IndexedDBBackingStore* backing_store) |
4057 : backing_store_(backing_store), database_id_(-1), committing_(false) { | 4041 : backing_store_(backing_store), database_id_(-1), committing_(false) { |
4058 } | 4042 } |
4059 | 4043 |
4060 IndexedDBBackingStore::Transaction::~Transaction() { | 4044 IndexedDBBackingStore::Transaction::~Transaction() { |
4061 STLDeleteContainerPairSecondPointers( | 4045 STLDeleteContainerPairSecondPointers( |
4062 blob_change_map_.begin(), blob_change_map_.end()); | 4046 blob_change_map_.begin(), blob_change_map_.end()); |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4424 } | 4408 } |
4425 | 4409 |
4426 scoped_ptr<IndexedDBBackingStore::BlobChangeRecord> | 4410 scoped_ptr<IndexedDBBackingStore::BlobChangeRecord> |
4427 IndexedDBBackingStore::BlobChangeRecord::Clone() const { | 4411 IndexedDBBackingStore::BlobChangeRecord::Clone() const { |
4428 scoped_ptr<IndexedDBBackingStore::BlobChangeRecord> record( | 4412 scoped_ptr<IndexedDBBackingStore::BlobChangeRecord> record( |
4429 new BlobChangeRecord(key_, object_store_id_)); | 4413 new BlobChangeRecord(key_, object_store_id_)); |
4430 record->blob_info_ = blob_info_; | 4414 record->blob_info_ = blob_info_; |
4431 | 4415 |
4432 for (const auto* handle : handles_) | 4416 for (const auto* handle : handles_) |
4433 record->handles_.push_back(new storage::BlobDataHandle(*handle)); | 4417 record->handles_.push_back(new storage::BlobDataHandle(*handle)); |
4434 return record.Pass(); | 4418 return record; |
4435 } | 4419 } |
4436 | 4420 |
4437 leveldb::Status IndexedDBBackingStore::Transaction::PutBlobInfoIfNeeded( | 4421 leveldb::Status IndexedDBBackingStore::Transaction::PutBlobInfoIfNeeded( |
4438 int64_t database_id, | 4422 int64_t database_id, |
4439 int64_t object_store_id, | 4423 int64_t object_store_id, |
4440 const std::string& object_store_data_key, | 4424 const std::string& object_store_data_key, |
4441 std::vector<IndexedDBBlobInfo>* blob_info, | 4425 std::vector<IndexedDBBlobInfo>* blob_info, |
4442 ScopedVector<storage::BlobDataHandle>* handles) { | 4426 ScopedVector<storage::BlobDataHandle>* handles) { |
4443 if (!blob_info || blob_info->empty()) { | 4427 if (!blob_info || blob_info->empty()) { |
4444 blob_change_map_.erase(object_store_data_key); | 4428 blob_change_map_.erase(object_store_data_key); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4520 | 4504 |
4521 IndexedDBBackingStore::Transaction::WriteDescriptor::WriteDescriptor( | 4505 IndexedDBBackingStore::Transaction::WriteDescriptor::WriteDescriptor( |
4522 const WriteDescriptor& other) = default; | 4506 const WriteDescriptor& other) = default; |
4523 IndexedDBBackingStore::Transaction::WriteDescriptor::~WriteDescriptor() = | 4507 IndexedDBBackingStore::Transaction::WriteDescriptor::~WriteDescriptor() = |
4524 default; | 4508 default; |
4525 IndexedDBBackingStore::Transaction::WriteDescriptor& | 4509 IndexedDBBackingStore::Transaction::WriteDescriptor& |
4526 IndexedDBBackingStore::Transaction::WriteDescriptor:: | 4510 IndexedDBBackingStore::Transaction::WriteDescriptor:: |
4527 operator=(const WriteDescriptor& other) = default; | 4511 operator=(const WriteDescriptor& other) = default; |
4528 | 4512 |
4529 } // namespace content | 4513 } // namespace content |
OLD | NEW |