| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 13 matching lines...) Expand all Loading... |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "public/platform/WebIDBKeyPath.h" | 27 #include "public/platform/WebIDBKeyPath.h" |
| 28 | 28 |
| 29 #include "modules/indexeddb/IDBKeyPath.h" | 29 #include "modules/indexeddb/IDBKeyPath.h" |
| 30 #include "public/platform/WebString.h" | 30 #include "public/platform/WebString.h" |
| 31 #include "public/platform/WebVector.h" | 31 #include "public/platform/WebVector.h" |
| 32 #include "wtf/Vector.h" | 32 #include "wtf/Vector.h" |
| 33 | 33 |
| 34 using namespace blink; | |
| 35 | |
| 36 namespace blink { | 34 namespace blink { |
| 37 | 35 |
| 38 WebIDBKeyPath WebIDBKeyPath::create(const WebString& keyPath) | 36 WebIDBKeyPath WebIDBKeyPath::create(const WebString& keyPath) |
| 39 { | 37 { |
| 40 return WebIDBKeyPath(IDBKeyPath(keyPath)); | 38 return WebIDBKeyPath(IDBKeyPath(keyPath)); |
| 41 } | 39 } |
| 42 | 40 |
| 43 WebIDBKeyPath WebIDBKeyPath::create(const WebVector<WebString>& keyPath) | 41 WebIDBKeyPath WebIDBKeyPath::create(const WebVector<WebString>& keyPath) |
| 44 { | 42 { |
| 45 Vector<String> strings; | 43 Vector<String> strings; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 return m_private->array(); | 81 return m_private->array(); |
| 84 } | 82 } |
| 85 | 83 |
| 86 WebString WebIDBKeyPath::string() const | 84 WebString WebIDBKeyPath::string() const |
| 87 { | 85 { |
| 88 ASSERT(m_private.get()); | 86 ASSERT(m_private.get()); |
| 89 ASSERT(m_private->type() == IDBKeyPath::StringType); | 87 ASSERT(m_private->type() == IDBKeyPath::StringType); |
| 90 return m_private->string(); | 88 return m_private->string(); |
| 91 } | 89 } |
| 92 | 90 |
| 93 WebIDBKeyPath::WebIDBKeyPath(const blink::IDBKeyPath& value) | 91 WebIDBKeyPath::WebIDBKeyPath(const IDBKeyPath& value) |
| 94 : m_private(new IDBKeyPath(value)) | 92 : m_private(new IDBKeyPath(value)) |
| 95 { | 93 { |
| 96 ASSERT(m_private.get()); | 94 ASSERT(m_private.get()); |
| 97 } | 95 } |
| 98 | 96 |
| 99 WebIDBKeyPath& WebIDBKeyPath::operator=(const blink::IDBKeyPath& value) | 97 WebIDBKeyPath& WebIDBKeyPath::operator=(const IDBKeyPath& value) |
| 100 { | 98 { |
| 101 ASSERT(m_private.get()); | 99 ASSERT(m_private.get()); |
| 102 m_private.reset(new IDBKeyPath(value)); | 100 m_private.reset(new IDBKeyPath(value)); |
| 103 return *this; | 101 return *this; |
| 104 } | 102 } |
| 105 | 103 |
| 106 WebIDBKeyPath::operator const blink::IDBKeyPath&() const | 104 WebIDBKeyPath::operator const IDBKeyPath&() const |
| 107 { | 105 { |
| 108 ASSERT(m_private.get()); | 106 ASSERT(m_private.get()); |
| 109 return *(m_private.get()); | 107 return *(m_private.get()); |
| 110 } | 108 } |
| 111 | 109 |
| 112 } // namespace blink | 110 } // namespace blink |
| OLD | NEW |