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

Side by Side Diff: chrome/common/indexed_db_key.cc

Issue 5727002: IndexedDB: Preparatory patch for https://bugs.webkit.org/show_bug.cgi?id=50674 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/indexed_db_key.h" 5 #include "chrome/common/indexed_db_key.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" 8 #include "third_party/WebKit/WebKit/chromium/public/WebString.h"
9 9
10 using WebKit::WebIDBKey; 10 using WebKit::WebIDBKey;
(...skipping 25 matching lines...) Expand all
36 36
37 void IndexedDBKey::Set(int32_t number) { 37 void IndexedDBKey::Set(int32_t number) {
38 type_ = WebIDBKey::NumberType; 38 type_ = WebIDBKey::NumberType;
39 number_ = number; 39 number_ = number;
40 } 40 }
41 41
42 void IndexedDBKey::Set(const WebIDBKey& key) { 42 void IndexedDBKey::Set(const WebIDBKey& key) {
43 type_ = key.type(); 43 type_ = key.type();
44 string_ = key.type() == WebIDBKey::StringType ? 44 string_ = key.type() == WebIDBKey::StringType ?
45 static_cast<string16>(key.string()) : string16(); 45 static_cast<string16>(key.string()) : string16();
46 number_ = key.type() == WebIDBKey::NumberType ? key.number() : 0; 46 number_ = key.type() == WebIDBKey::NumberType ?
47 static_cast<int32_t>(key.number()) : 0;
47 } 48 }
48 49
49 IndexedDBKey::operator WebIDBKey() const { 50 IndexedDBKey::operator WebIDBKey() const {
50 switch (type_) { 51 switch (type_) {
51 case WebIDBKey::NullType: 52 case WebIDBKey::NullType:
52 return WebIDBKey::createNull(); 53 return WebIDBKey::createNull();
53 case WebIDBKey::StringType: 54 case WebIDBKey::StringType:
54 return WebIDBKey(string_); 55 return WebIDBKey(string_);
55 case WebIDBKey::NumberType: 56 case WebIDBKey::NumberType:
56 return WebIDBKey(number_); 57 return WebIDBKey(number_);
57 case WebIDBKey::InvalidType: 58 case WebIDBKey::InvalidType:
58 return WebIDBKey::createInvalid(); 59 return WebIDBKey::createInvalid();
59 } 60 }
60 NOTREACHED(); 61 NOTREACHED();
61 return WebIDBKey::createInvalid(); 62 return WebIDBKey::createInvalid();
62 } 63 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698