| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/serviceworkers/ForeignFetchRespondWithObserver.h" | 5 #include "modules/serviceworkers/ForeignFetchRespondWithObserver.h" |
| 6 | 6 |
| 7 #include "bindings/modules/v8/V8ForeignFetchResponse.h" | 7 #include "bindings/modules/v8/V8ForeignFetchResponse.h" |
| 8 #include "modules/fetch/Response.h" | 8 #include "modules/fetch/Response.h" |
| 9 #include "modules/serviceworkers/ForeignFetchResponse.h" | 9 #include "modules/serviceworkers/ForeignFetchResponse.h" |
| 10 #include "platform/loader/fetch/CrossOriginAccessControl.h" | 10 #include "platform/loader/fetch/CrossOriginAccessControl.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 WebURLRequest::RequestContext request_context, | 21 WebURLRequest::RequestContext request_context, |
| 22 PassRefPtr<SecurityOrigin> request_origin, | 22 PassRefPtr<SecurityOrigin> request_origin, |
| 23 WaitUntilObserver* observer) { | 23 WaitUntilObserver* observer) { |
| 24 return new ForeignFetchRespondWithObserver( | 24 return new ForeignFetchRespondWithObserver( |
| 25 context, event_id, request_url, request_mode, redirect_mode, frame_type, | 25 context, event_id, request_url, request_mode, redirect_mode, frame_type, |
| 26 request_context, std::move(request_origin), observer); | 26 request_context, std::move(request_origin), observer); |
| 27 } | 27 } |
| 28 | 28 |
| 29 void ForeignFetchRespondWithObserver::OnResponseFulfilled( | 29 void ForeignFetchRespondWithObserver::OnResponseFulfilled( |
| 30 const ScriptValue& value) { | 30 const ScriptValue& value) { |
| 31 ASSERT(GetExecutionContext()); | 31 DCHECK(GetExecutionContext()); |
| 32 ExceptionState exception_state(value.GetIsolate(), | 32 ExceptionState exception_state(value.GetIsolate(), |
| 33 ExceptionState::kUnknownContext, | 33 ExceptionState::kUnknownContext, |
| 34 "ForeignFetchEvent", "respondWith"); | 34 "ForeignFetchEvent", "respondWith"); |
| 35 ForeignFetchResponse foreign_fetch_response = | 35 ForeignFetchResponse foreign_fetch_response = |
| 36 ScriptValue::To<ForeignFetchResponse>(ToIsolate(GetExecutionContext()), | 36 ScriptValue::To<ForeignFetchResponse>(ToIsolate(GetExecutionContext()), |
| 37 value, exception_state); | 37 value, exception_state); |
| 38 if (exception_state.HadException()) { | 38 if (exception_state.HadException()) { |
| 39 exception_state.ClearException(); | 39 exception_state.ClearException(); |
| 40 OnResponseRejected(kWebServiceWorkerResponseErrorNoForeignFetchResponse); | 40 OnResponseRejected(kWebServiceWorkerResponseErrorNoForeignFetchResponse); |
| 41 return; | 41 return; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 event_id, | 107 event_id, |
| 108 request_url, | 108 request_url, |
| 109 request_mode, | 109 request_mode, |
| 110 redirect_mode, | 110 redirect_mode, |
| 111 frame_type, | 111 frame_type, |
| 112 request_context, | 112 request_context, |
| 113 observer), | 113 observer), |
| 114 request_origin_(std::move(request_origin)) {} | 114 request_origin_(std::move(request_origin)) {} |
| 115 | 115 |
| 116 } // namespace blink | 116 } // namespace blink |
| OLD | NEW |