Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(924)

Unified Diff: content/browser/in_process_webkit/dom_storage_area.cc

Issue 10086018: More DomStorage house cleaning (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/in_process_webkit/dom_storage_area.cc
===================================================================
--- content/browser/in_process_webkit/dom_storage_area.cc (revision 132437)
+++ content/browser/in_process_webkit/dom_storage_area.cc (working copy)
@@ -1,87 +0,0 @@
-// 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/in_process_webkit/dom_storage_area.h"
-
-#include "base/logging.h"
-#include "content/browser/in_process_webkit/dom_storage_namespace.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageArea.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
-#include "webkit/dom_storage/dom_storage_types.h"
-#include "webkit/glue/webkit_glue.h"
-
-#ifdef ENABLE_NEW_DOM_STORAGE_BACKEND
-// This class is no longer applicable.
-#else
-
-using WebKit::WebSecurityOrigin;
-using WebKit::WebStorageArea;
-using WebKit::WebString;
-using WebKit::WebURL;
-
-DOMStorageArea::DOMStorageArea(
- const string16& origin,
- int64 id,
- DOMStorageNamespace* owner)
- : origin_(origin),
- origin_url_(origin),
- id_(id),
- owner_(owner) {
- DCHECK(owner_);
-}
-
-DOMStorageArea::~DOMStorageArea() {
-}
-
-unsigned DOMStorageArea::Length() {
- CreateWebStorageAreaIfNecessary();
- return storage_area_->length();
-}
-
-NullableString16 DOMStorageArea::Key(unsigned index) {
- CreateWebStorageAreaIfNecessary();
- return storage_area_->key(index);
-}
-
-NullableString16 DOMStorageArea::GetItem(const string16& key) {
- CreateWebStorageAreaIfNecessary();
- return storage_area_->getItem(key);
-}
-
-NullableString16 DOMStorageArea::SetItem(
- const string16& key, const string16& value,
- WebStorageArea::Result* result) {
- CreateWebStorageAreaIfNecessary();
- WebString old_value;
- storage_area_->setItem(key, value, WebURL(), *result, old_value);
- return old_value;
-}
-
-NullableString16 DOMStorageArea::RemoveItem(const string16& key) {
- CreateWebStorageAreaIfNecessary();
- WebString old_value;
- storage_area_->removeItem(key, WebURL(), old_value);
- return old_value;
-}
-
-bool DOMStorageArea::Clear() {
- CreateWebStorageAreaIfNecessary();
- bool somethingCleared;
- storage_area_->clear(WebURL(), somethingCleared);
- return somethingCleared;
-}
-
-void DOMStorageArea::PurgeMemory() {
- storage_area_.reset();
-}
-
-void DOMStorageArea::CreateWebStorageAreaIfNecessary() {
- if (!storage_area_.get())
- storage_area_.reset(owner_->CreateWebStorageArea(origin_));
-}
-
-#endif // ENABLE_NEW_DOM_STORAGE_BACKEND
-
« no previous file with comments | « content/browser/in_process_webkit/dom_storage_area.h ('k') | content/browser/in_process_webkit/dom_storage_context_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698