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

Side by Side Diff: storage/browser/quota/quota_manager_proxy.cc

Issue 2890143004: Rename TaskRunner::RunsTasksOnCurrentThread() in //storage (Closed)
Patch Set: for Requirements 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
« no previous file with comments | « storage/browser/fileapi/timed_task_helper.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "storage/browser/quota/quota_manager_proxy.h" 5 #include "storage/browser/quota/quota_manager_proxy.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
11 #include "base/sequenced_task_runner.h" 11 #include "base/sequenced_task_runner.h"
12 #include "base/single_thread_task_runner.h" 12 #include "base/single_thread_task_runner.h"
13 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
14 #include "base/task_runner_util.h" 14 #include "base/task_runner_util.h"
15 #include "base/trace_event/trace_event.h" 15 #include "base/trace_event/trace_event.h"
16 16
17 namespace storage { 17 namespace storage {
18 18
19 namespace { 19 namespace {
20 20
21 void DidGetUsageAndQuota( 21 void DidGetUsageAndQuota(
22 base::SequencedTaskRunner* original_task_runner, 22 base::SequencedTaskRunner* original_task_runner,
23 const QuotaManagerProxy::UsageAndQuotaCallback& callback, 23 const QuotaManagerProxy::UsageAndQuotaCallback& callback,
24 QuotaStatusCode status, 24 QuotaStatusCode status,
25 int64_t usage, 25 int64_t usage,
26 int64_t quota) { 26 int64_t quota) {
27 if (!original_task_runner->RunsTasksOnCurrentThread()) { 27 if (!original_task_runner->RunsTasksInCurrentSequence()) {
28 original_task_runner->PostTask( 28 original_task_runner->PostTask(
29 FROM_HERE, base::Bind(&DidGetUsageAndQuota, 29 FROM_HERE, base::Bind(&DidGetUsageAndQuota,
30 base::RetainedRef(original_task_runner), callback, 30 base::RetainedRef(original_task_runner), callback,
31 status, usage, quota)); 31 status, usage, quota));
32 return; 32 return;
33 } 33 }
34 34
35 // crbug.com/349708 35 // crbug.com/349708
36 TRACE_EVENT0("io", "QuotaManagerProxy DidGetUsageAndQuota"); 36 TRACE_EVENT0("io", "QuotaManagerProxy DidGetUsageAndQuota");
37 callback.Run(status, usage, quota); 37 callback.Run(status, usage, quota);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 QuotaManagerProxy::QuotaManagerProxy( 160 QuotaManagerProxy::QuotaManagerProxy(
161 QuotaManager* manager, 161 QuotaManager* manager,
162 const scoped_refptr<base::SingleThreadTaskRunner>& io_thread) 162 const scoped_refptr<base::SingleThreadTaskRunner>& io_thread)
163 : manager_(manager), io_thread_(io_thread) { 163 : manager_(manager), io_thread_(io_thread) {
164 } 164 }
165 165
166 QuotaManagerProxy::~QuotaManagerProxy() { 166 QuotaManagerProxy::~QuotaManagerProxy() {
167 } 167 }
168 168
169 } // namespace storage 169 } // namespace storage
OLDNEW
« no previous file with comments | « storage/browser/fileapi/timed_task_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698