| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 enum UpperBoundType { | 45 enum UpperBoundType { |
| 46 UpperBoundOpen, | 46 UpperBoundOpen, |
| 47 UpperBoundClosed | 47 UpperBoundClosed |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 static PassRefPtr<IDBKeyRange> create(PassRefPtr<IDBKey> lower, PassRefPtr<I
DBKey> upper, LowerBoundType lowerType, UpperBoundType upperType) | 50 static PassRefPtr<IDBKeyRange> create(PassRefPtr<IDBKey> lower, PassRefPtr<I
DBKey> upper, LowerBoundType lowerType, UpperBoundType upperType) |
| 51 { | 51 { |
| 52 return adoptRef(new IDBKeyRange(lower, upper, lowerType, upperType)); | 52 return adoptRef(new IDBKeyRange(lower, upper, lowerType, upperType)); |
| 53 } | 53 } |
| 54 static PassRefPtr<IDBKeyRange> create(PassRefPtr<IDBKey> prpKey); | 54 static PassRefPtr<IDBKeyRange> create(PassRefPtr<IDBKey> prpKey); |
| 55 |
| 56 // Null if the script value is null or undefined, the range if it is one, ot
herwise tries to convert to a key and throws if it fails. |
| 57 static PassRefPtr<IDBKeyRange> fromScriptValue(ScriptExecutionContext*, cons
t ScriptValue&, ExceptionState&); |
| 58 |
| 55 ~IDBKeyRange() { } | 59 ~IDBKeyRange() { } |
| 56 | 60 |
| 57 // Implement the IDBKeyRange IDL | 61 // Implement the IDBKeyRange IDL |
| 58 PassRefPtr<IDBKey> lower() const { return m_lower; } | 62 PassRefPtr<IDBKey> lower() const { return m_lower; } |
| 59 PassRefPtr<IDBKey> upper() const { return m_upper; } | 63 PassRefPtr<IDBKey> upper() const { return m_upper; } |
| 60 | 64 |
| 61 ScriptValue lowerValue(ScriptExecutionContext*) const; | 65 ScriptValue lowerValue(ScriptExecutionContext*) const; |
| 62 ScriptValue upperValue(ScriptExecutionContext*) const; | 66 ScriptValue upperValue(ScriptExecutionContext*) const; |
| 63 bool lowerOpen() const { return m_lowerType == LowerBoundOpen; } | 67 bool lowerOpen() const { return m_lowerType == LowerBoundOpen; } |
| 64 bool upperOpen() const { return m_upperType == UpperBoundOpen; } | 68 bool upperOpen() const { return m_upperType == UpperBoundOpen; } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 77 | 81 |
| 78 RefPtr<IDBKey> m_lower; | 82 RefPtr<IDBKey> m_lower; |
| 79 RefPtr<IDBKey> m_upper; | 83 RefPtr<IDBKey> m_upper; |
| 80 LowerBoundType m_lowerType; | 84 LowerBoundType m_lowerType; |
| 81 UpperBoundType m_upperType; | 85 UpperBoundType m_upperType; |
| 82 }; | 86 }; |
| 83 | 87 |
| 84 } // namespace WebCore | 88 } // namespace WebCore |
| 85 | 89 |
| 86 #endif // IDBKeyRange_h | 90 #endif // IDBKeyRange_h |
| OLD | NEW |