diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-13 04:10:40 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-13 04:10:40 +0000 |
commit | 10e5cf1c02a7f30b7cd0b3ef3fef4ecb8faa75a0 (patch) | |
tree | 0bd741bb4d609f04bb8947ff5cd237a0098e01f8 /content/browser/renderer_host | |
parent | 831de724f3aed4700bb20750e2434b4159f485da (diff) | |
download | chromium_src-10e5cf1c02a7f30b7cd0b3ef3fef4ecb8faa75a0.zip chromium_src-10e5cf1c02a7f30b7cd0b3ef3fef4ecb8faa75a0.tar.gz chromium_src-10e5cf1c02a7f30b7cd0b3ef3fef4ecb8faa75a0.tar.bz2 |
Add IPC plumbing code for Quota API
BUG=61676
TEST=No new tests; just IPC plumbing (manually tested)
Review URL: http://codereview.chromium.org/6811022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81364 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host')
-rw-r--r-- | content/browser/renderer_host/quota_dispatcher_host.cc | 46 | ||||
-rw-r--r-- | content/browser/renderer_host/quota_dispatcher_host.h | 31 |
2 files changed, 77 insertions, 0 deletions
diff --git a/content/browser/renderer_host/quota_dispatcher_host.cc b/content/browser/renderer_host/quota_dispatcher_host.cc new file mode 100644 index 0000000..aef300c --- /dev/null +++ b/content/browser/renderer_host/quota_dispatcher_host.cc @@ -0,0 +1,46 @@ +// Copyright (c) 2011 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/browser/renderer_host/quota_dispatcher_host.h" + +#include "content/common/quota_messages.h" +#include "googleurl/src/gurl.h" + +QuotaDispatcherHost::~QuotaDispatcherHost() { +} + +bool QuotaDispatcherHost::OnMessageReceived( + const IPC::Message& message, bool* message_was_ok) { + *message_was_ok = true; + bool handled = true; + IPC_BEGIN_MESSAGE_MAP_EX(QuotaDispatcherHost, message, *message_was_ok) + IPC_MESSAGE_HANDLER(QuotaHostMsg_QueryStorageUsageAndQuota, + OnQueryStorageUsageAndQuota) + IPC_MESSAGE_HANDLER(QuotaHostMsg_RequestStorageQuota, + OnRequestStorageQuota) + IPC_MESSAGE_UNHANDLED(handled = false) + IPC_END_MESSAGE_MAP_EX() + return handled; +} + +void QuotaDispatcherHost::OnQueryStorageUsageAndQuota( + int request_id, + const GURL& origin, + WebKit::WebStorageQuotaType type) { + // TODO(kinuko): not implemented yet. + Send(new QuotaMsg_DidFail( + request_id, + WebKit::WebStorageQuotaErrorNotSupported)); +} + +void QuotaDispatcherHost::OnRequestStorageQuota( + int request_id, + const GURL& origin, + WebKit::WebStorageQuotaType type, + int64 requested_size) { + // TODO(kinuko): not implemented yet. + Send(new QuotaMsg_DidFail( + request_id, + WebKit::WebStorageQuotaErrorNotSupported)); +} diff --git a/content/browser/renderer_host/quota_dispatcher_host.h b/content/browser/renderer_host/quota_dispatcher_host.h new file mode 100644 index 0000000..ac75278 --- /dev/null +++ b/content/browser/renderer_host/quota_dispatcher_host.h @@ -0,0 +1,31 @@ +// Copyright (c) 2011 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_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_ +#define CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_ + +#include "base/basictypes.h" +#include "content/browser/browser_message_filter.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaType.h" + +class GURL; + +class QuotaDispatcherHost : public BrowserMessageFilter { + public: + ~QuotaDispatcherHost(); + bool OnMessageReceived(const IPC::Message& message, bool* message_was_ok); + + private: + void OnQueryStorageUsageAndQuota( + int request_id, + const GURL& origin_url, + WebKit::WebStorageQuotaType type); + void OnRequestStorageQuota( + int request_id, + const GURL& origin_url, + WebKit::WebStorageQuotaType type, + int64 requested_size); +}; + +#endif // CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_ |