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

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

Issue 2842253002: Move ReportLocalLoadFailed to ExecutionContext (Closed)
Patch Set: Revert ResourceLoader changes, handle main resource redirect in DocumentLoader Created 3 years, 7 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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 472
473 beacon.Serialize(request); 473 beacon.Serialize(request);
474 474
475 return SendPingCommon(frame, request, FetchInitiatorTypeNames::beacon, 475 return SendPingCommon(frame, request, FetchInitiatorTypeNames::beacon,
476 kAllowStoredCredentials, true); 476 kAllowStoredCredentials, true);
477 } 477 }
478 478
479 } // namespace 479 } // namespace
480 480
481 void PingLoader::LoadImage(LocalFrame* frame, const KURL& url) { 481 void PingLoader::LoadImage(LocalFrame* frame, const KURL& url) {
482 if (!frame->GetDocument()->GetSecurityOrigin()->CanDisplay(url)) {
483 FrameLoader::ReportLocalLoadFailed(frame, url.GetString());
484 return;
485 }
486
487 ResourceRequest request(url); 482 ResourceRequest request(url);
488 request.SetHTTPHeaderField(HTTPNames::Cache_Control, "max-age=0"); 483 request.SetHTTPHeaderField(HTTPNames::Cache_Control, "max-age=0");
489 FinishPingRequestInitialization(request, frame, 484 FinishPingRequestInitialization(request, frame,
490 WebURLRequest::kRequestContextPing); 485 WebURLRequest::kRequestContextPing);
491 486
492 SendPingCommon(frame, request, FetchInitiatorTypeNames::ping, 487 SendPingCommon(frame, request, FetchInitiatorTypeNames::ping,
493 kAllowStoredCredentials, false); 488 kAllowStoredCredentials, false);
494 } 489 }
495 490
496 // http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#hyperl ink-auditing 491 // http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#hyperl ink-auditing
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 bool PingLoader::SendBeacon(LocalFrame* frame, 585 bool PingLoader::SendBeacon(LocalFrame* frame,
591 int allowance, 586 int allowance,
592 const KURL& beacon_url, 587 const KURL& beacon_url,
593 Blob* data, 588 Blob* data,
594 size_t& beacon_size) { 589 size_t& beacon_size) {
595 BeaconBlob beacon(data); 590 BeaconBlob beacon(data);
596 return SendBeaconCommon(frame, allowance, beacon_url, beacon, beacon_size); 591 return SendBeaconCommon(frame, allowance, beacon_url, beacon, beacon_size);
597 } 592 }
598 593
599 } // namespace blink 594 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoader.cpp ('k') | third_party/WebKit/Source/core/loader/WorkerFetchContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698