mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-18 15:55:36 +00:00
Bug 1168606 - Removed unused methods in IDBKeyRange. r=ttung,asuth
The functionality has been moved to DatabaseOperationBase::BindKeyRangeToStatement resp. DatabaseOperationBase::GetBindingClauseForKeyRange as part of Bug 994190. Differential Revision: https://phabricator.services.mozilla.com/D41024 --HG-- extra : amend_source : 2c58011d334a35e808e93c1876080db5f83ee659
This commit is contained in:
parent
603ae52908
commit
ffe8213b8d
@ -115,72 +115,6 @@ void IDBKeyRange::ToSerialized(SerializedKeyRange& aKeyRange) const {
|
||||
}
|
||||
}
|
||||
|
||||
void IDBKeyRange::GetBindingClause(const nsACString& aKeyColumnName,
|
||||
nsACString& _retval) const {
|
||||
NS_NAMED_LITERAL_CSTRING(andStr, " AND ");
|
||||
NS_NAMED_LITERAL_CSTRING(spacecolon, " :");
|
||||
NS_NAMED_LITERAL_CSTRING(lowerKey, "lower_key");
|
||||
|
||||
if (IsOnly()) {
|
||||
// Both keys are set and they're equal.
|
||||
_retval = andStr + aKeyColumnName + NS_LITERAL_CSTRING(" =") + spacecolon +
|
||||
lowerKey;
|
||||
return;
|
||||
}
|
||||
|
||||
nsAutoCString clause;
|
||||
|
||||
if (!Lower().IsUnset()) {
|
||||
// Lower key is set.
|
||||
clause.Append(andStr + aKeyColumnName);
|
||||
clause.AppendLiteral(" >");
|
||||
if (!LowerOpen()) {
|
||||
clause.Append('=');
|
||||
}
|
||||
clause.Append(spacecolon + lowerKey);
|
||||
}
|
||||
|
||||
if (!Upper().IsUnset()) {
|
||||
// Upper key is set.
|
||||
clause.Append(andStr + aKeyColumnName);
|
||||
clause.AppendLiteral(" <");
|
||||
if (!UpperOpen()) {
|
||||
clause.Append('=');
|
||||
}
|
||||
clause.Append(spacecolon + NS_LITERAL_CSTRING("upper_key"));
|
||||
}
|
||||
|
||||
_retval = clause;
|
||||
}
|
||||
|
||||
nsresult IDBKeyRange::BindToStatement(mozIStorageStatement* aStatement) const {
|
||||
MOZ_ASSERT(aStatement);
|
||||
|
||||
NS_NAMED_LITERAL_CSTRING(lowerKey, "lower_key");
|
||||
|
||||
if (IsOnly()) {
|
||||
return Lower().BindToStatement(aStatement, lowerKey);
|
||||
}
|
||||
|
||||
nsresult rv;
|
||||
|
||||
if (!Lower().IsUnset()) {
|
||||
rv = Lower().BindToStatement(aStatement, lowerKey);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
if (!Upper().IsUnset()) {
|
||||
rv = Upper().BindToStatement(aStatement, NS_LITERAL_CSTRING("upper_key"));
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(IDBKeyRange)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(IDBKeyRange)
|
||||
|
@ -92,11 +92,6 @@ class IDBKeyRange : public nsISupports {
|
||||
|
||||
bool IsOnly() const { return mIsOnly; }
|
||||
|
||||
void GetBindingClause(const nsACString& aKeyColumnName,
|
||||
nsACString& _retval) const;
|
||||
|
||||
nsresult BindToStatement(mozIStorageStatement* aStatement) const;
|
||||
|
||||
void DropJSObjects();
|
||||
|
||||
// WebIDL
|
||||
|
Loading…
Reference in New Issue
Block a user