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

Side by Side Diff: third_party/WebKit/Source/modules/indexeddb/IDBKeyPath.cpp

Issue 2640163004: Replace ENABLE(ASSERT) with DCHECK_IS_ON(). (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 error = IDBKeyPathParseErrorNone; 99 error = IDBKeyPathParseErrorNone;
100 } 100 }
101 101
102 IDBKeyPath::IDBKeyPath(const String& string) 102 IDBKeyPath::IDBKeyPath(const String& string)
103 : m_type(StringType), m_string(string) { 103 : m_type(StringType), m_string(string) {
104 ASSERT(!m_string.isNull()); 104 ASSERT(!m_string.isNull());
105 } 105 }
106 106
107 IDBKeyPath::IDBKeyPath(const Vector<String>& array) 107 IDBKeyPath::IDBKeyPath(const Vector<String>& array)
108 : m_type(ArrayType), m_array(array) { 108 : m_type(ArrayType), m_array(array) {
109 #if ENABLE(ASSERT) 109 #if DCHECK_IS_ON()
110 for (size_t i = 0; i < m_array.size(); ++i) 110 for (size_t i = 0; i < m_array.size(); ++i)
111 ASSERT(!m_array[i].isNull()); 111 ASSERT(!m_array[i].isNull());
112 #endif 112 #endif
113 } 113 }
114 114
115 IDBKeyPath::IDBKeyPath(const StringOrStringSequence& keyPath) { 115 IDBKeyPath::IDBKeyPath(const StringOrStringSequence& keyPath) {
116 if (keyPath.isNull()) { 116 if (keyPath.isNull()) {
117 m_type = NullType; 117 m_type = NullType;
118 } else if (keyPath.isString()) { 118 } else if (keyPath.isString()) {
119 m_type = StringType; 119 m_type = StringType;
120 m_string = keyPath.getAsString(); 120 m_string = keyPath.getAsString();
121 ASSERT(!m_string.isNull()); 121 ASSERT(!m_string.isNull());
122 } else { 122 } else {
123 ASSERT(keyPath.isStringSequence()); 123 ASSERT(keyPath.isStringSequence());
124 m_type = ArrayType; 124 m_type = ArrayType;
125 m_array = keyPath.getAsStringSequence(); 125 m_array = keyPath.getAsStringSequence();
126 #if ENABLE(ASSERT) 126 #if DCHECK_IS_ON()
127 for (size_t i = 0; i < m_array.size(); ++i) 127 for (size_t i = 0; i < m_array.size(); ++i)
128 ASSERT(!m_array[i].isNull()); 128 ASSERT(!m_array[i].isNull());
129 #endif 129 #endif
130 } 130 }
131 } 131 }
132 132
133 IDBKeyPath::IDBKeyPath(const WebIDBKeyPath& keyPath) { 133 IDBKeyPath::IDBKeyPath(const WebIDBKeyPath& keyPath) {
134 switch (keyPath.keyPathType()) { 134 switch (keyPath.keyPathType()) {
135 case WebIDBKeyPathTypeNull: 135 case WebIDBKeyPathTypeNull:
136 m_type = NullType; 136 m_type = NullType;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 case StringType: 194 case StringType:
195 return m_string == other.m_string; 195 return m_string == other.m_string;
196 case ArrayType: 196 case ArrayType:
197 return m_array == other.m_array; 197 return m_array == other.m_array;
198 } 198 }
199 ASSERT_NOT_REACHED(); 199 ASSERT_NOT_REACHED();
200 return false; 200 return false;
201 } 201 }
202 202
203 } // namespace blink 203 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698