OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/browser/fileapi/file_system_context.h" | 5 #include "webkit/browser/fileapi/file_system_context.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/task_runner_util.h" | 10 #include "base/task_runner_util.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 this, quota_manager_proxy(), origin_url, iter->first) | 167 this, quota_manager_proxy(), origin_url, iter->first) |
168 != base::PLATFORM_FILE_OK) { | 168 != base::PLATFORM_FILE_OK) { |
169 // Continue the loop, but record the failure. | 169 // Continue the loop, but record the failure. |
170 success = false; | 170 success = false; |
171 } | 171 } |
172 } | 172 } |
173 | 173 |
174 return success; | 174 return success; |
175 } | 175 } |
176 | 176 |
| 177 void FileSystemContext::Shutdown() { |
| 178 if (!io_task_runner_->RunsTasksOnCurrentThread()) { |
| 179 io_task_runner_->PostTask( |
| 180 FROM_HERE, base::Bind(&FileSystemContext::Shutdown, |
| 181 make_scoped_refptr(this))); |
| 182 return; |
| 183 } |
| 184 operation_runner_->Shutdown(); |
| 185 } |
| 186 |
177 FileSystemQuotaUtil* | 187 FileSystemQuotaUtil* |
178 FileSystemContext::GetQuotaUtil(FileSystemType type) const { | 188 FileSystemContext::GetQuotaUtil(FileSystemType type) const { |
179 FileSystemBackend* backend = GetFileSystemBackend(type); | 189 FileSystemBackend* backend = GetFileSystemBackend(type); |
180 if (!backend) | 190 if (!backend) |
181 return NULL; | 191 return NULL; |
182 return backend->GetQuotaUtil(); | 192 return backend->GetQuotaUtil(); |
183 } | 193 } |
184 | 194 |
185 AsyncFileUtil* FileSystemContext::GetAsyncFileUtil( | 195 AsyncFileUtil* FileSystemContext::GetAsyncFileUtil( |
186 FileSystemType type) const { | 196 FileSystemType type) const { |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 FileSystemType type = static_cast<FileSystemType>(t); | 439 FileSystemType type = static_cast<FileSystemType>(t); |
430 if (backend->CanHandleType(type)) { | 440 if (backend->CanHandleType(type)) { |
431 const bool inserted = backend_map_.insert( | 441 const bool inserted = backend_map_.insert( |
432 std::make_pair(type, backend)).second; | 442 std::make_pair(type, backend)).second; |
433 DCHECK(inserted); | 443 DCHECK(inserted); |
434 } | 444 } |
435 } | 445 } |
436 } | 446 } |
437 | 447 |
438 } // namespace fileapi | 448 } // namespace fileapi |
OLD | NEW |