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

Side by Side Diff: content/common/indexed_db/indexed_db_key_path.cc

Issue 102593002: Convert string16 to base::string16 in content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/common/indexed_db/indexed_db_key_path.h" 5 #include "content/common/indexed_db/indexed_db_key_path.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace content { 9 namespace content {
10 10
11 using blink::WebIDBKeyPathTypeArray; 11 using blink::WebIDBKeyPathTypeArray;
12 using blink::WebIDBKeyPathTypeNull; 12 using blink::WebIDBKeyPathTypeNull;
13 using blink::WebIDBKeyPathTypeString; 13 using blink::WebIDBKeyPathTypeString;
14 14
15 IndexedDBKeyPath::IndexedDBKeyPath() : type_(WebIDBKeyPathTypeNull) {} 15 IndexedDBKeyPath::IndexedDBKeyPath() : type_(WebIDBKeyPathTypeNull) {}
16 16
17 IndexedDBKeyPath::IndexedDBKeyPath(const string16& string) 17 IndexedDBKeyPath::IndexedDBKeyPath(const base::string16& string)
18 : type_(WebIDBKeyPathTypeString), string_(string) {} 18 : type_(WebIDBKeyPathTypeString), string_(string) {}
19 19
20 IndexedDBKeyPath::IndexedDBKeyPath(const std::vector<string16>& array) 20 IndexedDBKeyPath::IndexedDBKeyPath(const std::vector<base::string16>& array)
21 : type_(WebIDBKeyPathTypeArray), array_(array) {} 21 : type_(WebIDBKeyPathTypeArray), array_(array) {}
22 22
23 IndexedDBKeyPath::~IndexedDBKeyPath() {} 23 IndexedDBKeyPath::~IndexedDBKeyPath() {}
24 24
25 const std::vector<string16>& IndexedDBKeyPath::array() const { 25 const std::vector<base::string16>& IndexedDBKeyPath::array() const {
26 DCHECK(type_ == blink::WebIDBKeyPathTypeArray); 26 DCHECK(type_ == blink::WebIDBKeyPathTypeArray);
27 return array_; 27 return array_;
28 } 28 }
29 29
30 const string16& IndexedDBKeyPath::string() const { 30 const base::string16& IndexedDBKeyPath::string() const {
31 DCHECK(type_ == blink::WebIDBKeyPathTypeString); 31 DCHECK(type_ == blink::WebIDBKeyPathTypeString);
32 return string_; 32 return string_;
33 } 33 }
34 34
35 bool IndexedDBKeyPath::operator==(const IndexedDBKeyPath& other) const { 35 bool IndexedDBKeyPath::operator==(const IndexedDBKeyPath& other) const {
36 if (type_ != other.type_) 36 if (type_ != other.type_)
37 return false; 37 return false;
38 38
39 switch (type_) { 39 switch (type_) {
40 case WebIDBKeyPathTypeNull: 40 case WebIDBKeyPathTypeNull:
41 return true; 41 return true;
42 case WebIDBKeyPathTypeString: 42 case WebIDBKeyPathTypeString:
43 return string_ == other.string_; 43 return string_ == other.string_;
44 case WebIDBKeyPathTypeArray: 44 case WebIDBKeyPathTypeArray:
45 return array_ == other.array_; 45 return array_ == other.array_;
46 } 46 }
47 NOTREACHED(); 47 NOTREACHED();
48 return false; 48 return false;
49 } 49 }
50 50
51 } // namespace content 51 } // namespace content
OLDNEW
« no previous file with comments | « content/common/indexed_db/indexed_db_key_path.h ('k') | content/common/indexed_db/indexed_db_key_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698