| 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 return CrackFileSystemURL(FileSystemURL(url)); | 411 return CrackFileSystemURL(FileSystemURL(url)); |
| 412 } | 412 } |
| 413 | 413 |
| 414 FileSystemURL FileSystemContext::CreateCrackedFileSystemURL( | 414 FileSystemURL FileSystemContext::CreateCrackedFileSystemURL( |
| 415 const GURL& origin, | 415 const GURL& origin, |
| 416 FileSystemType type, | 416 FileSystemType type, |
| 417 const base::FilePath& path) const { | 417 const base::FilePath& path) const { |
| 418 return CrackFileSystemURL(FileSystemURL(origin, type, path)); | 418 return CrackFileSystemURL(FileSystemURL(origin, type, path)); |
| 419 } | 419 } |
| 420 | 420 |
| 421 #if defined(OS_CHROMEOS) && defined(GOOGLE_CHROME_BUILD) | 421 #if defined(OS_CHROMEOS) |
| 422 void FileSystemContext::EnableTemporaryFileSystemInIncognito() { | 422 void FileSystemContext::EnableTemporaryFileSystemInIncognito() { |
| 423 sandbox_backend_->set_enable_temporary_file_system_in_incognito(true); | 423 sandbox_backend_->set_enable_temporary_file_system_in_incognito(true); |
| 424 } | 424 } |
| 425 #endif | 425 #endif |
| 426 | 426 |
| 427 bool FileSystemContext::CanServeURLRequest(const FileSystemURL& url) const { | 427 bool FileSystemContext::CanServeURLRequest(const FileSystemURL& url) const { |
| 428 // We never support accessing files in isolated filesystems via an URL. | 428 // We never support accessing files in isolated filesystems via an URL. |
| 429 if (url.mount_type() == kFileSystemTypeIsolated) | 429 if (url.mount_type() == kFileSystemTypeIsolated) |
| 430 return false; | 430 return false; |
| 431 #if defined(OS_CHROMEOS) && defined(GOOGLE_CHROME_BUILD) | 431 #if defined(OS_CHROMEOS) |
| 432 if (url.type() == kFileSystemTypeTemporary && | 432 if (url.type() == kFileSystemTypeTemporary && |
| 433 sandbox_backend_->enable_temporary_file_system_in_incognito()) { | 433 sandbox_backend_->enable_temporary_file_system_in_incognito()) { |
| 434 return true; | 434 return true; |
| 435 } | 435 } |
| 436 #endif | 436 #endif |
| 437 return !is_incognito_ || !FileSystemContext::IsSandboxFileSystem(url.type()); | 437 return !is_incognito_ || !FileSystemContext::IsSandboxFileSystem(url.type()); |
| 438 } | 438 } |
| 439 | 439 |
| 440 void FileSystemContext::OpenPluginPrivateFileSystem( | 440 void FileSystemContext::OpenPluginPrivateFileSystem( |
| 441 const GURL& origin_url, | 441 const GURL& origin_url, |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 } else if (parent != child) { | 564 } else if (parent != child) { |
| 565 bool result = parent.AppendRelativePath(child, &path); | 565 bool result = parent.AppendRelativePath(child, &path); |
| 566 DCHECK(result); | 566 DCHECK(result); |
| 567 } | 567 } |
| 568 | 568 |
| 569 operation_runner()->GetMetadata( | 569 operation_runner()->GetMetadata( |
| 570 url, base::Bind(&DidGetMetadataForResolveURL, path, callback, info)); | 570 url, base::Bind(&DidGetMetadataForResolveURL, path, callback, info)); |
| 571 } | 571 } |
| 572 | 572 |
| 573 } // namespace fileapi | 573 } // namespace fileapi |
| OLD | NEW |