OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013, Intel Corporation | 3 * Copyright (C) 2013, Intel Corporation |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 ThreadableLoaderClient* client = m_client; | 526 ThreadableLoaderClient* client = m_client; |
527 clear(); | 527 clear(); |
528 client->didFailRedirectCheck(); | 528 client->didFailRedirectCheck(); |
529 | 529 |
530 return false; | 530 return false; |
531 } | 531 } |
532 | 532 |
533 // Allow same origin requests to continue after allowing clients to audit the | 533 // Allow same origin requests to continue after allowing clients to audit the |
534 // redirect. | 534 // redirect. |
535 if (isAllowedRedirect(request.url())) { | 535 if (isAllowedRedirect(request.url())) { |
| 536 m_client->didReceiveRedirectTo(request.url()); |
536 if (m_client->isDocumentThreadableLoaderClient()) { | 537 if (m_client->isDocumentThreadableLoaderClient()) { |
537 return static_cast<DocumentThreadableLoaderClient*>(m_client) | 538 return static_cast<DocumentThreadableLoaderClient*>(m_client) |
538 ->willFollowRedirect(request, redirectResponse); | 539 ->willFollowRedirect(request, redirectResponse); |
539 } | 540 } |
540 return true; | 541 return true; |
541 } | 542 } |
542 | 543 |
543 if (m_corsRedirectLimit <= 0) { | 544 if (m_corsRedirectLimit <= 0) { |
544 ThreadableLoaderClient* client = m_client; | 545 ThreadableLoaderClient* client = m_client; |
545 clear(); | 546 clear(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 | 580 |
580 if (!allowRedirect) { | 581 if (!allowRedirect) { |
581 ThreadableLoaderClient* client = m_client; | 582 ThreadableLoaderClient* client = m_client; |
582 clear(); | 583 clear(); |
583 client->didFailAccessControlCheck(ResourceError( | 584 client->didFailAccessControlCheck(ResourceError( |
584 errorDomainBlinkInternal, 0, redirectResponse.url().getString(), | 585 errorDomainBlinkInternal, 0, redirectResponse.url().getString(), |
585 accessControlErrorDescription)); | 586 accessControlErrorDescription)); |
586 return false; | 587 return false; |
587 } | 588 } |
588 | 589 |
| 590 m_client->didReceiveRedirectTo(request.url()); |
| 591 |
589 // FIXME: consider combining this with CORS redirect handling performed by | 592 // FIXME: consider combining this with CORS redirect handling performed by |
590 // CrossOriginAccessControl::handleRedirect(). | 593 // CrossOriginAccessControl::handleRedirect(). |
591 clearResource(); | 594 clearResource(); |
592 | 595 |
593 // If the original request wasn't same-origin, then if the request URL origin | 596 // If the original request wasn't same-origin, then if the request URL origin |
594 // is not same origin with the original URL origin, set the source origin to a | 597 // is not same origin with the original URL origin, set the source origin to a |
595 // globally unique identifier. (If the original request was same-origin, the | 598 // globally unique identifier. (If the original request was same-origin, the |
596 // origin of the new request should be the original URL origin.) | 599 // origin of the new request should be the original URL origin.) |
597 if (!m_sameOriginRequest) { | 600 if (!m_sameOriginRequest) { |
598 RefPtr<SecurityOrigin> originalOrigin = | 601 RefPtr<SecurityOrigin> originalOrigin = |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1112 } | 1115 } |
1113 | 1116 |
1114 DEFINE_TRACE(DocumentThreadableLoader) { | 1117 DEFINE_TRACE(DocumentThreadableLoader) { |
1115 visitor->trace(m_resource); | 1118 visitor->trace(m_resource); |
1116 visitor->trace(m_document); | 1119 visitor->trace(m_document); |
1117 ThreadableLoader::trace(visitor); | 1120 ThreadableLoader::trace(visitor); |
1118 RawResourceClient::trace(visitor); | 1121 RawResourceClient::trace(visitor); |
1119 } | 1122 } |
1120 | 1123 |
1121 } // namespace blink | 1124 } // namespace blink |
OLD | NEW |