Index: Source/modules/serviceworkers/RespondWithObserver.cpp |
diff --git a/Source/modules/serviceworkers/RespondWithObserver.cpp b/Source/modules/serviceworkers/RespondWithObserver.cpp |
index e4a6fa4f6f928c0e7eee272ac03115e8d2910e30..40b8ee6977e95443b5513ed7179a5bab7266d26b 100644 |
--- a/Source/modules/serviceworkers/RespondWithObserver.cpp |
+++ b/Source/modules/serviceworkers/RespondWithObserver.cpp |
@@ -63,9 +63,9 @@ private: |
ResolveType m_resolveType; |
}; |
-RespondWithObserver* RespondWithObserver::create(ExecutionContext* context, int eventID, WebURLRequest::FetchRequestMode requestMode) |
+RespondWithObserver* RespondWithObserver::create(ExecutionContext* context, int eventID, WebURLRequest::FetchRequestMode requestMode, WebURLRequest::FrameType frameType) |
{ |
- return new RespondWithObserver(context, eventID, requestMode); |
+ return new RespondWithObserver(context, eventID, requestMode, frameType); |
} |
void RespondWithObserver::contextDestroyed() |
@@ -122,16 +122,22 @@ void RespondWithObserver::responseWasFulfilled(const ScriptValue& value) |
responseWasRejected(); |
return; |
} |
+ // Treat the opaque response as a network error for frame loading. |
+ if (responseType == FetchResponseData::OpaqueType && m_frameType != WebURLRequest::FrameTypeNone) { |
Mike West
2014/10/02 12:07:46
You probably want to check for TopLevel or Nested
horo
2014/10/03 03:43:02
It may reasonable. But the current ServiceWorker s
|
+ responseWasRejected(); |
+ return; |
+ } |
WebServiceWorkerResponse webResponse; |
response->populateWebServiceWorkerResponse(webResponse); |
ServiceWorkerGlobalScopeClient::from(executionContext())->didHandleFetchEvent(m_eventID, webResponse); |
m_state = Done; |
} |
-RespondWithObserver::RespondWithObserver(ExecutionContext* context, int eventID, WebURLRequest::FetchRequestMode requestMode) |
+RespondWithObserver::RespondWithObserver(ExecutionContext* context, int eventID, WebURLRequest::FetchRequestMode requestMode, WebURLRequest::FrameType frameType) |
: ContextLifecycleObserver(context) |
, m_eventID(eventID) |
, m_requestMode(requestMode) |
+ , m_frameType(frameType) |
, m_state(Initial) |
{ |
} |