OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/renderer_host/pepper/quota_reservation.h" | 5 #include "content/browser/renderer_host/pepper/quota_reservation.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 callback, quota_reservation_->remaining_quota(), file_sizes)); | 127 callback, quota_reservation_->remaining_quota(), file_sizes)); |
128 } else { | 128 } else { |
129 // Unit testing code path. | 129 // Unit testing code path. |
130 callback.Run(quota_reservation_->remaining_quota(), file_sizes); | 130 callback.Run(quota_reservation_->remaining_quota(), file_sizes); |
131 } | 131 } |
132 } | 132 } |
133 | 133 |
134 void QuotaReservation::DeleteOnCorrectThread() const { | 134 void QuotaReservation::DeleteOnCorrectThread() const { |
135 if (file_system_context_.get() && | 135 if (file_system_context_.get() && |
136 !file_system_context_->default_file_task_runner() | 136 !file_system_context_->default_file_task_runner() |
137 ->RunsTasksOnCurrentThread()) { | 137 ->RunsTasksInCurrentSequence()) { |
138 file_system_context_->default_file_task_runner()->DeleteSoon(FROM_HERE, | 138 file_system_context_->default_file_task_runner()->DeleteSoon(FROM_HERE, |
139 this); | 139 this); |
140 } else { | 140 } else { |
141 // We're on the right thread to delete, or unit test. | 141 // We're on the right thread to delete, or unit test. |
142 delete this; | 142 delete this; |
143 } | 143 } |
144 } | 144 } |
145 | 145 |
146 } // namespace content | 146 } // namespace content |
OLD | NEW |