Chromium Code Reviews| 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 14 matching lines...) Expand all Loading... | |
| 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #include "core/loader/DocumentLoader.h" | 30 #include "core/loader/DocumentLoader.h" |
| 31 | 31 |
| 32 #include <memory> | 32 #include <memory> |
| 33 #include "core/dom/Document.h" | 33 #include "core/dom/Document.h" |
| 34 #include "core/dom/DocumentParser.h" | 34 #include "core/dom/DocumentParser.h" |
| 35 #include "core/dom/TaskRunnerHelper.h" | |
| 35 #include "core/dom/WeakIdentifierMap.h" | 36 #include "core/dom/WeakIdentifierMap.h" |
| 36 #include "core/events/Event.h" | 37 #include "core/events/Event.h" |
| 37 #include "core/frame/Deprecation.h" | 38 #include "core/frame/Deprecation.h" |
| 38 #include "core/frame/LocalDOMWindow.h" | 39 #include "core/frame/LocalDOMWindow.h" |
| 39 #include "core/frame/LocalFrame.h" | 40 #include "core/frame/LocalFrame.h" |
| 40 #include "core/frame/LocalFrameClient.h" | 41 #include "core/frame/LocalFrameClient.h" |
| 41 #include "core/frame/Settings.h" | 42 #include "core/frame/Settings.h" |
| 42 #include "core/frame/csp/ContentSecurityPolicy.h" | 43 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 43 #include "core/html/HTMLFrameOwnerElement.h" | 44 #include "core/html/HTMLFrameOwnerElement.h" |
| 44 #include "core/html/parser/HTMLParserIdioms.h" | 45 #include "core/html/parser/HTMLParserIdioms.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 178 } | 179 } |
| 179 | 180 |
| 180 const KURL& DocumentLoader::Url() const { | 181 const KURL& DocumentLoader::Url() const { |
| 181 return request_.Url(); | 182 return request_.Url(); |
| 182 } | 183 } |
| 183 | 184 |
| 184 Resource* DocumentLoader::StartPreload(Resource::Type type, | 185 Resource* DocumentLoader::StartPreload(Resource::Type type, |
| 185 FetchParameters& params) { | 186 FetchParameters& params) { |
| 186 Resource* resource = nullptr; | 187 Resource* resource = nullptr; |
| 187 switch (type) { | 188 switch (type) { |
| 188 case Resource::kImage: | 189 case Resource::kImage: { |
| 189 if (frame_ && frame_->GetSettings() && | 190 if (frame_ && frame_->GetSettings() && |
| 190 frame_->GetSettings()->GetFetchImagePlaceholders()) { | 191 frame_->GetSettings()->GetFetchImagePlaceholders()) { |
| 191 params.SetAllowImagePlaceholder(); | 192 params.SetAllowImagePlaceholder(); |
| 192 } | 193 } |
| 193 resource = ImageResource::Fetch(params, Fetcher()); | 194 RefPtr<WebTaskRunner> task_runner = |
| 194 break; | 195 TaskRunnerHelper::Get(TaskType::kAnimationTimer, frame_); |
| 196 resource = ImageResource::Fetch(task_runner, params, Fetcher()); | |
| 197 } break; | |
|
Sami
2017/04/27 17:38:17
nit: keep the break inside the block.
Dan Elphick
2017/05/03 09:41:06
Acknowledged.
| |
| 195 case Resource::kScript: | 198 case Resource::kScript: |
| 196 resource = ScriptResource::Fetch(params, Fetcher()); | 199 resource = ScriptResource::Fetch(params, Fetcher()); |
| 197 break; | 200 break; |
| 198 case Resource::kCSSStyleSheet: | 201 case Resource::kCSSStyleSheet: |
| 199 resource = CSSStyleSheetResource::Fetch(params, Fetcher()); | 202 resource = CSSStyleSheetResource::Fetch(params, Fetcher()); |
| 200 break; | 203 break; |
| 201 case Resource::kFont: | 204 case Resource::kFont: |
| 202 resource = FontResource::Fetch(params, Fetcher()); | 205 resource = FontResource::Fetch(params, Fetcher()); |
| 203 break; | 206 break; |
| 204 case Resource::kMedia: | 207 case Resource::kMedia: |
| (...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1092 InstallNewDocumentReason::kJavascriptURL, | 1095 InstallNewDocumentReason::kJavascriptURL, |
| 1093 kForceSynchronousParsing, KURL()); | 1096 kForceSynchronousParsing, KURL()); |
| 1094 if (!source.IsNull()) | 1097 if (!source.IsNull()) |
| 1095 writer_->AppendReplacingData(source); | 1098 writer_->AppendReplacingData(source); |
| 1096 EndWriting(); | 1099 EndWriting(); |
| 1097 } | 1100 } |
| 1098 | 1101 |
| 1099 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 1102 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
| 1100 | 1103 |
| 1101 } // namespace blink | 1104 } // namespace blink |
| OLD | NEW |