Commit fc41b212 authored by jochen@chromium.org's avatar jochen@chromium.org

[content shell] add QuotaPermissionContext implementation that always grants quota

BUG=111316
R=marja@chromium.org
TEST=http/tests/filesystem/no-cache-filesystem-url.html passes

Review URL: https://codereview.chromium.org/12965016

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190411 0039d316-1c4b-4281-b951-d872f2087c98
parent 0b8440f8
...@@ -116,6 +116,8 @@ ...@@ -116,6 +116,8 @@
'shell/shell_messages.h', 'shell/shell_messages.h',
'shell/shell_network_delegate.cc', 'shell/shell_network_delegate.cc',
'shell/shell_network_delegate.h', 'shell/shell_network_delegate.h',
'shell/shell_quota_permission_context.cc',
'shell/shell_quota_permission_context.h',
'shell/shell_render_process_observer.cc', 'shell/shell_render_process_observer.cc',
'shell/shell_render_process_observer.h', 'shell/shell_render_process_observer.h',
'shell/shell_resource_dispatcher_host_delegate.cc', 'shell/shell_resource_dispatcher_host_delegate.cc',
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "content/shell/shell_devtools_delegate.h" #include "content/shell/shell_devtools_delegate.h"
#include "content/shell/shell_message_filter.h" #include "content/shell/shell_message_filter.h"
#include "content/shell/shell_messages.h" #include "content/shell/shell_messages.h"
#include "content/shell/shell_quota_permission_context.h"
#include "content/shell/shell_resource_dispatcher_host_delegate.h" #include "content/shell/shell_resource_dispatcher_host_delegate.h"
#include "content/shell/shell_switches.h" #include "content/shell/shell_switches.h"
#include "content/shell/shell_web_contents_view_delegate_creator.h" #include "content/shell/shell_web_contents_view_delegate_creator.h"
...@@ -176,6 +177,11 @@ WebContentsViewDelegate* ShellContentBrowserClient::GetWebContentsViewDelegate( ...@@ -176,6 +177,11 @@ WebContentsViewDelegate* ShellContentBrowserClient::GetWebContentsViewDelegate(
#endif #endif
} }
QuotaPermissionContext*
ShellContentBrowserClient::CreateQuotaPermissionContext() {
return new ShellQuotaPermissionContext();
}
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
const CommandLine& command_line, const CommandLine& command_line,
......
...@@ -48,6 +48,7 @@ class ShellContentBrowserClient : public ContentBrowserClient { ...@@ -48,6 +48,7 @@ class ShellContentBrowserClient : public ContentBrowserClient {
const GURL& url) OVERRIDE; const GURL& url) OVERRIDE;
virtual WebContentsViewDelegate* GetWebContentsViewDelegate( virtual WebContentsViewDelegate* GetWebContentsViewDelegate(
WebContents* web_contents) OVERRIDE; WebContents* web_contents) OVERRIDE;
virtual QuotaPermissionContext* CreateQuotaPermissionContext() OVERRIDE;
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
virtual void GetAdditionalMappedFilesForChildProcess( virtual void GetAdditionalMappedFilesForChildProcess(
......
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/shell/shell_quota_permission_context.h"
#include "webkit/quota/quota_types.h"
namespace content {
ShellQuotaPermissionContext::ShellQuotaPermissionContext() {}
void ShellQuotaPermissionContext::RequestQuotaPermission(
const GURL& origin_url,
quota::StorageType type,
int64 requested_quota,
int render_process_id,
int render_view_id,
const PermissionCallback& callback) {
if (type != quota::kStorageTypePersistent) {
// For now we only support requesting quota with this interface
// for Persistent storage type.
callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW);
return;
}
callback.Run(QUOTA_PERMISSION_RESPONSE_ALLOW);
}
ShellQuotaPermissionContext::~ShellQuotaPermissionContext() {}
} // namespace content
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_SHELL_SHELL_QUOTA_PERMISSION_CONTEXT_H_
#define CONTENT_SHELL_SHELL_QUOTA_PERMISSION_CONTEXT_H_
#include "base/compiler_specific.h"
#include "content/public/browser/quota_permission_context.h"
namespace content {
class ShellQuotaPermissionContext : public QuotaPermissionContext {
public:
ShellQuotaPermissionContext();
// The callback will be dispatched on the IO thread.
virtual void RequestQuotaPermission(
const GURL& origin_url,
quota::StorageType type,
int64 new_quota,
int render_process_id,
int render_view_id,
const PermissionCallback& callback) OVERRIDE;
private:
virtual ~ShellQuotaPermissionContext();
DISALLOW_COPY_AND_ASSIGN(ShellQuotaPermissionContext);
};
} // namespace content
#endif // CONTENT_SHELL_SHELL_QUOTA_PERMISSION_CONTEXT_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment