| 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 1954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1965 | 1965 |
| 1966 void writeBlobToFileOnIOThread(const FilePath& file_path, | 1966 void writeBlobToFileOnIOThread(const FilePath& file_path, |
| 1967 const GURL& blob_url, | 1967 const GURL& blob_url, |
| 1968 net::URLRequestContext* request_context) { | 1968 net::URLRequestContext* request_context) { |
| 1969 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 1969 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
| 1970 scoped_ptr<fileapi::FileStreamWriter> writer( | 1970 scoped_ptr<fileapi::FileStreamWriter> writer( |
| 1971 fileapi::FileStreamWriter::CreateForLocalFile( | 1971 fileapi::FileStreamWriter::CreateForLocalFile( |
| 1972 task_runner_, file_path, 0, | 1972 task_runner_, file_path, 0, |
| 1973 fileapi::FileStreamWriter::CREATE_NEW_FILE)); | 1973 fileapi::FileStreamWriter::CREATE_NEW_FILE)); |
| 1974 scoped_ptr<FileWriterDelegate> delegate( | 1974 scoped_ptr<FileWriterDelegate> delegate( |
| 1975 new FileWriterDelegate(writer.Pass())); | 1975 new FileWriterDelegate(writer.Pass(), |
| 1976 FileWriterDelegate::FLUSH_ON_COMPLETION)); |
| 1976 | 1977 |
| 1977 DCHECK(blob_url.is_valid()); | 1978 DCHECK(blob_url.is_valid()); |
| 1978 scoped_ptr<net::URLRequest> blob_request(request_context->CreateRequest( | 1979 scoped_ptr<net::URLRequest> blob_request(request_context->CreateRequest( |
| 1979 blob_url, net::DEFAULT_PRIORITY, delegate.get(), NULL)); | 1980 blob_url, net::DEFAULT_PRIORITY, delegate.get(), NULL)); |
| 1980 | 1981 |
| 1981 delegate->Start(blob_request.Pass(), | 1982 delegate->Start(blob_request.Pass(), |
| 1982 base::Bind(&LocalWriteClosure::Run, this)); | 1983 base::Bind(&LocalWriteClosure::Run, this)); |
| 1983 chained_blob_writer_->set_delegate(delegate.Pass()); | 1984 chained_blob_writer_->set_delegate(delegate.Pass()); |
| 1984 } | 1985 } |
| 1985 | 1986 |
| (...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3533 const GURL& url, | 3534 const GURL& url, |
| 3534 int64_t key) | 3535 int64_t key) |
| 3535 : is_file_(false), url_(url), key_(key) {} | 3536 : is_file_(false), url_(url), key_(key) {} |
| 3536 | 3537 |
| 3537 IndexedDBBackingStore::Transaction::WriteDescriptor::WriteDescriptor( | 3538 IndexedDBBackingStore::Transaction::WriteDescriptor::WriteDescriptor( |
| 3538 const FilePath& file_path, | 3539 const FilePath& file_path, |
| 3539 int64_t key) | 3540 int64_t key) |
| 3540 : is_file_(true), file_path_(file_path), key_(key) {} | 3541 : is_file_(true), file_path_(file_path), key_(key) {} |
| 3541 | 3542 |
| 3542 } // namespace content | 3543 } // namespace content |
| OLD | NEW |