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

Side by Side Diff: Source/core/loader/BeaconLoader.cpp

Issue 996143002: Do really include the beacon Blob content type if valid. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « LayoutTests/http/tests/navigation/beacon-same-origin-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "config.h" 5 #include "config.h"
6 #include "core/loader/BeaconLoader.h" 6 #include "core/loader/BeaconLoader.h"
7 7
8 #include "core/FetchInitiatorTypeNames.h" 8 #include "core/FetchInitiatorTypeNames.h"
9 #include "core/dom/DOMArrayBufferView.h" 9 #include "core/dom/DOMArrayBufferView.h"
10 #include "core/dom/Document.h" 10 #include "core/dom/Document.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 { 140 {
141 ASSERT(data); 141 ASSERT(data);
142 RefPtr<FormData> entityBody = FormData::create(); 142 RefPtr<FormData> entityBody = FormData::create();
143 if (data->hasBackingFile()) 143 if (data->hasBackingFile())
144 entityBody->appendFile(toFile(data)->path()); 144 entityBody->appendFile(toFile(data)->path());
145 else 145 else
146 entityBody->appendBlob(data->uuid(), data->blobDataHandle()); 146 entityBody->appendBlob(data->uuid(), data->blobDataHandle());
147 147
148 request.setHTTPBody(entityBody.release()); 148 request.setHTTPBody(entityBody.release());
149 149
150 AtomicString contentType;
151 const String& blobType = data->type(); 150 const String& blobType = data->type();
152 if (!blobType.isEmpty() && isValidContentType(blobType)) 151 if (!blobType.isEmpty() && isValidContentType(blobType))
153 request.setHTTPContentType(AtomicString(contentType)); 152 request.setHTTPContentType(AtomicString(blobType));
154 153
155 return true; 154 return true;
156 } 155 }
157 156
158 unsigned long long Beacon::beaconSize(PassRefPtr<DOMArrayBufferView> data) 157 unsigned long long Beacon::beaconSize(PassRefPtr<DOMArrayBufferView> data)
159 { 158 {
160 return data->byteLength(); 159 return data->byteLength();
161 } 160 }
162 161
163 bool Beacon::serialize(PassRefPtr<DOMArrayBufferView> data, ResourceRequest& req uest, int, int&) 162 bool Beacon::serialize(PassRefPtr<DOMArrayBufferView> data, ResourceRequest& req uest, int, int&)
(...skipping 27 matching lines...) Expand all
191 request.setHTTPBody(entityBody.release()); 190 request.setHTTPBody(entityBody.release());
192 request.setHTTPContentType(contentType); 191 request.setHTTPContentType(contentType);
193 192
194 payloadLength = entitySize; 193 payloadLength = entitySize;
195 return true; 194 return true;
196 } 195 }
197 196
198 } // namespace 197 } // namespace
199 198
200 } // namespace blink 199 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/navigation/beacon-same-origin-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698