| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_dispatcher_host.h" | 5 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/guid.h" | 10 #include "base/guid.h" |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 224 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 225 std::string uuid = blob_info.uuid(); | 225 std::string uuid = blob_info.uuid(); |
| 226 storage::BlobStorageContext* context = blob_storage_context_->context(); | 226 storage::BlobStorageContext* context = blob_storage_context_->context(); |
| 227 scoped_ptr<storage::BlobDataHandle> blob_data_handle; | 227 scoped_ptr<storage::BlobDataHandle> blob_data_handle; |
| 228 if (uuid.empty()) { | 228 if (uuid.empty()) { |
| 229 uuid = base::GenerateGUID(); | 229 uuid = base::GenerateGUID(); |
| 230 storage::BlobDataBuilder blob_data_builder(uuid); | 230 storage::BlobDataBuilder blob_data_builder(uuid); |
| 231 blob_data_builder.set_content_type(base::UTF16ToUTF8(blob_info.type())); | 231 blob_data_builder.set_content_type(base::UTF16ToUTF8(blob_info.type())); |
| 232 blob_data_builder.AppendFile(blob_info.file_path(), 0, blob_info.size(), | 232 blob_data_builder.AppendFile(blob_info.file_path(), 0, blob_info.size(), |
| 233 blob_info.last_modified()); | 233 blob_info.last_modified()); |
| 234 blob_data_handle = context->AddFinishedBlob(blob_data_builder); | 234 blob_data_handle = context->AddFinishedBlob(&blob_data_builder); |
| 235 } else { | 235 } else { |
| 236 auto iter = blob_data_handle_map_.find(uuid); | 236 auto iter = blob_data_handle_map_.find(uuid); |
| 237 if (iter != blob_data_handle_map_.end()) { | 237 if (iter != blob_data_handle_map_.end()) { |
| 238 iter->second.second += 1; | 238 iter->second.second += 1; |
| 239 return uuid; | 239 return uuid; |
| 240 } | 240 } |
| 241 blob_data_handle = context->GetBlobDataFromUUID(uuid); | 241 blob_data_handle = context->GetBlobDataFromUUID(uuid); |
| 242 } | 242 } |
| 243 | 243 |
| 244 DCHECK(!ContainsKey(blob_data_handle_map_, uuid)); | 244 DCHECK(!ContainsKey(blob_data_handle_map_, uuid)); |
| (...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1025 } | 1025 } |
| 1026 | 1026 |
| 1027 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( | 1027 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( |
| 1028 int32 ipc_object_id) { | 1028 int32 ipc_object_id) { |
| 1029 DCHECK( | 1029 DCHECK( |
| 1030 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); | 1030 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); |
| 1031 parent_->DestroyObject(&map_, ipc_object_id); | 1031 parent_->DestroyObject(&map_, ipc_object_id); |
| 1032 } | 1032 } |
| 1033 | 1033 |
| 1034 } // namespace content | 1034 } // namespace content |
| OLD | NEW |