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

Unified Diff: third_party/WebKit/Source/modules/fetch/Response.cpp

Issue 2815313002: Reland of Move ScriptState::GetExecutionContext (Part 5) (Closed)
Patch Set: Created 3 years, 8 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/fetch/Response.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/Response.cpp b/third_party/WebKit/Source/modules/fetch/Response.cpp
index 1eae69faeb9e7754f8e58ef74455b5dbc8b93a99..e9a735fdcab5da54cada6f518af7a2f2672ce890 100644
--- a/third_party/WebKit/Source/modules/fetch/Response.cpp
+++ b/third_party/WebKit/Source/modules/fetch/Response.cpp
@@ -18,6 +18,7 @@
#include "bindings/modules/v8/ByteStringSequenceSequenceOrByteStringByteStringRecordOrHeaders.h"
#include "core/dom/DOMArrayBuffer.h"
#include "core/dom/DOMArrayBufferView.h"
+#include "core/dom/ExecutionContext.h"
#include "core/dom/URLSearchParams.h"
#include "core/fileapi/Blob.h"
#include "core/frame/UseCounter.h"
@@ -64,7 +65,7 @@
}
response->ReplaceBodyStreamBuffer(new BodyStreamBuffer(
- script_state, new BlobBytesConsumer(script_state->GetExecutionContext(),
+ script_state, new BlobBytesConsumer(ExecutionContext::From(script_state),
web_response.GetBlobDataHandle())));
// Filter the response according to |webResponse|'s ResponseType.
@@ -134,7 +135,7 @@
ExceptionState& exception_state) {
v8::Local<v8::Value> body = body_value.V8Value();
v8::Isolate* isolate = script_state->GetIsolate();
- ExecutionContext* execution_context = script_state->GetExecutionContext();
+ ExecutionContext* execution_context = ExecutionContext::From(script_state);
BodyStreamBuffer* body_buffer = nullptr;
String content_type;
@@ -214,7 +215,7 @@
// "3. Let |r| be a new Response object, associated with a new response,
// Headers object, and Body object."
- Response* r = new Response(script_state->GetExecutionContext());
+ Response* r = new Response(ExecutionContext::From(script_state));
// "4. Set |r|'s response's status to |init|'s status member."
r->response_->SetStatus(init.status());
@@ -283,14 +284,14 @@
const WebServiceWorkerResponse& web_response) {
FetchResponseData* response_data =
CreateFetchResponseDataFromWebResponse(script_state, web_response);
- return new Response(script_state->GetExecutionContext(), response_data);
+ return new Response(ExecutionContext::From(script_state), response_data);
}
Response* Response::error(ScriptState* script_state) {
FetchResponseData* response_data =
FetchResponseData::CreateNetworkErrorResponse();
Response* r =
- new Response(script_state->GetExecutionContext(), response_data);
+ new Response(ExecutionContext::From(script_state), response_data);
r->headers_->SetGuard(Headers::kImmutableGuard);
return r;
}
@@ -299,7 +300,7 @@
const String& url,
unsigned short status,
ExceptionState& exception_state) {
- KURL parsed_url = script_state->GetExecutionContext()->CompleteURL(url);
+ KURL parsed_url = ExecutionContext::From(script_state)->CompleteURL(url);
if (!parsed_url.IsValid()) {
exception_state.ThrowTypeError("Failed to parse URL from " + url);
return nullptr;
@@ -310,7 +311,7 @@
return nullptr;
}
- Response* r = new Response(script_state->GetExecutionContext());
+ Response* r = new Response(ExecutionContext::From(script_state));
r->headers_->SetGuard(Headers::kImmutableGuard);
r->response_->SetStatus(status);
r->response_->HeaderList()->Set("Location", parsed_url);
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/Request.cpp ('k') | third_party/WebKit/Source/modules/fetch/ResponseTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698