diff options
author | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-19 19:40:31 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-19 19:40:31 +0000 |
commit | dc895236268d5f20f45c3ed86f1f70f65853cd80 (patch) | |
tree | fa69c05cacb50a7f12e3fce8f23fc974ab43039b /content/public | |
parent | d8911efaf3cd3635a1edcc985c81416bebebd3a7 (diff) | |
download | chromium_src-dc895236268d5f20f45c3ed86f1f70f65853cd80.zip chromium_src-dc895236268d5f20f45c3ed86f1f70f65853cd80.tar.gz chromium_src-dc895236268d5f20f45c3ed86f1f70f65853cd80.tar.bz2 |
Add mechanism to auto mount file systems in response to a URL request.
This code adds a hook for when a file system URL request can not be cracked.
It will allow external media galleries file systems to be lazily created.
BUG=160900
Review URL: https://codereview.chromium.org/195923002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258064 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/public')
-rw-r--r-- | content/public/browser/content_browser_client.h | 5 | ||||
-rw-r--r-- | content/public/test/test_file_system_backend.cc | 1 | ||||
-rw-r--r-- | content/public/test/test_file_system_context.cc | 20 | ||||
-rw-r--r-- | content/public/test/test_file_system_context.h | 9 |
4 files changed, 33 insertions, 2 deletions
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h index a0396ff..01c2eb9 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h @@ -24,6 +24,7 @@ #include "net/url_request/url_request_job_factory.h" #include "third_party/WebKit/public/web/WebNotificationPresenter.h" #include "ui/base/window_open_disposition.h" +#include "webkit/browser/fileapi/file_system_context.h" #include "webkit/common/resource_type.h" #if defined(OS_POSIX) && !defined(OS_MACOSX) @@ -583,6 +584,10 @@ class CONTENT_EXPORT ContentBrowserClient { virtual void GetAdditionalAllowedSchemesForFileSystem( std::vector<std::string>* additional_schemes) {} + // Returns auto mount handlers for URL requests for FileSystem APIs. + virtual void GetURLRequestAutoMountHandlers( + std::vector<fileapi::URLRequestAutoMountHandler>* handlers) {} + // Returns additional file system backends for FileSystem API. // |browser_context| is needed in the additional FileSystemBackends. // It has mount points to create objects returned by additional diff --git a/content/public/test/test_file_system_backend.cc b/content/public/test/test_file_system_backend.cc index b473716..8c37a9e 100644 --- a/content/public/test/test_file_system_backend.cc +++ b/content/public/test/test_file_system_backend.cc @@ -137,7 +137,6 @@ class TestFileSystemBackend::QuotaUtil virtual const fileapi::AccessObserverList* GetAccessObservers( FileSystemType type) const OVERRIDE { - NOTIMPLEMENTED(); return NULL; } diff --git a/content/public/test/test_file_system_context.cc b/content/public/test/test_file_system_context.cc index d09bbd1..aa954de 100644 --- a/content/public/test/test_file_system_context.cc +++ b/content/public/test/test_file_system_context.cc @@ -36,6 +36,25 @@ CreateFileSystemContextWithAdditionalProvidersForTesting( make_scoped_refptr(new quota::MockSpecialStoragePolicy()).get(), quota_manager_proxy, additional_providers.Pass(), + std::vector<fileapi::URLRequestAutoMountHandler>(), + base_path, + CreateAllowFileAccessOptions()); +} + +fileapi::FileSystemContext* +CreateFileSystemContextWithAutoMountersForTesting( + quota::QuotaManagerProxy* quota_manager_proxy, + ScopedVector<fileapi::FileSystemBackend> additional_providers, + const std::vector<fileapi::URLRequestAutoMountHandler>& auto_mounters, + const base::FilePath& base_path) { + return new fileapi::FileSystemContext( + base::MessageLoopProxy::current().get(), + base::MessageLoopProxy::current().get(), + fileapi::ExternalMountPoints::CreateRefCounted().get(), + make_scoped_refptr(new quota::MockSpecialStoragePolicy()).get(), + quota_manager_proxy, + additional_providers.Pass(), + auto_mounters, base_path, CreateAllowFileAccessOptions()); } @@ -51,6 +70,7 @@ fileapi::FileSystemContext* CreateIncognitoFileSystemContextForTesting( make_scoped_refptr(new quota::MockSpecialStoragePolicy()).get(), quota_manager_proxy, additional_providers.Pass(), + std::vector<fileapi::URLRequestAutoMountHandler>(), base_path, CreateIncognitoFileSystemOptions()); } diff --git a/content/public/test/test_file_system_context.h b/content/public/test/test_file_system_context.h index 19a4fc4..8b7c872 100644 --- a/content/public/test/test_file_system_context.h +++ b/content/public/test/test_file_system_context.h @@ -7,6 +7,7 @@ #include "base/files/file_path.h" #include "base/memory/scoped_vector.h" +#include "webkit/browser/fileapi/file_system_context.h" namespace quota { class QuotaManagerProxy; @@ -14,7 +15,6 @@ class SpecialStoragePolicy; } namespace fileapi { -class FileSystemContext; class FileSystemBackend; } @@ -32,6 +32,13 @@ CreateFileSystemContextWithAdditionalProvidersForTesting( ScopedVector<fileapi::FileSystemBackend> additional_providers, const base::FilePath& base_path); +fileapi::FileSystemContext* +CreateFileSystemContextWithAutoMountersForTesting( + quota::QuotaManagerProxy* quota_manager_proxy, + ScopedVector<fileapi::FileSystemBackend> additional_providers, + const std::vector<fileapi::URLRequestAutoMountHandler>& auto_mounters, + const base::FilePath& base_path); + fileapi::FileSystemContext* CreateIncognitoFileSystemContextForTesting( quota::QuotaManagerProxy* quota_manager_proxy, const base::FilePath& base_path); |