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

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

Issue 1844223002: Literal AtomicString construction can rely on strlen optimization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
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 "core/loader/BeaconLoader.h" 5 #include "core/loader/BeaconLoader.h"
6 6
7 #include "core/dom/DOMArrayBufferView.h" 7 #include "core/dom/DOMArrayBufferView.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/fetch/CrossOriginAccessControl.h" 9 #include "core/fetch/CrossOriginAccessControl.h"
10 #include "core/fetch/FetchContext.h" 10 #include "core/fetch/FetchContext.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 } 222 }
223 223
224 bool Beacon::serialize(FormData* data, ResourceRequest& request, int allowance, int& payloadLength) 224 bool Beacon::serialize(FormData* data, ResourceRequest& request, int allowance, int& payloadLength)
225 { 225 {
226 ASSERT(data); 226 ASSERT(data);
227 RefPtr<EncodedFormData> entityBody = data->encodeMultiPartFormData(); 227 RefPtr<EncodedFormData> entityBody = data->encodeMultiPartFormData();
228 unsigned long long entitySize = entityBody->sizeInBytes(); 228 unsigned long long entitySize = entityBody->sizeInBytes();
229 if (allowance > 0 && static_cast<unsigned long long>(allowance) < entitySize ) 229 if (allowance > 0 && static_cast<unsigned long long>(allowance) < entitySize )
230 return false; 230 return false;
231 231
232 AtomicString contentType = AtomicString("multipart/form-data; boundary=", At omicString::ConstructFromLiteral) + entityBody->boundary().data(); 232 AtomicString contentType = AtomicString("multipart/form-data; boundary=") + entityBody->boundary().data();
233 request.setHTTPBody(entityBody.release()); 233 request.setHTTPBody(entityBody.release());
234 request.setHTTPContentType(contentType); 234 request.setHTTPContentType(contentType);
235 235
236 payloadLength = entitySize; 236 payloadLength = entitySize;
237 return true; 237 return true;
238 } 238 }
239 239
240 } // namespace 240 } // namespace
241 241
242 } // namespace blink 242 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698