| 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 "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 2212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2223 IndexedDBBackingStore* backing_store_; | 2223 IndexedDBBackingStore* backing_store_; |
| 2224 scoped_refptr<IndexedDBBackingStore::BlobWriteCallback> callback_; | 2224 scoped_refptr<IndexedDBBackingStore::BlobWriteCallback> callback_; |
| 2225 scoped_ptr<FileWriterDelegate> delegate_; | 2225 scoped_ptr<FileWriterDelegate> delegate_; |
| 2226 bool aborted_; | 2226 bool aborted_; |
| 2227 }; | 2227 }; |
| 2228 | 2228 |
| 2229 class LocalWriteClosure : public FileWriterDelegate::DelegateWriteCallback, | 2229 class LocalWriteClosure : public FileWriterDelegate::DelegateWriteCallback, |
| 2230 public base::RefCounted<LocalWriteClosure> { | 2230 public base::RefCounted<LocalWriteClosure> { |
| 2231 public: | 2231 public: |
| 2232 LocalWriteClosure(IndexedDBBackingStore::Transaction::ChainedBlobWriter* | 2232 LocalWriteClosure(IndexedDBBackingStore::Transaction::ChainedBlobWriter* |
| 2233 chained_blob_writer_, | 2233 chained_blob_writer, |
| 2234 base::TaskRunner* task_runner) | 2234 base::TaskRunner* task_runner) |
| 2235 : chained_blob_writer_(chained_blob_writer_), | 2235 : chained_blob_writer_(chained_blob_writer), |
| 2236 task_runner_(task_runner), | 2236 task_runner_(task_runner), |
| 2237 bytes_written_(-1) {} | 2237 bytes_written_(-1) {} |
| 2238 | 2238 |
| 2239 void Run(base::File::Error rv, | 2239 void Run(base::File::Error rv, |
| 2240 int64 bytes, | 2240 int64 bytes, |
| 2241 FileWriterDelegate::WriteProgressStatus write_status) { | 2241 FileWriterDelegate::WriteProgressStatus write_status) { |
| 2242 if (write_status == FileWriterDelegate::SUCCESS_IO_PENDING) | 2242 if (write_status == FileWriterDelegate::SUCCESS_IO_PENDING) |
| 2243 return; // We don't care about progress events. | 2243 return; // We don't care about progress events. |
| 2244 if (rv == base::File::FILE_OK) { | 2244 if (rv == base::File::FILE_OK) { |
| 2245 DCHECK(bytes >= 0); | 2245 DCHECK(bytes >= 0); |
| (...skipping 1914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4160 const GURL& url, | 4160 const GURL& url, |
| 4161 int64_t key) | 4161 int64_t key) |
| 4162 : is_file_(false), url_(url), key_(key) {} | 4162 : is_file_(false), url_(url), key_(key) {} |
| 4163 | 4163 |
| 4164 IndexedDBBackingStore::Transaction::WriteDescriptor::WriteDescriptor( | 4164 IndexedDBBackingStore::Transaction::WriteDescriptor::WriteDescriptor( |
| 4165 const FilePath& file_path, | 4165 const FilePath& file_path, |
| 4166 int64_t key) | 4166 int64_t key) |
| 4167 : is_file_(true), file_path_(file_path), key_(key) {} | 4167 : is_file_(true), file_path_(file_path), key_(key) {} |
| 4168 | 4168 |
| 4169 } // namespace content | 4169 } // namespace content |
| OLD | NEW |