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

Unified Diff: content/common/indexed_db_key.cc

Issue 8980002: Move indexeddb code to its own directory inside of content/{browser,common,renderer} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase onto ToT Created 9 years 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
« no previous file with comments | « content/common/indexed_db_key.h ('k') | content/common/indexed_db_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/indexed_db_key.cc
diff --git a/content/common/indexed_db_key.cc b/content/common/indexed_db_key.cc
deleted file mode 100644
index 4f76873ba838cfd0428288792b596d47587d6917..0000000000000000000000000000000000000000
--- a/content/common/indexed_db_key.cc
+++ /dev/null
@@ -1,79 +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/common/indexed_db_key.h"
-
-#include "base/logging.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h"
-
-using WebKit::WebIDBKey;
-
-IndexedDBKey::IndexedDBKey()
- : type_(WebIDBKey::InvalidType),
- date_(0),
- number_(0) {
-}
-
-IndexedDBKey::IndexedDBKey(const WebIDBKey& key) {
- Set(key);
-}
-
-IndexedDBKey::~IndexedDBKey() {
-}
-
-void IndexedDBKey::SetInvalid() {
- type_ = WebIDBKey::InvalidType;
-}
-
-void IndexedDBKey::SetArray(const std::vector<IndexedDBKey>& array) {
- type_ = WebIDBKey::ArrayType;
- array_ = array;
-}
-
-void IndexedDBKey::SetString(const string16& string) {
- type_ = WebIDBKey::StringType;
- string_ = string;
-}
-
-void IndexedDBKey::SetDate(double date) {
- type_ = WebIDBKey::DateType;
- date_ = date;
-}
-
-void IndexedDBKey::SetNumber(double number) {
- type_ = WebIDBKey::NumberType;
- number_ = number;
-}
-
-void IndexedDBKey::Set(const WebIDBKey& key) {
- type_ = key.type();
- array_.clear();
- if (key.type() == WebIDBKey::ArrayType) {
- for (size_t i = 0; i < key.array().size(); ++i) {
- array_.push_back(IndexedDBKey(key.array()[i]));
- }
- }
- string_ = key.type() == WebIDBKey::StringType ?
- static_cast<string16>(key.string()) : string16();
- number_ = key.type() == WebIDBKey::NumberType ? key.number() : 0;
- date_ = key.type() == WebIDBKey::DateType ? key.date() : 0;
-}
-
-IndexedDBKey::operator WebIDBKey() const {
- switch (type_) {
- case WebIDBKey::ArrayType:
- return WebIDBKey::createArray(array_);
- case WebIDBKey::StringType:
- return WebIDBKey::createString(string_);
- case WebIDBKey::DateType:
- return WebIDBKey::createDate(date_);
- case WebIDBKey::NumberType:
- return WebIDBKey::createNumber(number_);
- case WebIDBKey::InvalidType:
- return WebIDBKey::createInvalid();
- }
- NOTREACHED();
- return WebIDBKey::createInvalid();
-}
« no previous file with comments | « content/common/indexed_db_key.h ('k') | content/common/indexed_db_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698