summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authormarja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-06 12:43:24 +0000
committermarja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-06 12:43:24 +0000
commit832c03ac33c02aacf824f00226b4e1d01d9f0efa (patch)
treecc34fee521fe5dea83361fc69ede2e7d5185e0cb /content
parentba025cd28c835219d1749e64ea052ef2d406063b (diff)
downloadchromium_src-832c03ac33c02aacf824f00226b4e1d01d9f0efa.zip
chromium_src-832c03ac33c02aacf824f00226b4e1d01d9f0efa.tar.gz
chromium_src-832c03ac33c02aacf824f00226b4e1d01d9f0efa.tar.bz2
Set up include rules for webkit/dom_storage.
This limits which files can include headers from webkit/dom_storage, and it forces the access to go via libcontent. Refactoring: moving (Local|Session)StorageUsageInfo away from DomStorageContext and allowing the inclusion of dom_storage_types.h. BUG=156446 Review URL: https://chromiumcodereview.appspot.com/11361096 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166196 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/DEPS2
-rw-r--r--content/browser/dom_storage/DEPS3
-rw-r--r--content/browser/dom_storage/dom_storage_context_impl.cc14
-rw-r--r--content/browser/dom_storage/dom_storage_context_impl.h7
-rw-r--r--content/public/browser/dom_storage_context.h20
-rw-r--r--content/renderer/dom_storage/DEPS3
6 files changed, 31 insertions, 18 deletions
diff --git a/content/DEPS b/content/DEPS
index e63c902..2584f77 100644
--- a/content/DEPS
+++ b/content/DEPS
@@ -69,6 +69,8 @@ include_rules = [
"-ui/views",
"+webkit",
+ "-webkit/dom_storage",
+ "+webkit/dom_storage/dom_storage_types.h",
# For generated JNI includes.
"+jni",
diff --git a/content/browser/dom_storage/DEPS b/content/browser/dom_storage/DEPS
new file mode 100644
index 0000000..aabd9ff
--- /dev/null
+++ b/content/browser/dom_storage/DEPS
@@ -0,0 +1,3 @@
+include_rules = [
+ "+webkit/dom_storage",
+]
diff --git a/content/browser/dom_storage/dom_storage_context_impl.cc b/content/browser/dom_storage/dom_storage_context_impl.cc
index 36a4b12..e298c7d 100644
--- a/content/browser/dom_storage/dom_storage_context_impl.cc
+++ b/content/browser/dom_storage/dom_storage_context_impl.cc
@@ -27,7 +27,7 @@ const char kSessionStorageDirectory[] = "Session Storage";
void InvokeLocalStorageUsageCallbackHelper(
const DOMStorageContext::GetLocalStorageUsageCallback& callback,
- const std::vector<DomStorageContext::LocalStorageUsageInfo>* infos) {
+ const std::vector<dom_storage::LocalStorageUsageInfo>* infos) {
callback.Run(*infos);
}
@@ -35,8 +35,8 @@ void GetLocalStorageUsageHelper(
base::MessageLoopProxy* reply_loop,
DomStorageContext* context,
const DOMStorageContext::GetLocalStorageUsageCallback& callback) {
- std::vector<DomStorageContext::LocalStorageUsageInfo>* infos =
- new std::vector<DomStorageContext::LocalStorageUsageInfo>;
+ std::vector<dom_storage::LocalStorageUsageInfo>* infos =
+ new std::vector<dom_storage::LocalStorageUsageInfo>;
context->GetLocalStorageUsage(infos, true);
reply_loop->PostTask(
FROM_HERE,
@@ -46,7 +46,7 @@ void GetLocalStorageUsageHelper(
void InvokeSessionStorageUsageCallbackHelper(
const DOMStorageContext::GetSessionStorageUsageCallback& callback,
- const std::vector<DomStorageContext::SessionStorageUsageInfo>* infos) {
+ const std::vector<dom_storage::SessionStorageUsageInfo>* infos) {
callback.Run(*infos);
}
@@ -54,8 +54,8 @@ void GetSessionStorageUsageHelper(
base::MessageLoopProxy* reply_loop,
DomStorageContext* context,
const DOMStorageContext::GetSessionStorageUsageCallback& callback) {
- std::vector<DomStorageContext::SessionStorageUsageInfo>* infos =
- new std::vector<DomStorageContext::SessionStorageUsageInfo>;
+ std::vector<dom_storage::SessionStorageUsageInfo>* infos =
+ new std::vector<dom_storage::SessionStorageUsageInfo>;
context->GetSessionStorageUsage(infos);
reply_loop->PostTask(
FROM_HERE,
@@ -116,7 +116,7 @@ void DOMStorageContextImpl::DeleteLocalStorage(const GURL& origin) {
}
void DOMStorageContextImpl::DeleteSessionStorage(
- const dom_storage::DomStorageContext::SessionStorageUsageInfo& usage_info) {
+ const dom_storage::SessionStorageUsageInfo& usage_info) {
DCHECK(context_);
context_->task_runner()->PostShutdownBlockingTask(
FROM_HERE,
diff --git a/content/browser/dom_storage/dom_storage_context_impl.h b/content/browser/dom_storage/dom_storage_context_impl.h
index c67a19d..21f68df 100644
--- a/content/browser/dom_storage/dom_storage_context_impl.h
+++ b/content/browser/dom_storage/dom_storage_context_impl.h
@@ -10,6 +10,10 @@
class FilePath;
+namespace dom_storage {
+class DomStorageContext;
+}
+
namespace quota {
class SpecialStoragePolicy;
}
@@ -33,8 +37,7 @@ class CONTENT_EXPORT DOMStorageContextImpl :
const GetSessionStorageUsageCallback& callback) OVERRIDE;
virtual void DeleteLocalStorage(const GURL& origin) OVERRIDE;
virtual void DeleteSessionStorage(
- const dom_storage::DomStorageContext::SessionStorageUsageInfo& usage_info)
- OVERRIDE;
+ const dom_storage::SessionStorageUsageInfo& usage_info) OVERRIDE;
virtual void SetSaveSessionStorageOnDisk() OVERRIDE;
virtual scoped_refptr<SessionStorageNamespace>
RecreateSessionStorage(const std::string& persistent_id) OVERRIDE;
diff --git a/content/public/browser/dom_storage_context.h b/content/public/browser/dom_storage_context.h
index f466249..d0c502f 100644
--- a/content/public/browser/dom_storage_context.h
+++ b/content/public/browser/dom_storage_context.h
@@ -5,14 +5,19 @@
#ifndef CONTENT_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_
#define CONTENT_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_
+#include <string>
#include <vector>
#include "base/callback.h"
#include "content/common/content_export.h"
-#include "webkit/dom_storage/dom_storage_context.h"
class GURL;
+namespace dom_storage {
+struct LocalStorageUsageInfo;
+struct SessionStorageUsageInfo;
+}
+
namespace content {
class BrowserContext;
@@ -22,14 +27,12 @@ class SessionStorageNamespace;
class DOMStorageContext {
public:
typedef base::Callback<
- void(const std::vector<
- dom_storage::DomStorageContext::LocalStorageUsageInfo>&)>
- GetLocalStorageUsageCallback;
+ void(const std::vector<dom_storage::LocalStorageUsageInfo>&)>
+ GetLocalStorageUsageCallback;
typedef base::Callback<
- void(const std::vector<
- dom_storage::DomStorageContext::SessionStorageUsageInfo>&)>
- GetSessionStorageUsageCallback;
+ void(const std::vector<dom_storage::SessionStorageUsageInfo>&)>
+ GetSessionStorageUsageCallback;
// Returns a collection of origins using local storage to the given callback.
virtual void GetLocalStorageUsage(
@@ -45,8 +48,7 @@ class DOMStorageContext {
// Deletes the session storage data identified by |usage_info|.
virtual void DeleteSessionStorage(
- const dom_storage::DomStorageContext::SessionStorageUsageInfo& usage_info)
- = 0;
+ const dom_storage::SessionStorageUsageInfo& usage_info) = 0;
// If this is called, sessionStorage data will be stored on disk, and can be
// restored after a browser restart (with RecreateSessionStorage). This
diff --git a/content/renderer/dom_storage/DEPS b/content/renderer/dom_storage/DEPS
new file mode 100644
index 0000000..aabd9ff
--- /dev/null
+++ b/content/renderer/dom_storage/DEPS
@@ -0,0 +1,3 @@
+include_rules = [
+ "+webkit/dom_storage",
+]