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

Unified Diff: Source/modules/fetch/RequestInit.cpp

Issue 1305183009: CREDENTIAL: Extend FormData opacity to created Request objects (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Initializing variables is a good idea. Created 5 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/fetch/RequestInit.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/fetch/RequestInit.cpp
diff --git a/Source/modules/fetch/RequestInit.cpp b/Source/modules/fetch/RequestInit.cpp
index d2763a645f7df8e72bd15f1294cc98dcaa97b032..3b8690d3ef17d62743a2d3772326e4977fafb232 100644
--- a/Source/modules/fetch/RequestInit.cpp
+++ b/Source/modules/fetch/RequestInit.cpp
@@ -12,6 +12,7 @@
#include "bindings/core/v8/V8Blob.h"
#include "bindings/core/v8/V8FormData.h"
#include "core/fileapi/Blob.h"
+#include "core/html/DOMFormData.h"
#include "modules/fetch/FetchBlobDataConsumerHandle.h"
#include "modules/fetch/FetchFormDataConsumerHandle.h"
#include "modules/fetch/Headers.h"
@@ -21,6 +22,7 @@
namespace blink {
RequestInit::RequestInit(ExecutionContext* context, const Dictionary& options, ExceptionState& exceptionState)
+ : opaque(false)
{
DictionaryHelper::get(options, "method", method);
DictionaryHelper::get(options, "headers", headers);
@@ -49,7 +51,10 @@ RequestInit::RequestInit(ExecutionContext* context, const Dictionary& options, E
contentType = blobDataHandle->type();
body = FetchBlobDataConsumerHandle::create(context, blobDataHandle.release());
} else if (V8FormData::hasInstance(v8Body, isolate)) {
- RefPtr<FormData> formData = V8FormData::toImpl(v8::Local<v8::Object>::Cast(v8Body))->createMultiPartFormData();
+ DOMFormData* domFormData = V8FormData::toImpl(v8::Local<v8::Object>::Cast(v8Body));
+ opaque = domFormData->opaque();
+
+ RefPtr<FormData> formData = domFormData->createMultiPartFormData();
// Here we handle formData->boundary() as a C-style string. See
// FormDataBuilder::generateUniqueBoundaryString.
contentType = AtomicString("multipart/form-data; boundary=", AtomicString::ConstructFromLiteral) + formData->boundary().data();
« no previous file with comments | « Source/modules/fetch/RequestInit.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698