OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |