Bug 1130452 - Remove support for the prefixMatch option in the service worker cache code; r=bkelly,baku

This commit is contained in:
Ehsan Akhgari 2015-03-05 17:29:24 -05:00
parent 1c6f45d117
commit f3ede7f37e
4 changed files with 2 additions and 19 deletions

View File

@ -339,7 +339,7 @@ DBSchema::CachePut(mozIStorageConnection* aConn, CacheId aCacheId,
MOZ_ASSERT(!NS_IsMainThread());
MOZ_ASSERT(aConn);
PCacheQueryParams params(false, false, false, false, false,
PCacheQueryParams params(false, false, false, false,
NS_LITERAL_STRING(""));
nsAutoTArray<EntryId, 256> matches;
nsresult rv = QueryCache(aConn, aCacheId, aRequest, params, matches);
@ -675,13 +675,7 @@ DBSchema::QueryCache(mozIStorageConnection* aConn, CacheId aCacheId,
query.AppendLiteral("request_url");
}
if (aParams.prefixMatch()) {
query.AppendLiteral(" LIKE ?2 ESCAPE '\\'");
} else {
query.AppendLiteral("=?2");
}
query.AppendLiteral(" GROUP BY entries.id ORDER BY entries.id;");
query.AppendLiteral("=?2 GROUP BY entries.id ORDER BY entries.id;");
nsCOMPtr<mozIStorageStatement> state;
nsresult rv = aConn->CreateStatement(query, getter_AddRefs(state));
@ -690,14 +684,6 @@ DBSchema::QueryCache(mozIStorageConnection* aConn, CacheId aCacheId,
rv = state->BindInt32Parameter(0, aCacheId);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
if (aParams.prefixMatch()) {
nsAutoString escapedUrlToMatch;
rv = state->EscapeStringForLIKE(urlToMatch, '\\', escapedUrlToMatch);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
urlToMatch = escapedUrlToMatch;
urlToMatch.AppendLiteral("%");
}
rv = state->BindStringParameter(1, urlToMatch);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }

View File

@ -22,7 +22,6 @@ struct PCacheQueryParams
bool ignoreSearch;
bool ignoreMethod;
bool ignoreVary;
bool prefixMatch;
bool cacheNameSet;
nsString cacheName;
};

View File

@ -266,7 +266,6 @@ TypeUtils::ToPCacheQueryParams(PCacheQueryParams& aOut,
aOut.ignoreSearch() = aIn.mIgnoreSearch;
aOut.ignoreMethod() = aIn.mIgnoreMethod;
aOut.ignoreVary() = aIn.mIgnoreVary;
aOut.prefixMatch() = aIn.mPrefixMatch;
aOut.cacheNameSet() = aIn.mCacheName.WasPassed();
if (aOut.cacheNameSet()) {
aOut.cacheName() = aIn.mCacheName.Value();

View File

@ -33,7 +33,6 @@ dictionary CacheQueryOptions {
boolean ignoreSearch = false;
boolean ignoreMethod = false;
boolean ignoreVary = false;
boolean prefixMatch = false;
DOMString cacheName;
};