| 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 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 bool DocumentLoader::ShouldContinueForResponse() const { | 500 bool DocumentLoader::ShouldContinueForResponse() const { |
| 501 if (substitute_data_.IsValid()) | 501 if (substitute_data_.IsValid()) |
| 502 return true; | 502 return true; |
| 503 | 503 |
| 504 int status_code = response_.HttpStatusCode(); | 504 int status_code = response_.HttpStatusCode(); |
| 505 if (status_code == 204 || status_code == 205) { | 505 if (status_code == 204 || status_code == 205) { |
| 506 // The server does not want us to replace the page contents. | 506 // The server does not want us to replace the page contents. |
| 507 return false; | 507 return false; |
| 508 } | 508 } |
| 509 | 509 |
| 510 if (GetContentDispositionType(response_.HttpHeaderField( | 510 if (IsContentDispositionAttachment( |
| 511 HTTPNames::Content_Disposition)) == kContentDispositionAttachment) { | 511 response_.HttpHeaderField(HTTPNames::Content_Disposition))) { |
| 512 // The server wants us to download instead of replacing the page contents. | 512 // The server wants us to download instead of replacing the page contents. |
| 513 // Downloading is handled by the embedder, but we still get the initial | 513 // Downloading is handled by the embedder, but we still get the initial |
| 514 // response so that we can ignore it and clean up properly. | 514 // response so that we can ignore it and clean up properly. |
| 515 return false; | 515 return false; |
| 516 } | 516 } |
| 517 | 517 |
| 518 if (!CanShowMIMEType(response_.MimeType(), frame_)) | 518 if (!CanShowMIMEType(response_.MimeType(), frame_)) |
| 519 return false; | 519 return false; |
| 520 return true; | 520 return true; |
| 521 } | 521 } |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1092 InstallNewDocumentReason::kJavascriptURL, | 1092 InstallNewDocumentReason::kJavascriptURL, |
| 1093 kForceSynchronousParsing, KURL()); | 1093 kForceSynchronousParsing, KURL()); |
| 1094 if (!source.IsNull()) | 1094 if (!source.IsNull()) |
| 1095 writer_->AppendReplacingData(source); | 1095 writer_->AppendReplacingData(source); |
| 1096 EndWriting(); | 1096 EndWriting(); |
| 1097 } | 1097 } |
| 1098 | 1098 |
| 1099 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 1099 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
| 1100 | 1100 |
| 1101 } // namespace blink | 1101 } // namespace blink |
| OLD | NEW |