| OLD | NEW |
| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 explicit IDBKeyPath(const StringOrStringSequence& key_path); | 54 explicit IDBKeyPath(const StringOrStringSequence& key_path); |
| 55 IDBKeyPath(const WebIDBKeyPath&); | 55 IDBKeyPath(const WebIDBKeyPath&); |
| 56 | 56 |
| 57 operator WebIDBKeyPath() const; | 57 operator WebIDBKeyPath() const; |
| 58 | 58 |
| 59 enum Type { kNullType = 0, kStringType, kArrayType }; | 59 enum Type { kNullType = 0, kStringType, kArrayType }; |
| 60 | 60 |
| 61 Type GetType() const { return type_; } | 61 Type GetType() const { return type_; } |
| 62 | 62 |
| 63 const Vector<String>& Array() const { | 63 const Vector<String>& Array() const { |
| 64 ASSERT(type_ == kArrayType); | 64 DCHECK_EQ(type_, kArrayType); |
| 65 return array_; | 65 return array_; |
| 66 } | 66 } |
| 67 | 67 |
| 68 const String& GetString() const { | 68 const String& GetString() const { |
| 69 ASSERT(type_ == kStringType); | 69 DCHECK_EQ(type_, kStringType); |
| 70 return string_; | 70 return string_; |
| 71 } | 71 } |
| 72 | 72 |
| 73 bool IsNull() const { return type_ == kNullType; } | 73 bool IsNull() const { return type_ == kNullType; } |
| 74 bool IsValid() const; | 74 bool IsValid() const; |
| 75 bool operator==(const IDBKeyPath& other) const; | 75 bool operator==(const IDBKeyPath& other) const; |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 Type type_; | 78 Type type_; |
| 79 String string_; | 79 String string_; |
| 80 Vector<String> array_; | 80 Vector<String> array_; |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 } // namespace blink | 83 } // namespace blink |
| 84 | 84 |
| 85 #endif // IDBKeyPath_h | 85 #endif // IDBKeyPath_h |
| OLD | NEW |