| 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 "storage/browser/fileapi/file_system_context.h" | 5 #include "storage/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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 } | 286 } |
| 287 | 287 |
| 288 bool FileSystemContext::IsSandboxFileSystem(FileSystemType type) const { | 288 bool FileSystemContext::IsSandboxFileSystem(FileSystemType type) const { |
| 289 FileSystemBackendMap::const_iterator found = backend_map_.find(type); | 289 FileSystemBackendMap::const_iterator found = backend_map_.find(type); |
| 290 return found != backend_map_.end() && found->second->GetQuotaUtil(); | 290 return found != backend_map_.end() && found->second->GetQuotaUtil(); |
| 291 } | 291 } |
| 292 | 292 |
| 293 const UpdateObserverList* FileSystemContext::GetUpdateObservers( | 293 const UpdateObserverList* FileSystemContext::GetUpdateObservers( |
| 294 FileSystemType type) const { | 294 FileSystemType type) const { |
| 295 FileSystemBackend* backend = GetFileSystemBackend(type); | 295 FileSystemBackend* backend = GetFileSystemBackend(type); |
| 296 if (backend->GetQuotaUtil()) | 296 return backend->GetUpdateObservers(type); |
| 297 return backend->GetQuotaUtil()->GetUpdateObservers(type); | |
| 298 return NULL; | |
| 299 } | 297 } |
| 300 | 298 |
| 301 const ChangeObserverList* FileSystemContext::GetChangeObservers( | 299 const ChangeObserverList* FileSystemContext::GetChangeObservers( |
| 302 FileSystemType type) const { | 300 FileSystemType type) const { |
| 303 FileSystemBackend* backend = GetFileSystemBackend(type); | 301 FileSystemBackend* backend = GetFileSystemBackend(type); |
| 304 if (backend->GetQuotaUtil()) | 302 return backend->GetChangeObservers(type); |
| 305 return backend->GetQuotaUtil()->GetChangeObservers(type); | |
| 306 return NULL; | |
| 307 } | 303 } |
| 308 | 304 |
| 309 const AccessObserverList* FileSystemContext::GetAccessObservers( | 305 const AccessObserverList* FileSystemContext::GetAccessObservers( |
| 310 FileSystemType type) const { | 306 FileSystemType type) const { |
| 311 FileSystemBackend* backend = GetFileSystemBackend(type); | 307 FileSystemBackend* backend = GetFileSystemBackend(type); |
| 312 if (backend->GetQuotaUtil()) | 308 return backend->GetAccessObservers(type); |
| 313 return backend->GetQuotaUtil()->GetAccessObservers(type); | |
| 314 return NULL; | |
| 315 } | 309 } |
| 316 | 310 |
| 317 void FileSystemContext::GetFileSystemTypes( | 311 void FileSystemContext::GetFileSystemTypes( |
| 318 std::vector<FileSystemType>* types) const { | 312 std::vector<FileSystemType>* types) const { |
| 319 types->clear(); | 313 types->clear(); |
| 320 for (FileSystemBackendMap::const_iterator iter = backend_map_.begin(); | 314 for (FileSystemBackendMap::const_iterator iter = backend_map_.begin(); |
| 321 iter != backend_map_.end(); ++iter) | 315 iter != backend_map_.end(); ++iter) |
| 322 types->push_back(iter->first); | 316 types->push_back(iter->first); |
| 323 } | 317 } |
| 324 | 318 |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 } else if (parent != child) { | 629 } else if (parent != child) { |
| 636 bool result = parent.AppendRelativePath(child, &path); | 630 bool result = parent.AppendRelativePath(child, &path); |
| 637 DCHECK(result); | 631 DCHECK(result); |
| 638 } | 632 } |
| 639 | 633 |
| 640 operation_runner()->GetMetadata( | 634 operation_runner()->GetMetadata( |
| 641 url, base::Bind(&DidGetMetadataForResolveURL, path, callback, info)); | 635 url, base::Bind(&DidGetMetadataForResolveURL, path, callback, info)); |
| 642 } | 636 } |
| 643 | 637 |
| 644 } // namespace storage | 638 } // namespace storage |
| OLD | NEW |