diff options
-rw-r--r-- | chrome/browser/file_system/file_system_dispatcher_host.cc | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/chrome/browser/file_system/file_system_dispatcher_host.cc b/chrome/browser/file_system/file_system_dispatcher_host.cc index 6dd6072..df87b11 100644 --- a/chrome/browser/file_system/file_system_dispatcher_host.cc +++ b/chrome/browser/file_system/file_system_dispatcher_host.cc @@ -120,21 +120,25 @@ bool FileSystemDispatcherHost::OnMessageReceived( void FileSystemDispatcherHost::OnOpenFileSystem( int request_id, const GURL& origin_url, fileapi::FileSystemType type, int64 requested_size) { - - // TODO(kinuko): hook up ContentSettings cookies type checks. + ContentSetting content_setting = + host_content_settings_map_->GetContentSetting( + origin_url, CONTENT_SETTINGS_TYPE_COOKIES, ""); + DCHECK((content_setting == CONTENT_SETTING_ALLOW) || + (content_setting == CONTENT_SETTING_BLOCK) || + (content_setting == CONTENT_SETTING_SESSION_ONLY)); + if (content_setting == CONTENT_SETTING_BLOCK) { + // TODO(kinuko): Need to notify the UI thread to indicate that + // there's a blocked content. + Send(new ViewMsg_OpenFileSystemRequest_Complete( + request_id, false, std::string(), FilePath())); + return; + } FilePath root_path; std::string name; - - if (!context_->GetFileSystemRootPath(origin_url, - type, - &root_path, - &name)) { + if (!context_->GetFileSystemRootPath(origin_url, type, &root_path, &name)) { Send(new ViewMsg_OpenFileSystemRequest_Complete( - request_id, - false, - std::string(), - FilePath())); + request_id, false, std::string(), FilePath())); return; } |