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

Side by Side Diff: webkit/browser/fileapi/file_system_context.cc

Issue 22893003: Discard FileAPI pending operations on shutdown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « webkit/browser/fileapi/file_system_context.h ('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 (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
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
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
OLDNEW
« no previous file with comments | « webkit/browser/fileapi/file_system_context.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698