| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 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 | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. 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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 if (!writer_) | 451 if (!writer_) |
| 452 CommitData(0, 0); | 452 CommitData(0, 0); |
| 453 } | 453 } |
| 454 | 454 |
| 455 if (!frame_) | 455 if (!frame_) |
| 456 return; | 456 return; |
| 457 | 457 |
| 458 application_cache_host_->FinishedLoadingMainResource(); | 458 application_cache_host_->FinishedLoadingMainResource(); |
| 459 EndWriting(); | 459 EndWriting(); |
| 460 ClearMainResourceHandle(); | 460 ClearMainResourceHandle(); |
| 461 | |
| 462 // Shows the deprecation message and measures the impact of the new security | |
| 463 // restriction which disallows responding to navigation requests with | |
| 464 // redirected responses in the service worker. | |
| 465 // TODO(horo): Remove this when we actually introduce the restriction in | |
| 466 // RespondWithObserver. | |
| 467 if (response_.WasFetchedViaServiceWorker() && | |
| 468 response_.UrlListViaServiceWorker().size() > 1) { | |
| 469 Deprecation::CountDeprecation( | |
| 470 frame_, | |
| 471 UseCounter:: | |
| 472 kServiceWorkerRespondToNavigationRequestWithRedirectedResponse); | |
| 473 } | |
| 474 } | 461 } |
| 475 | 462 |
| 476 bool DocumentLoader::RedirectReceived( | 463 bool DocumentLoader::RedirectReceived( |
| 477 Resource* resource, | 464 Resource* resource, |
| 478 const ResourceRequest& request, | 465 const ResourceRequest& request, |
| 479 const ResourceResponse& redirect_response) { | 466 const ResourceResponse& redirect_response) { |
| 480 DCHECK(frame_); | 467 DCHECK(frame_); |
| 481 DCHECK_EQ(resource, main_resource_); | 468 DCHECK_EQ(resource, main_resource_); |
| 482 DCHECK(!redirect_response.IsNull()); | 469 DCHECK(!redirect_response.IsNull()); |
| 483 request_ = request; | 470 request_ = request; |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1114 InstallNewDocumentReason::kJavascriptURL, | 1101 InstallNewDocumentReason::kJavascriptURL, |
| 1115 kForceSynchronousParsing, KURL()); | 1102 kForceSynchronousParsing, KURL()); |
| 1116 if (!source.IsNull()) | 1103 if (!source.IsNull()) |
| 1117 writer_->AppendReplacingData(source); | 1104 writer_->AppendReplacingData(source); |
| 1118 EndWriting(); | 1105 EndWriting(); |
| 1119 } | 1106 } |
| 1120 | 1107 |
| 1121 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 1108 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
| 1122 | 1109 |
| 1123 } // namespace blink | 1110 } // namespace blink |
| OLD | NEW |