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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 | 271 |
272 FileSystemBackend* FileSystemContext::GetFileSystemBackend( | 272 FileSystemBackend* FileSystemContext::GetFileSystemBackend( |
273 FileSystemType type) const { | 273 FileSystemType type) const { |
274 FileSystemBackendMap::const_iterator found = backend_map_.find(type); | 274 FileSystemBackendMap::const_iterator found = backend_map_.find(type); |
275 if (found != backend_map_.end()) | 275 if (found != backend_map_.end()) |
276 return found->second; | 276 return found->second; |
277 NOTREACHED() << "Unknown filesystem type: " << type; | 277 NOTREACHED() << "Unknown filesystem type: " << type; |
278 return NULL; | 278 return NULL; |
279 } | 279 } |
280 | 280 |
| 281 WatcherManager* FileSystemContext::GetWatcherManager( |
| 282 FileSystemType type) const { |
| 283 FileSystemBackend* backend = GetFileSystemBackend(type); |
| 284 if (!backend) |
| 285 return NULL; |
| 286 return backend->GetWatcherManager(type); |
| 287 } |
| 288 |
281 bool FileSystemContext::IsSandboxFileSystem(FileSystemType type) const { | 289 bool FileSystemContext::IsSandboxFileSystem(FileSystemType type) const { |
282 FileSystemBackendMap::const_iterator found = backend_map_.find(type); | 290 FileSystemBackendMap::const_iterator found = backend_map_.find(type); |
283 return found != backend_map_.end() && found->second->GetQuotaUtil(); | 291 return found != backend_map_.end() && found->second->GetQuotaUtil(); |
284 } | 292 } |
285 | 293 |
286 const UpdateObserverList* FileSystemContext::GetUpdateObservers( | 294 const UpdateObserverList* FileSystemContext::GetUpdateObservers( |
287 FileSystemType type) const { | 295 FileSystemType type) const { |
288 FileSystemBackend* backend = GetFileSystemBackend(type); | 296 FileSystemBackend* backend = GetFileSystemBackend(type); |
289 if (backend->GetQuotaUtil()) | 297 if (backend->GetQuotaUtil()) |
290 return backend->GetQuotaUtil()->GetUpdateObservers(type); | 298 return backend->GetQuotaUtil()->GetUpdateObservers(type); |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 } else if (parent != child) { | 629 } else if (parent != child) { |
622 bool result = parent.AppendRelativePath(child, &path); | 630 bool result = parent.AppendRelativePath(child, &path); |
623 DCHECK(result); | 631 DCHECK(result); |
624 } | 632 } |
625 | 633 |
626 operation_runner()->GetMetadata( | 634 operation_runner()->GetMetadata( |
627 url, base::Bind(&DidGetMetadataForResolveURL, path, callback, info)); | 635 url, base::Bind(&DidGetMetadataForResolveURL, path, callback, info)); |
628 } | 636 } |
629 | 637 |
630 } // namespace fileapi | 638 } // namespace fileapi |
OLD | NEW |