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

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

Issue 360233005: Replace 'ResourceRequest::TargetType' with 'ResourceRequest::RequestContext'. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
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/fetch/CrossOriginAccessControl.h" 9 #include "core/fetch/CrossOriginAccessControl.h"
10 #include "core/fetch/FetchContext.h" 10 #include "core/fetch/FetchContext.h"
11 #include "core/fileapi/File.h" 11 #include "core/fileapi/File.h"
12 #include "core/frame/LocalFrame.h" 12 #include "core/frame/LocalFrame.h"
13 #include "core/html/DOMFormData.h" 13 #include "core/html/DOMFormData.h"
14 #include "platform/network/FormData.h" 14 #include "platform/network/FormData.h"
15 #include "platform/network/ParsedContentType.h" 15 #include "platform/network/ParsedContentType.h"
16 #include "platform/network/ResourceRequest.h" 16 #include "platform/network/ResourceRequest.h"
17 #include "wtf/ArrayBufferView.h" 17 #include "wtf/ArrayBufferView.h"
18 18
19 namespace WebCore { 19 namespace WebCore {
20 20
21 void BeaconLoader::prepareRequest(LocalFrame* frame, ResourceRequest& request) 21 void BeaconLoader::prepareRequest(LocalFrame* frame, ResourceRequest& request)
22 { 22 {
23 // NOTE: do not distinguish Beacon by target type. 23 // NOTE: do not distinguish Beacon by target type.
24 request.setTargetType(ResourceRequest::TargetIsPing); 24 request.setRequestContext(ResourceRequest::PingContext);
25 request.setHTTPMethod("POST"); 25 request.setHTTPMethod("POST");
26 request.setHTTPHeaderField("Cache-Control", "max-age=0"); 26 request.setHTTPHeaderField("Cache-Control", "max-age=0");
27 request.setAllowStoredCredentials(true); 27 request.setAllowStoredCredentials(true);
28 frame->loader().fetchContext().addAdditionalRequestHeaders(frame->document() , request, FetchSubresource); 28 frame->loader().fetchContext().addAdditionalRequestHeaders(frame->document() , request, FetchSubresource);
29 frame->loader().fetchContext().setFirstPartyForCookies(request); 29 frame->loader().fetchContext().setFirstPartyForCookies(request);
30 } 30 }
31 31
32 void BeaconLoader::issueRequest(LocalFrame* frame, ResourceRequest& request) 32 void BeaconLoader::issueRequest(LocalFrame* frame, ResourceRequest& request)
33 { 33 {
34 FetchInitiatorInfo initiatorInfo; 34 FetchInitiatorInfo initiatorInfo;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 AtomicString contentType = AtomicString("multipart/form-data; boundary=", At omicString::ConstructFromLiteral) + entityBody->boundary().data(); 120 AtomicString contentType = AtomicString("multipart/form-data; boundary=", At omicString::ConstructFromLiteral) + entityBody->boundary().data();
121 request.setHTTPBody(entityBody.release()); 121 request.setHTTPBody(entityBody.release());
122 request.setHTTPContentType(contentType); 122 request.setHTTPContentType(contentType);
123 123
124 issueRequest(frame, request); 124 issueRequest(frame, request);
125 payloadLength = entitySize; 125 payloadLength = entitySize;
126 return true; 126 return true;
127 } 127 }
128 128
129 } // namespace WebCore 129 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698