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

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

Issue 2676163002: Refactor the forPreload flag to mean speculative preload. (Closed)
Patch Set: Renamed ReportingPolicy and moved comments Created 3 years, 10 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 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 m_corsMode(IsCORSEnabled) { 246 m_corsMode(IsCORSEnabled) {
247 const AtomicString contentType = request.httpContentType(); 247 const AtomicString contentType = request.httpContentType();
248 if (!contentType.isNull() && 248 if (!contentType.isNull() &&
249 FetchUtils::isSimpleHeader(AtomicString("content-type"), contentType)) 249 FetchUtils::isSimpleHeader(AtomicString("content-type"), contentType))
250 m_corsMode = NotCORSEnabled; 250 m_corsMode = NotCORSEnabled;
251 251
252 frame->loader().client()->didDispatchPingLoader(request.url()); 252 frame->loader().client()->didDispatchPingLoader(request.url());
253 253
254 FetchContext& fetchContext = frame->document()->fetcher()->context(); 254 FetchContext& fetchContext = frame->document()->fetcher()->context();
255 255
256 fetchContext.willStartLoadingResource(m_identifier, request, Resource::Image, 256 fetchContext.willStartLoadingResource(
257 initiator, false); 257 m_identifier, request, Resource::Image, initiator,
258 FetchContext::V8ActivityLoggingPolicy::Log);
258 259
259 FetchInitiatorInfo initiatorInfo; 260 FetchInitiatorInfo initiatorInfo;
260 initiatorInfo.name = initiator; 261 initiatorInfo.name = initiator;
261 fetchContext.dispatchWillSendRequest(m_identifier, request, 262 fetchContext.dispatchWillSendRequest(m_identifier, request,
262 ResourceResponse(), initiatorInfo); 263 ResourceResponse(), initiatorInfo);
263 264
264 // Make sure the scheduler doesn't wait for the ping. 265 // Make sure the scheduler doesn't wait for the ping.
265 if (frame->frameScheduler()) 266 if (frame->frameScheduler())
266 frame->frameScheduler()->didStopLoading(m_identifier); 267 frame->frameScheduler()->didStopLoading(m_identifier);
267 268
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 bool PingLoader::sendBeacon(LocalFrame* frame, 569 bool PingLoader::sendBeacon(LocalFrame* frame,
569 int allowance, 570 int allowance,
570 const KURL& beaconURL, 571 const KURL& beaconURL,
571 Blob* data, 572 Blob* data,
572 int& payloadLength) { 573 int& payloadLength) {
573 BeaconBlob beacon(data); 574 BeaconBlob beacon(data);
574 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); 575 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength);
575 } 576 }
576 577
577 } // namespace blink 578 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/LinkLoader.cpp ('k') | third_party/WebKit/Source/core/loader/resource/ImageResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698