| 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 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1103 // will use stale values from HTMLParserOption. | 1103 // will use stale values from HTMLParserOption. |
| 1104 if (reason == InstallNewDocumentReason::kNavigation) | 1104 if (reason == InstallNewDocumentReason::kNavigation) |
| 1105 DidCommitNavigation(); | 1105 DidCommitNavigation(); |
| 1106 | 1106 |
| 1107 writer_ = | 1107 writer_ = |
| 1108 DocumentWriter::Create(document, parsing_policy, mime_type, encoding); | 1108 DocumentWriter::Create(document, parsing_policy, mime_type, encoding); |
| 1109 | 1109 |
| 1110 // FeaturePolicy is reset in the browser process on commit, so this needs to | 1110 // FeaturePolicy is reset in the browser process on commit, so this needs to |
| 1111 // be initialized and replicated to the browser process after commit messages | 1111 // be initialized and replicated to the browser process after commit messages |
| 1112 // are sent in didCommitNavigation(). | 1112 // are sent in didCommitNavigation(). |
| 1113 // Feature-Policy header is currently disabled while the details of the policy |
| 1114 // syntax are being worked out. Unless the Feature Policy experimental |
| 1115 // features flag is enabled, then ignore any header received. |
| 1116 // TODO(iclelland): Re-enable once the syntax is finalized. (crbug.com/737643) |
| 1113 document->SetFeaturePolicy( | 1117 document->SetFeaturePolicy( |
| 1114 response_.HttpHeaderField(HTTPNames::Feature_Policy)); | 1118 RuntimeEnabledFeatures::FeaturePolicyExperimentalFeaturesEnabled() |
| 1119 ? response_.HttpHeaderField(HTTPNames::Feature_Policy) |
| 1120 : g_empty_string); |
| 1115 | 1121 |
| 1116 GetFrameLoader().DispatchDidClearDocumentOfWindowObject(); | 1122 GetFrameLoader().DispatchDidClearDocumentOfWindowObject(); |
| 1117 } | 1123 } |
| 1118 | 1124 |
| 1119 const AtomicString& DocumentLoader::MimeType() const { | 1125 const AtomicString& DocumentLoader::MimeType() const { |
| 1120 if (writer_) | 1126 if (writer_) |
| 1121 return writer_->MimeType(); | 1127 return writer_->MimeType(); |
| 1122 return response_.MimeType(); | 1128 return response_.MimeType(); |
| 1123 } | 1129 } |
| 1124 | 1130 |
| 1125 // This is only called by | 1131 // This is only called by |
| 1126 // FrameLoader::replaceDocumentWhileExecutingJavaScriptURL() | 1132 // FrameLoader::replaceDocumentWhileExecutingJavaScriptURL() |
| 1127 void DocumentLoader::ReplaceDocumentWhileExecutingJavaScriptURL( | 1133 void DocumentLoader::ReplaceDocumentWhileExecutingJavaScriptURL( |
| 1128 const DocumentInit& init, | 1134 const DocumentInit& init, |
| 1129 const String& source) { | 1135 const String& source) { |
| 1130 InstallNewDocument(init, MimeType(), | 1136 InstallNewDocument(init, MimeType(), |
| 1131 writer_ ? writer_->Encoding() : g_empty_atom, | 1137 writer_ ? writer_->Encoding() : g_empty_atom, |
| 1132 InstallNewDocumentReason::kJavascriptURL, | 1138 InstallNewDocumentReason::kJavascriptURL, |
| 1133 kForceSynchronousParsing, KURL()); | 1139 kForceSynchronousParsing, KURL()); |
| 1134 if (!source.IsNull()) | 1140 if (!source.IsNull()) |
| 1135 writer_->AppendReplacingData(source); | 1141 writer_->AppendReplacingData(source); |
| 1136 EndWriting(); | 1142 EndWriting(); |
| 1137 } | 1143 } |
| 1138 | 1144 |
| 1139 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 1145 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
| 1140 | 1146 |
| 1141 } // namespace blink | 1147 } // namespace blink |
| OLD | NEW |