cef/libcef/browser_webstoragearea_impl.cc
Marshall Greenblatt 1073577d03 Make CEF compliant with Google/Chromium style (issue #473).
- Add a new check_style tool based on Google's cpplint that can be used to verify compliance of pending changes and specific files/directories.
- Update existing CEF source code to be compliant with the style requirements.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@463 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-01-09 23:46:23 +00:00

56 lines
1.7 KiB
C++

// Copyright (c) 2010 The Chromium Embedded Framework 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 "libcef/browser_webstoragearea_impl.h"
#include "libcef/cef_context.h"
#include "libcef/dom_storage_area.h"
#include "libcef/dom_storage_namespace.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
using WebKit::WebFrame;
using WebKit::WebString;
using WebKit::WebURL;
using WebKit::WebView;
BrowserWebStorageAreaImpl::BrowserWebStorageAreaImpl(
int64 namespace_id, const WebString& origin) {
area_ =
_Context->storage_context()->GetStorageArea(namespace_id, origin, true);
DCHECK(area_ != NULL);
}
BrowserWebStorageAreaImpl::~BrowserWebStorageAreaImpl() {
}
unsigned BrowserWebStorageAreaImpl::length() {
return area_->Length();
}
WebString BrowserWebStorageAreaImpl::key(unsigned index) {
return area_->Key(index);
}
WebString BrowserWebStorageAreaImpl::getItem(const WebString& key) {
return area_->GetItem(key);
}
void BrowserWebStorageAreaImpl::setItem(
const WebString& key, const WebString& value, const WebURL& url,
WebStorageArea::Result& result, WebString& old_value_webkit) {
old_value_webkit = area_->SetItem(key, value, &result);
}
void BrowserWebStorageAreaImpl::removeItem(
const WebString& key, const WebURL& url, WebString& old_value_webkit) {
old_value_webkit = area_->RemoveItem(key);
}
void BrowserWebStorageAreaImpl::clear(
const WebURL& url, bool& cleared_something) {
cleared_something = area_->Clear();
}