| 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/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 ChildProcessSecurityPolicyImpl::GetInstance(); | 645 ChildProcessSecurityPolicyImpl::GetInstance(); |
| 646 | 646 |
| 647 for (size_t i = 0; i < params.blob_or_file_info.size(); ++i) { | 647 for (size_t i = 0; i < params.blob_or_file_info.size(); ++i) { |
| 648 const IndexedDBMsg_BlobOrFileInfo& info = params.blob_or_file_info[i]; | 648 const IndexedDBMsg_BlobOrFileInfo& info = params.blob_or_file_info[i]; |
| 649 if (info.is_file) { | 649 if (info.is_file) { |
| 650 base::FilePath path = base::FilePath::FromUTF16Unsafe(info.file_path); | 650 base::FilePath path = base::FilePath::FromUTF16Unsafe(info.file_path); |
| 651 if (!policy->CanReadFile(parent_->ipc_process_id_, path)) { | 651 if (!policy->CanReadFile(parent_->ipc_process_id_, path)) { |
| 652 parent_->BadMessageReceived(); | 652 parent_->BadMessageReceived(); |
| 653 return; | 653 return; |
| 654 } | 654 } |
| 655 blob_info[i] = IndexedDBBlobInfo(path, info.file_name, info.mime_type); | 655 blob_info[i] = |
| 656 IndexedDBBlobInfo(info.uuid, path, info.file_name, info.mime_type); |
| 656 } else { | 657 } else { |
| 657 blob_info[i] = IndexedDBBlobInfo(info.uuid, info.mime_type, info.size); | 658 blob_info[i] = IndexedDBBlobInfo(info.uuid, info.mime_type, info.size); |
| 658 } | 659 } |
| 659 } | 660 } |
| 660 | 661 |
| 661 // TODO(alecflett): Avoid a copy here. | 662 // TODO(alecflett): Avoid a copy here. |
| 662 IndexedDBValue value; | 663 IndexedDBValue value; |
| 663 value.bits = params.value; | 664 value.bits = params.value; |
| 664 value.blob_info.swap(blob_info); | 665 value.blob_info.swap(blob_info); |
| 665 connection->database()->Put( | 666 connection->database()->Put( |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 978 } | 979 } |
| 979 | 980 |
| 980 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( | 981 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( |
| 981 int32 ipc_object_id) { | 982 int32 ipc_object_id) { |
| 982 DCHECK( | 983 DCHECK( |
| 983 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); | 984 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); |
| 984 parent_->DestroyObject(&map_, ipc_object_id); | 985 parent_->DestroyObject(&map_, ipc_object_id); |
| 985 } | 986 } |
| 986 | 987 |
| 987 } // namespace content | 988 } // namespace content |
| OLD | NEW |