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

Side by Side Diff: chrome/browser/chromeos/file_system_provider/queue.cc

Issue 968763002: Fix aborting in throttled file system (FSP). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaned up. Created 5 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/location.h" 6 #include "base/location.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "base/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
10 #include "chrome/browser/chromeos/file_system_provider/queue.h" 10 #include "chrome/browser/chromeos/file_system_provider/queue.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 FROM_HERE, 118 FROM_HERE,
119 base::Bind(&Queue::MaybeRun, weak_ptr_factory_.GetWeakPtr())); 119 base::Bind(&Queue::MaybeRun, weak_ptr_factory_.GetWeakPtr()));
120 return; 120 return;
121 } 121 }
122 } 122 }
123 123
124 // The task is already removed, marked as completed or aborted. 124 // The task is already removed, marked as completed or aborted.
125 NOTREACHED(); 125 NOTREACHED();
126 } 126 }
127 127
128 bool Queue::IsAborted(size_t token) {
129 #if !NDEBUG
130 bool in_queue = executed_.find(token) != executed_.end() ||
131 completed_.find(token) != completed_.end() ||
132 aborted_.find(token) != aborted_.end();
133 for (auto& task : pending_) {
134 if (token == task.token) {
135 in_queue = true;
136 break;
137 }
138 }
139 DCHECK(in_queue);
140 #endif
141 return aborted_.find(token) != aborted_.end();
142 }
143
128 } // namespace file_system_provider 144 } // namespace file_system_provider
129 } // namespace chromeos 145 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/file_system_provider/queue.h ('k') | chrome/browser/chromeos/file_system_provider/queue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698