This source file includes following definitions.
- createStorageArea
- copy
- isSameNamespace
#include "content/renderer/dom_storage/webstoragenamespace_impl.h"
#include "base/logging.h"
#include "content/common/dom_storage/dom_storage_types.h"
#include "content/renderer/dom_storage/webstoragearea_impl.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "url/gurl.h"
using blink::WebStorageArea;
using blink::WebStorageNamespace;
using blink::WebString;
namespace content {
WebStorageNamespaceImpl::WebStorageNamespaceImpl()
: namespace_id_(kLocalStorageNamespaceId) {
}
WebStorageNamespaceImpl::WebStorageNamespaceImpl(
int64 namespace_id)
: namespace_id_(namespace_id) {
DCHECK_NE(kInvalidSessionStorageNamespaceId, namespace_id);
}
WebStorageNamespaceImpl::~WebStorageNamespaceImpl() {
}
WebStorageArea* WebStorageNamespaceImpl::createStorageArea(
const WebString& origin) {
return new WebStorageAreaImpl(namespace_id_, GURL(origin));
}
WebStorageNamespace* WebStorageNamespaceImpl::copy() {
return NULL;
}
bool WebStorageNamespaceImpl::isSameNamespace(
const WebStorageNamespace& other) const {
const WebStorageNamespaceImpl* other_impl =
static_cast<const WebStorageNamespaceImpl*>(&other);
return namespace_id_ == other_impl->namespace_id_;
}
}