Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2155)

Unified Diff: Source/modules/serviceworkers/Cache.cpp

Issue 546153002: Patch on top of https://codereview.chromium.org/433793002/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/serviceworkers/Cache.h ('k') | Source/modules/serviceworkers/CacheTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/serviceworkers/Cache.cpp
diff --git a/Source/modules/serviceworkers/Cache.cpp b/Source/modules/serviceworkers/Cache.cpp
index 63b72c5254a34ca47aa9b0fff57fd1e2f9fdf0c8..58a22d4e686072762b0238068a3b9780a6fea800 100644
--- a/Source/modules/serviceworkers/Cache.cpp
+++ b/Source/modules/serviceworkers/Cache.cpp
@@ -63,7 +63,7 @@ public:
virtual void onSuccess(WebVector<WebServiceWorkerResponse>* webResponses) OVERRIDE
{
- Vector<RefPtrWillBeRawPtr<Response> > responses;
+ Vector<Response*> responses;
for (size_t i = 0; i < webResponses->size(); ++i)
responses.append(Response::create((*webResponses)[i]));
m_resolver->resolve(responses);
@@ -88,7 +88,7 @@ public:
virtual void onSuccess(WebVector<WebServiceWorkerRequest>* webRequests) OVERRIDE
{
- Vector<RefPtrWillBeRawPtr<Request> > requests;
+ Vector<Request*> requests;
for (size_t i = 0; i < webRequests->size(); ++i)
requests.append(Request::create((*webRequests)[i]));
m_resolver->resolve(requests);
@@ -124,10 +124,10 @@ Cache* Cache::fromWebServiceWorkerCache(WebServiceWorkerCache* webCache)
return create(webCache);
}
-ScriptPromise Cache::match(ScriptState* scriptState, Request* originalRequest, const Dictionary& queryParamsDict)
+ScriptPromise Cache::match(ScriptState* scriptState, const Request* originalRequest, const Dictionary& queryParamsDict)
{
TrackExceptionState exceptionState;
- RefPtrWillBeRawPtr<Request> request = Request::create(scriptState->executionContext(), originalRequest, exceptionState);
+ Request* request = Request::create(scriptState->executionContext(), originalRequest, exceptionState);
if (exceptionState.hadException())
return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFound);
return matchImpl(scriptState, request, queryParamsDict);
@@ -136,16 +136,16 @@ ScriptPromise Cache::match(ScriptState* scriptState, Request* originalRequest, c
ScriptPromise Cache::match(ScriptState* scriptState, const String& requestString, const Dictionary& queryParamsDict)
{
TrackExceptionState exceptionState;
- RefPtrWillBeRawPtr<Request> request = Request::create(scriptState->executionContext(), requestString, exceptionState);
+ Request* request = Request::create(scriptState->executionContext(), requestString, exceptionState);
if (exceptionState.hadException())
return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFound);
return matchImpl(scriptState, request, queryParamsDict);
}
-ScriptPromise Cache::matchAll(ScriptState* scriptState, Request* originalRequest, const Dictionary& queryParamsDict)
+ScriptPromise Cache::matchAll(ScriptState* scriptState, const Request* originalRequest, const Dictionary& queryParamsDict)
{
TrackExceptionState exceptionState;
- RefPtrWillBeRawPtr<Request> request = Request::create(scriptState->executionContext(), originalRequest, exceptionState);
+ Request* request = Request::create(scriptState->executionContext(), originalRequest, exceptionState);
if (exceptionState.hadException())
return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFound);
return matchAllImpl(scriptState, request, queryParamsDict);
@@ -154,16 +154,16 @@ ScriptPromise Cache::matchAll(ScriptState* scriptState, Request* originalRequest
ScriptPromise Cache::matchAll(ScriptState* scriptState, const String& requestString, const Dictionary& queryParamsDict)
{
TrackExceptionState exceptionState;
- RefPtrWillBeRawPtr<Request> request = Request::create(scriptState->executionContext(), requestString, exceptionState);
+ Request* request = Request::create(scriptState->executionContext(), requestString, exceptionState);
if (exceptionState.hadException())
return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFound);
return matchAllImpl(scriptState, request, queryParamsDict);
}
-ScriptPromise Cache::add(ScriptState* scriptState, Request* originalRequest)
+ScriptPromise Cache::add(ScriptState* scriptState, const Request* originalRequest)
{
TrackExceptionState exceptionState;
- RefPtrWillBeRawPtr<Request> request = Request::create(scriptState->executionContext(), originalRequest, exceptionState);
+ Request* request = Request::create(scriptState->executionContext(), originalRequest, exceptionState);
if (exceptionState.hadException())
return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFound);
return addImpl(scriptState, request);
@@ -172,7 +172,7 @@ ScriptPromise Cache::add(ScriptState* scriptState, Request* originalRequest)
ScriptPromise Cache::add(ScriptState* scriptState, const String& requestString)
{
TrackExceptionState exceptionState;
- RefPtrWillBeRawPtr<Request> request = Request::create(scriptState->executionContext(), requestString, exceptionState);
+ Request* request = Request::create(scriptState->executionContext(), requestString, exceptionState);
if (exceptionState.hadException())
return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFound);
return addImpl(scriptState, request);
@@ -184,10 +184,10 @@ ScriptPromise Cache::addAll(ScriptState* scriptState, const Vector<ScriptValue>&
return rejectAsNotImplemented(scriptState);
}
-ScriptPromise Cache::deleteFunction(ScriptState* scriptState, Request* originalRequest, const Dictionary& queryParamsDict)
+ScriptPromise Cache::deleteFunction(ScriptState* scriptState, const Request* originalRequest, const Dictionary& queryParamsDict)
{
TrackExceptionState exceptionState;
- RefPtrWillBeRawPtr<Request> request = Request::create(scriptState->executionContext(), originalRequest, exceptionState);
+ Request* request = Request::create(scriptState->executionContext(), originalRequest, exceptionState);
if (exceptionState.hadException())
return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFound);
return deleteImpl(scriptState, request, queryParamsDict);
@@ -196,25 +196,25 @@ ScriptPromise Cache::deleteFunction(ScriptState* scriptState, Request* originalR
ScriptPromise Cache::deleteFunction(ScriptState* scriptState, const String& requestString, const Dictionary& queryParamsDict)
{
TrackExceptionState exceptionState;
- RefPtrWillBeRawPtr<Request> request = Request::create(scriptState->executionContext(), requestString, exceptionState);
+ Request* request = Request::create(scriptState->executionContext(), requestString, exceptionState);
if (exceptionState.hadException())
return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFound);
return deleteImpl(scriptState, request, queryParamsDict);
}
-ScriptPromise Cache::put(ScriptState* scriptState, Request* originalRequest, Response* response)
+ScriptPromise Cache::put(ScriptState* scriptState, const Request* originalRequest, const Response* response)
{
TrackExceptionState exceptionState;
- RefPtrWillBeRawPtr<Request> request = Request::create(scriptState->executionContext(), originalRequest, exceptionState);
+ Request* request = Request::create(scriptState->executionContext(), originalRequest, exceptionState);
if (exceptionState.hadException())
return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFound);
return putImpl(scriptState, request, response);
}
-ScriptPromise Cache::put(ScriptState* scriptState, const String& requestString, Response* response)
+ScriptPromise Cache::put(ScriptState* scriptState, const String& requestString, const Response* response)
{
TrackExceptionState exceptionState;
- RefPtrWillBeRawPtr<Request> request = Request::create(scriptState->executionContext(), requestString, exceptionState);
+ Request* request = Request::create(scriptState->executionContext(), requestString, exceptionState);
if (exceptionState.hadException())
return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFound);
return putImpl(scriptState, request, response);
@@ -225,19 +225,19 @@ ScriptPromise Cache::keys(ScriptState* scriptState)
return keysImpl(scriptState);
}
-ScriptPromise Cache::keys(ScriptState* scriptState, Request* originalRequest, const Dictionary& queryParamsDict)
+ScriptPromise Cache::keys(ScriptState* scriptState, const Request* originalRequest, const Dictionary& queryParamsDict)
{
TrackExceptionState exceptionState;
- RefPtrWillBeRawPtr<Request> request = Request::create(scriptState->executionContext(), originalRequest, exceptionState);
+ Request* request = Request::create(scriptState->executionContext(), originalRequest, exceptionState);
if (exceptionState.hadException())
return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFound);
- return keysImpl(scriptState);
+ return keysImpl(scriptState, request, queryParamsDict);
}
ScriptPromise Cache::keys(ScriptState* scriptState, const String& requestString, const Dictionary& queryParamsDict)
{
TrackExceptionState exceptionState;
- RefPtrWillBeRawPtr<Request> request = Request::create(scriptState->executionContext(), requestString, exceptionState);
+ Request* request = Request::create(scriptState->executionContext(), requestString, exceptionState);
if (exceptionState.hadException())
return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFound);
return keysImpl(scriptState, request, queryParamsDict);
@@ -251,12 +251,12 @@ Cache::Cache(WebServiceWorkerCache* webCache)
m_webCache->setProxyInterface(this);
}
-PassRefPtrWillBeRawPtr<Cache> Cache::create(WebServiceWorkerCache* webCache)
+Cache* Cache::create(WebServiceWorkerCache* webCache)
{
- return adoptRefWillBeNoop(new Cache(webCache));
+ return new Cache(webCache);
}
-ScriptPromise Cache::matchImpl(ScriptState* scriptState, PassRefPtrWillBeRawPtr<Request> request, const Dictionary& queryParamsDict)
+ScriptPromise Cache::matchImpl(ScriptState* scriptState, Request* request, const Dictionary& queryParamsDict)
{
WebServiceWorkerRequest webRequest;
request->populateWebServiceWorkerRequest(webRequest);
@@ -267,7 +267,7 @@ ScriptPromise Cache::matchImpl(ScriptState* scriptState, PassRefPtrWillBeRawPtr<
return promise;
}
-ScriptPromise Cache::matchAllImpl(ScriptState* scriptState, PassRefPtrWillBeRawPtr<Request> request, const Dictionary& queryParamsDict)
+ScriptPromise Cache::matchAllImpl(ScriptState* scriptState, Request* request, const Dictionary& queryParamsDict)
{
WebServiceWorkerRequest webRequest;
request->populateWebServiceWorkerRequest(webRequest);
@@ -278,13 +278,13 @@ ScriptPromise Cache::matchAllImpl(ScriptState* scriptState, PassRefPtrWillBeRawP
return promise;
}
-ScriptPromise Cache::addImpl(ScriptState* scriptState, PassRefPtrWillBeRawPtr<Request>)
+ScriptPromise Cache::addImpl(ScriptState* scriptState, Request*)
{
// FIXME: Implement this.
return rejectAsNotImplemented(scriptState);
}
-ScriptPromise Cache::addAllImpl(ScriptState* scriptState, Vector<RefPtrWillBeRawPtr<Request> >)
+ScriptPromise Cache::addAllImpl(ScriptState* scriptState, Vector<Request*>)
{
// FIXME: Implement this.
return rejectAsNotImplemented(scriptState);
@@ -305,7 +305,7 @@ PassRefPtrWillBeRawPtr<DOMException> Cache::domExceptionForCacheError(WebService
}
}
-ScriptPromise Cache::deleteImpl(ScriptState* scriptState, PassRefPtrWillBeRawPtr<Request> request, const Dictionary& queryParamsDict)
+ScriptPromise Cache::deleteImpl(ScriptState* scriptState, Request* request, const Dictionary& queryParamsDict)
{
WebVector<WebServiceWorkerCache::BatchOperation> batchOperations(size_t(1));
batchOperations[0].operationType = WebServiceWorkerCache::WebServiceWorkerCacheOperationTypeDelete;
@@ -318,7 +318,7 @@ ScriptPromise Cache::deleteImpl(ScriptState* scriptState, PassRefPtrWillBeRawPtr
return promise;
}
-ScriptPromise Cache::putImpl(ScriptState* scriptState, PassRefPtrWillBeRawPtr<Request> request, Response* response)
+ScriptPromise Cache::putImpl(ScriptState* scriptState, Request* request, const Response* response)
{
WebVector<WebServiceWorkerCache::BatchOperation> batchOperations(size_t(1));
batchOperations[0].operationType = WebServiceWorkerCache::WebServiceWorkerCacheOperationTypePut;
@@ -339,7 +339,7 @@ ScriptPromise Cache::keysImpl(ScriptState* scriptState)
return promise;
}
-ScriptPromise Cache::keysImpl(ScriptState* scriptState, PassRefPtrWillBeRawPtr<Request> request, const Dictionary& queryParamsDict)
+ScriptPromise Cache::keysImpl(ScriptState* scriptState, Request* request, const Dictionary& queryParamsDict)
{
WebServiceWorkerRequest webRequest;
request->populateWebServiceWorkerRequest(webRequest);
« no previous file with comments | « Source/modules/serviceworkers/Cache.h ('k') | Source/modules/serviceworkers/CacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698