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_callbacks.h" | 5 #include "content/browser/indexed_db/indexed_db_callbacks.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 shareable_file = ShareableFileReference::GetOrCreate( | 239 shareable_file = ShareableFileReference::GetOrCreate( |
240 blob_info.file_path(), | 240 blob_info.file_path(), |
241 ShareableFileReference::DONT_DELETE_ON_FINAL_RELEASE, | 241 ShareableFileReference::DONT_DELETE_ON_FINAL_RELEASE, |
242 task_runner); | 242 task_runner); |
243 if (!blob_info.release_callback().is_null()) | 243 if (!blob_info.release_callback().is_null()) |
244 shareable_file->AddFinalReleaseCallback(blob_info.release_callback()); | 244 shareable_file->AddFinalReleaseCallback(blob_info.release_callback()); |
245 } | 245 } |
246 | 246 |
247 uuid = base::GenerateGUID(); | 247 uuid = base::GenerateGUID(); |
248 scoped_refptr<storage::BlobData> blob_data = new storage::BlobData(uuid); | 248 scoped_refptr<storage::BlobData> blob_data = new storage::BlobData(uuid); |
| 249 blob_data->set_content_type(base::UTF16ToUTF8(blob_info.type())); |
249 blob_data->AppendFile( | 250 blob_data->AppendFile( |
250 blob_info.file_path(), 0, blob_info.size(), blob_info.last_modified()); | 251 blob_info.file_path(), 0, blob_info.size(), blob_info.last_modified()); |
251 scoped_ptr<storage::BlobDataHandle> blob_data_handle( | 252 scoped_ptr<storage::BlobDataHandle> blob_data_handle( |
252 blob_storage_context->AddFinishedBlob(blob_data.get())); | 253 blob_storage_context->AddFinishedBlob(blob_data.get())); |
253 dispatcher_host->HoldBlobDataHandle(uuid, blob_data_handle.Pass()); | 254 dispatcher_host->HoldBlobDataHandle(uuid, blob_data_handle.Pass()); |
254 | 255 |
255 return uuid; | 256 return uuid; |
256 } | 257 } |
257 | 258 |
258 static bool CreateAllBlobs( | 259 static bool CreateAllBlobs( |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 ipc_thread_id_, ipc_callbacks_id_)); | 607 ipc_thread_id_, ipc_callbacks_id_)); |
607 dispatcher_host_ = NULL; | 608 dispatcher_host_ = NULL; |
608 } | 609 } |
609 | 610 |
610 void IndexedDBCallbacks::SetConnectionOpenStartTime( | 611 void IndexedDBCallbacks::SetConnectionOpenStartTime( |
611 const base::TimeTicks& start_time) { | 612 const base::TimeTicks& start_time) { |
612 connection_open_start_time_ = start_time; | 613 connection_open_start_time_ = start_time; |
613 } | 614 } |
614 | 615 |
615 } // namespace content | 616 } // namespace content |
OLD | NEW |