Bug 1130452 - Remove support for the prefixMatch option in the service worker cache code; r=bkelly,baku
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 05 Mar 2015 17:29:24 -0500
changeset 232224 43d4db7da2d6b7840abf3aea5a0e84df4e0789ae
parent 232223 97ab1c1874753b58cfe70860a269565670414807
child 232225 a3e39b781d24dd42d0e0cfdbc54b4244f88a978e
push id56490
push usereakhgari@mozilla.com
push dateFri, 06 Mar 2015 13:20:22 +0000
treeherdermozilla-inbound@f827206d7840 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly, baku
bugs1130452
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1130452 - Remove support for the prefixMatch option in the service worker cache code; r=bkelly,baku
dom/cache/DBSchema.cpp
dom/cache/PCacheTypes.ipdlh
dom/cache/TypeUtils.cpp
dom/webidl/Cache.webidl
--- a/dom/cache/DBSchema.cpp
+++ b/dom/cache/DBSchema.cpp
@@ -334,17 +334,17 @@ DBSchema::CachePut(mozIStorageConnection
                    const nsID* aRequestBodyId,
                    const PCacheResponse& aResponse,
                    const nsID* aResponseBodyId,
                    nsTArray<nsID>& aDeletedBodyIdListOut)
 {
   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);
   if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
   rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut);
   if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
@@ -670,39 +670,25 @@ DBSchema::QueryCache(mozIStorageConnecti
   if (aParams.ignoreSearch()) {
     urlToMatch = aRequest.urlWithoutQuery();
     query.AppendLiteral("request_url_no_query");
   } else {
     urlToMatch = aRequest.url();
     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));
   if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
   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; }
 
   bool hasMoreData = false;
   while (NS_SUCCEEDED(state->ExecuteStep(&hasMoreData)) && hasMoreData) {
     // no invalid EntryId, init to least likely real value
     EntryId entryId = INT32_MAX;
     rv = state->GetInt32(0, &entryId);
--- a/dom/cache/PCacheTypes.ipdlh
+++ b/dom/cache/PCacheTypes.ipdlh
@@ -17,17 +17,16 @@ namespace mozilla {
 namespace dom {
 namespace cache {
 
 struct PCacheQueryParams
 {
   bool ignoreSearch;
   bool ignoreMethod;
   bool ignoreVary;
-  bool prefixMatch;
   bool cacheNameSet;
   nsString cacheName;
 };
 
 struct PCacheReadStream
 {
   nsID id;
   OptionalInputStreamParams params;
--- a/dom/cache/TypeUtils.cpp
+++ b/dom/cache/TypeUtils.cpp
@@ -261,17 +261,16 @@ TypeUtils::ToPCacheResponse(PCacheRespon
 // static
 void
 TypeUtils::ToPCacheQueryParams(PCacheQueryParams& aOut,
                                const CacheQueryOptions& aIn)
 {
   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();
   } else {
     aOut.cacheName() = NS_LITERAL_STRING("");
   }
 }
 
--- a/dom/webidl/Cache.webidl
+++ b/dom/webidl/Cache.webidl
@@ -28,17 +28,16 @@ Promise<boolean> delete(RequestInfo requ
 [Throws]
 Promise<sequence<Request>> keys(optional RequestInfo request, optional CacheQueryOptions options);
 };
 
 dictionary CacheQueryOptions {
 boolean ignoreSearch = false;
 boolean ignoreMethod = false;
 boolean ignoreVary = false;
-boolean prefixMatch = false;
 DOMString cacheName;
 };
 
 dictionary CacheBatchOperation {
 DOMString type;
 Request request;
 Response response;
 CacheQueryOptions options;