Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: content/browser/indexed_db/indexed_db_backing_store.cc

Issue 2873333004: Rename TaskRunner::RunsTasksOnCurrentThread() in //content (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 2594 matching lines...) Expand 10 before | Expand all | Expand 10 after
2605 chained_blob_writer_.get(); 2605 chained_blob_writer_.get();
2606 raw_tmp->AddRef(); 2606 raw_tmp->AddRef();
2607 chained_blob_writer_ = NULL; 2607 chained_blob_writer_ = NULL;
2608 task_runner_->ReleaseSoon(FROM_HERE, raw_tmp); 2608 task_runner_->ReleaseSoon(FROM_HERE, raw_tmp);
2609 } 2609 }
2610 friend class base::RefCountedThreadSafe<LocalWriteClosure>; 2610 friend class base::RefCountedThreadSafe<LocalWriteClosure>;
2611 2611
2612 // If necessary, update the timestamps on the file as a final 2612 // If necessary, update the timestamps on the file as a final
2613 // step before reporting success. 2613 // step before reporting success.
2614 void UpdateTimeStamp() { 2614 void UpdateTimeStamp() {
2615 DCHECK(task_runner_->RunsTasksOnCurrentThread()); 2615 DCHECK(task_runner_->RunsTasksInCurrentSequence());
2616 if (!base::TouchFile(file_path_, last_modified_, last_modified_)) { 2616 if (!base::TouchFile(file_path_, last_modified_, last_modified_)) {
2617 // TODO(ericu): Complain quietly; timestamp's probably not vital. 2617 // TODO(ericu): Complain quietly; timestamp's probably not vital.
2618 } 2618 }
2619 chained_blob_writer_->ReportWriteCompletion(true, bytes_written_); 2619 chained_blob_writer_->ReportWriteCompletion(true, bytes_written_);
2620 } 2620 }
2621 2621
2622 // Create an empty file. 2622 // Create an empty file.
2623 void CreateEmptyFile() { 2623 void CreateEmptyFile() {
2624 DCHECK(task_runner_->RunsTasksOnCurrentThread()); 2624 DCHECK(task_runner_->RunsTasksInCurrentSequence());
2625 base::File file(file_path_, 2625 base::File file(file_path_,
2626 base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE); 2626 base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE);
2627 bool success = file.created(); 2627 bool success = file.created();
2628 if (success && !last_modified_.is_null() && 2628 if (success && !last_modified_.is_null() &&
2629 !file.SetTimes(last_modified_, last_modified_)) { 2629 !file.SetTimes(last_modified_, last_modified_)) {
2630 // TODO(cmumford): Complain quietly; timestamp's probably not vital. 2630 // TODO(cmumford): Complain quietly; timestamp's probably not vital.
2631 } 2631 }
2632 file.Close(); 2632 file.Close();
2633 chained_blob_writer_->ReportWriteCompletion(success, bytes_written_); 2633 chained_blob_writer_->ReportWriteCompletion(success, bytes_written_);
2634 } 2634 }
(...skipping 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after
4146 live_blobs->push_back(iter); 4146 live_blobs->push_back(iter);
4147 else 4147 else
4148 dead_blobs->push_back(iter); 4148 dead_blobs->push_back(iter);
4149 } 4149 }
4150 } 4150 }
4151 4151
4152 Status IndexedDBBackingStore::Transaction::CommitPhaseOne( 4152 Status IndexedDBBackingStore::Transaction::CommitPhaseOne(
4153 scoped_refptr<BlobWriteCallback> callback) { 4153 scoped_refptr<BlobWriteCallback> callback) {
4154 IDB_TRACE("IndexedDBBackingStore::Transaction::CommitPhaseOne"); 4154 IDB_TRACE("IndexedDBBackingStore::Transaction::CommitPhaseOne");
4155 DCHECK(transaction_.get()); 4155 DCHECK(transaction_.get());
4156 DCHECK(backing_store_->task_runner()->RunsTasksOnCurrentThread()); 4156 DCHECK(backing_store_->task_runner()->RunsTasksInCurrentSequence());
4157 4157
4158 Status s; 4158 Status s;
4159 4159
4160 BlobEntryKeyValuePairVec new_blob_entries; 4160 BlobEntryKeyValuePairVec new_blob_entries;
4161 WriteDescriptorVec new_files_to_write; 4161 WriteDescriptorVec new_files_to_write;
4162 s = HandleBlobPreTransaction(&new_blob_entries, &new_files_to_write); 4162 s = HandleBlobPreTransaction(&new_blob_entries, &new_files_to_write);
4163 if (!s.ok()) { 4163 if (!s.ok()) {
4164 INTERNAL_WRITE_ERROR_UNTESTED(TRANSACTION_COMMIT_METHOD); 4164 INTERNAL_WRITE_ERROR_UNTESTED(TRANSACTION_COMMIT_METHOD);
4165 transaction_ = NULL; 4165 transaction_ = NULL;
4166 return s; 4166 return s;
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
4487 4487
4488 IndexedDBBackingStore::Transaction::WriteDescriptor::WriteDescriptor( 4488 IndexedDBBackingStore::Transaction::WriteDescriptor::WriteDescriptor(
4489 const WriteDescriptor& other) = default; 4489 const WriteDescriptor& other) = default;
4490 IndexedDBBackingStore::Transaction::WriteDescriptor::~WriteDescriptor() = 4490 IndexedDBBackingStore::Transaction::WriteDescriptor::~WriteDescriptor() =
4491 default; 4491 default;
4492 IndexedDBBackingStore::Transaction::WriteDescriptor& 4492 IndexedDBBackingStore::Transaction::WriteDescriptor&
4493 IndexedDBBackingStore::Transaction::WriteDescriptor:: 4493 IndexedDBBackingStore::Transaction::WriteDescriptor::
4494 operator=(const WriteDescriptor& other) = default; 4494 operator=(const WriteDescriptor& other) = default;
4495 4495
4496 } // namespace content 4496 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_active_blob_registry.cc ('k') | content/browser/indexed_db/indexed_db_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698