| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/database_impl.h" | 5 #include "content/browser/indexed_db/database_impl.h" |
| 6 | 6 |
| 7 #include "content/browser/bad_message.h" | 7 #include "content/browser/bad_message.h" |
| 8 #include "content/browser/child_process_security_policy_impl.h" | 8 #include "content/browser/child_process_security_policy_impl.h" |
| 9 #include "content/browser/indexed_db/indexed_db_connection.h" | 9 #include "content/browser/indexed_db/indexed_db_connection.h" |
| 10 #include "content/browser/indexed_db/indexed_db_context_impl.h" | 10 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 | 273 |
| 274 if (info->file) { | 274 if (info->file) { |
| 275 if (!info->file->path.empty() && | 275 if (!info->file->path.empty() && |
| 276 !policy->CanReadFile(dispatcher_host_->ipc_process_id(), | 276 !policy->CanReadFile(dispatcher_host_->ipc_process_id(), |
| 277 info->file->path)) { | 277 info->file->path)) { |
| 278 mojo::ReportBadMessage(kInvalidBlobFilePath); | 278 mojo::ReportBadMessage(kInvalidBlobFilePath); |
| 279 return; | 279 return; |
| 280 } | 280 } |
| 281 blob_info[i] = IndexedDBBlobInfo(info->uuid, info->file->path, | 281 blob_info[i] = IndexedDBBlobInfo(info->uuid, info->file->path, |
| 282 info->file->name, info->mime_type); | 282 info->file->name, info->mime_type); |
| 283 if (info->size != static_cast<uint64_t>(-1)) { | 283 if (info->size != -1) { |
| 284 blob_info[i].set_last_modified(info->file->last_modified); | 284 blob_info[i].set_last_modified(info->file->last_modified); |
| 285 blob_info[i].set_size(info->size); | 285 blob_info[i].set_size(info->size); |
| 286 } | 286 } |
| 287 } else { | 287 } else { |
| 288 blob_info[i] = IndexedDBBlobInfo(info->uuid, info->mime_type, info->size); | 288 blob_info[i] = IndexedDBBlobInfo(info->uuid, info->mime_type, info->size); |
| 289 } | 289 } |
| 290 } | 290 } |
| 291 | 291 |
| 292 scoped_refptr<IndexedDBCallbacks> callbacks(new IndexedDBCallbacks( | 292 scoped_refptr<IndexedDBCallbacks> callbacks(new IndexedDBCallbacks( |
| 293 dispatcher_host_.get(), origin_, std::move(callbacks_info))); | 293 dispatcher_host_.get(), origin_, std::move(callbacks_info))); |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 if (status == storage::kQuotaStatusOk && usage + transaction_size <= quota) { | 773 if (status == storage::kQuotaStatusOk && usage + transaction_size <= quota) { |
| 774 connection_->database()->Commit(host_transaction_id); | 774 connection_->database()->Commit(host_transaction_id); |
| 775 } else { | 775 } else { |
| 776 connection_->database()->Abort( | 776 connection_->database()->Abort( |
| 777 host_transaction_id, | 777 host_transaction_id, |
| 778 IndexedDBDatabaseError(blink::WebIDBDatabaseExceptionQuotaError)); | 778 IndexedDBDatabaseError(blink::WebIDBDatabaseExceptionQuotaError)); |
| 779 } | 779 } |
| 780 } | 780 } |
| 781 | 781 |
| 782 } // namespace content | 782 } // namespace content |
| OLD | NEW |