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

Unified Diff: third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp

Issue 2715663002: ServiceWorker: Factor out FetchEvent related logics from RespondWithObserver. (Closed)
Patch Set: ServiceWorker: Factor out FetchEvent related logics from RespondWithObserver. Created 3 years, 9 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
Index: third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp b/third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp
index 92e64564a5baafd3161106fbf1c7e8fcb20c1124..9c01ba3db3d074afd88fba41cb27a0e0746dd636 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp
@@ -25,7 +25,7 @@ ForeignFetchRespondWithObserver* ForeignFetchRespondWithObserver::create(
requestContext, std::move(requestOrigin), observer);
}
-void ForeignFetchRespondWithObserver::responseWasFulfilled(
+void ForeignFetchRespondWithObserver::onResponseFulfilled(
const ScriptValue& value) {
ASSERT(getExecutionContext());
ExceptionState exceptionState(value.isolate(), ExceptionState::UnknownContext,
@@ -35,7 +35,7 @@ void ForeignFetchRespondWithObserver::responseWasFulfilled(
value, exceptionState);
if (exceptionState.hadException()) {
exceptionState.clearException();
- responseWasRejected(WebServiceWorkerResponseErrorNoForeignFetchResponse);
+ onResponseRejected(WebServiceWorkerResponseErrorNoForeignFetchResponse);
return;
}
@@ -50,7 +50,7 @@ void ForeignFetchRespondWithObserver::responseWasFulfilled(
if (!foreignFetchResponse.hasOrigin()) {
if (foreignFetchResponse.hasHeaders() &&
!foreignFetchResponse.headers().isEmpty()) {
- responseWasRejected(
+ onResponseRejected(
WebServiceWorkerResponseErrorForeignFetchHeadersWithoutOrigin);
return;
}
@@ -62,7 +62,7 @@ void ForeignFetchRespondWithObserver::responseWasFulfilled(
response = Response::create(getExecutionContext(), opaqueData);
}
} else if (m_requestOrigin->toString() != foreignFetchResponse.origin()) {
- responseWasRejected(
+ onResponseRejected(
WebServiceWorkerResponseErrorForeignFetchMismatchedOrigin);
return;
} else if (!isOpaque) {
@@ -87,7 +87,7 @@ void ForeignFetchRespondWithObserver::responseWasFulfilled(
response = Response::create(getExecutionContext(), responseData);
}
- RespondWithObserver::responseWasFulfilled(
+ FetchRespondWithObserver::onResponseFulfilled(
ScriptValue::from(value.getScriptState(), response));
}
@@ -101,14 +101,14 @@ ForeignFetchRespondWithObserver::ForeignFetchRespondWithObserver(
WebURLRequest::RequestContext requestContext,
PassRefPtr<SecurityOrigin> requestOrigin,
WaitUntilObserver* observer)
- : RespondWithObserver(context,
- eventID,
- requestURL,
- requestMode,
- redirectMode,
- frameType,
- requestContext,
- observer),
+ : FetchRespondWithObserver(context,
+ eventID,
+ requestURL,
+ requestMode,
+ redirectMode,
+ frameType,
+ requestContext,
+ observer),
m_requestOrigin(requestOrigin) {}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698