Modified: trunk/Source/WebCore/ChangeLog (102288 => 102289)
--- trunk/Source/WebCore/ChangeLog 2011-12-08 01:19:47 UTC (rev 102288)
+++ trunk/Source/WebCore/ChangeLog 2011-12-08 01:33:29 UTC (rev 102289)
@@ -1,3 +1,20 @@
+2011-12-07 Joshua Bell <jsb...@chromium.org>
+
+ IndexedDB: Replace bool args in IDBKeyRange private methods with enum
+ https://bugs.webkit.org/show_bug.cgi?id=70743
+
+ Reviewed by Tony Chang.
+
+ No new tests - no functional changes.
+
+ * storage/IDBKeyRange.cpp:
+ (WebCore::IDBKeyRange::IDBKeyRange):
+ (WebCore::IDBKeyRange::bound):
+ * storage/IDBKeyRange.h:
+ (WebCore::IDBKeyRange::create):
+ (WebCore::IDBKeyRange::lowerOpen):
+ (WebCore::IDBKeyRange::upperOpen):
+
2011-12-07 Sheriff Bot <webkit.review....@gmail.com>
Unreviewed, rolling out r102267.
Modified: trunk/Source/WebCore/storage/IDBKeyRange.cpp (102288 => 102289)
--- trunk/Source/WebCore/storage/IDBKeyRange.cpp 2011-12-08 01:19:47 UTC (rev 102288)
+++ trunk/Source/WebCore/storage/IDBKeyRange.cpp 2011-12-08 01:33:29 UTC (rev 102289)
@@ -33,11 +33,11 @@
namespace WebCore {
-IDBKeyRange::IDBKeyRange(PassRefPtr<IDBKey> lower, PassRefPtr<IDBKey> upper, bool lowerOpen, bool upperOpen)
+IDBKeyRange::IDBKeyRange(PassRefPtr<IDBKey> lower, PassRefPtr<IDBKey> upper, LowerBoundType lowerType, UpperBoundType upperType)
: m_lower(lower)
, m_upper(upper)
- , m_lowerOpen(lowerOpen)
- , m_upperOpen(upperOpen)
+ , m_lowerType(lowerType)
+ , m_upperType(upperType)
{
}
@@ -49,7 +49,7 @@
return 0;
}
- return IDBKeyRange::create(key, key, false, false);
+ return IDBKeyRange::create(key, key, LowerBoundClosed, UpperBoundClosed);
}
PassRefPtr<IDBKeyRange> IDBKeyRange::lowerBound(PassRefPtr<IDBKey> bound, bool open, ExceptionCode& ec)
@@ -59,7 +59,7 @@
return 0;
}
- return IDBKeyRange::create(bound, 0, open, false);
+ return IDBKeyRange::create(bound, 0, open ? LowerBoundOpen : LowerBoundClosed, UpperBoundClosed);
}
PassRefPtr<IDBKeyRange> IDBKeyRange::upperBound(PassRefPtr<IDBKey> bound, bool open, ExceptionCode& ec)
@@ -69,7 +69,7 @@
return 0;
}
- return IDBKeyRange::create(0, bound, false, open);
+ return IDBKeyRange::create(0, bound, LowerBoundClosed, open ? UpperBoundOpen : UpperBoundClosed);
}
PassRefPtr<IDBKeyRange> IDBKeyRange::bound(PassRefPtr<IDBKey> lower, PassRefPtr<IDBKey> upper, bool lowerOpen, bool upperOpen, ExceptionCode& ec)
@@ -79,7 +79,7 @@
return 0;
}
- return IDBKeyRange::create(lower, upper, lowerOpen, upperOpen);
+ return IDBKeyRange::create(lower, upper, lowerOpen ? LowerBoundOpen : LowerBoundClosed, upperOpen ? UpperBoundOpen : UpperBoundClosed);
}
} // namespace WebCore
Modified: trunk/Source/WebCore/storage/IDBKeyRange.h (102288 => 102289)
--- trunk/Source/WebCore/storage/IDBKeyRange.h 2011-12-08 01:19:47 UTC (rev 102288)
+++ trunk/Source/WebCore/storage/IDBKeyRange.h 2011-12-08 01:33:29 UTC (rev 102289)
@@ -39,16 +39,25 @@
class IDBKeyRange : public ThreadSafeRefCounted<IDBKeyRange> {
public:
- static PassRefPtr<IDBKeyRange> create(PassRefPtr<IDBKey> lower, PassRefPtr<IDBKey> upper, bool lowerOpen, bool upperOpen)
+ enum LowerBoundType {
+ LowerBoundOpen,
+ LowerBoundClosed
+ };
+ enum UpperBoundType {
+ UpperBoundOpen,
+ UpperBoundClosed
+ };
+
+ static PassRefPtr<IDBKeyRange> create(PassRefPtr<IDBKey> lower, PassRefPtr<IDBKey> upper, LowerBoundType lowerType, UpperBoundType upperType)
{
- return adoptRef(new IDBKeyRange(lower, upper, lowerOpen, upperOpen));
+ return adoptRef(new IDBKeyRange(lower, upper, lowerType, upperType));
}
~IDBKeyRange() { }
PassRefPtr<IDBKey> lower() const { return m_lower; }
PassRefPtr<IDBKey> upper() const { return m_upper; }
- bool lowerOpen() const { return m_lowerOpen; }
- bool upperOpen() const { return m_upperOpen; }
+ bool lowerOpen() const { return m_lowerType == LowerBoundOpen; }
+ bool upperOpen() const { return m_upperType == UpperBoundOpen; }
static PassRefPtr<IDBKeyRange> only(PassRefPtr<IDBKey> value, ExceptionCode&);
@@ -75,12 +84,12 @@
static PassRefPtr<IDBKeyRange> bound(PassRefPtr<IDBKey> lower, PassRefPtr<IDBKey> upper, bool lowerOpen, bool upperOpen, ExceptionCode&);
private:
- IDBKeyRange(PassRefPtr<IDBKey> lower, PassRefPtr<IDBKey> upper, bool lowerOpen, bool upperOpen);
+ IDBKeyRange(PassRefPtr<IDBKey> lower, PassRefPtr<IDBKey> upper, LowerBoundType lowerType, UpperBoundType upperType);
RefPtr<IDBKey> m_lower;
RefPtr<IDBKey> m_upper;
- bool m_lowerOpen;
- bool m_upperOpen;
+ LowerBoundType m_lowerType;
+ UpperBoundType m_upperType;
};
} // namespace WebCore
Modified: trunk/Source/WebKit/chromium/src/WebIDBKeyRange.cpp (102288 => 102289)
--- trunk/Source/WebKit/chromium/src/WebIDBKeyRange.cpp 2011-12-08 01:19:47 UTC (rev 102288)
+++ trunk/Source/WebKit/chromium/src/WebIDBKeyRange.cpp 2011-12-08 01:33:29 UTC (rev 102289)
@@ -46,7 +46,7 @@
if (lower.type() == WebIDBKey::InvalidType && upper.type() == WebIDBKey::InvalidType)
m_private = 0;
else
- m_private = IDBKeyRange::create(lower, upper, lowerOpen, upperOpen);
+ m_private = IDBKeyRange::create(lower, upper, lowerOpen ? IDBKeyRange::LowerBoundOpen : IDBKeyRange::LowerBoundClosed, upperOpen ? IDBKeyRange::UpperBoundOpen : IDBKeyRange::UpperBoundClosed);
}
void WebIDBKeyRange::reset()