Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: third_party/WebKit/Source/core/html/parser/PreloadRequest.cpp

Issue 2826213003: Don't lower priority for scripts inserted by doc.write (Closed)
Patch Set: Fixed duplicate URLs in Layout test Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/html/parser/PreloadRequest.h" 5 #include "core/html/parser/PreloadRequest.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/loader/DocumentLoader.h" 8 #include "core/loader/DocumentLoader.h"
9 #include "platform/CrossOriginAttributeValue.h" 9 #include "platform/CrossOriginAttributeValue.h"
10 #include "platform/loader/fetch/FetchInitiatorInfo.h" 10 #include "platform/loader/fetch/FetchInitiatorInfo.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 if (request_type_ == kRequestTypeLinkRelPreload) 71 if (request_type_ == kRequestTypeLinkRelPreload)
72 params.SetLinkPreload(true); 72 params.SetLinkPreload(true);
73 73
74 if (resource_type_ == Resource::kScript || 74 if (resource_type_ == Resource::kScript ||
75 resource_type_ == Resource::kCSSStyleSheet || 75 resource_type_ == Resource::kCSSStyleSheet ||
76 resource_type_ == Resource::kImportResource) { 76 resource_type_ == Resource::kImportResource) {
77 params.SetCharset(charset_.IsEmpty() ? document->characterSet().GetString() 77 params.SetCharset(charset_.IsEmpty() ? document->characterSet().GetString()
78 : charset_); 78 : charset_);
79 } 79 }
80 params.SetSpeculativePreload(true, discovery_time_); 80 FetchParameters::SpeculativePreloadType speculative_preload_type =
81 FetchParameters::SpeculativePreloadType::kInDocument;
82 if (from_insertion_scanner_) {
83 speculative_preload_type =
84 FetchParameters::SpeculativePreloadType::kInserted;
85 }
86 params.SetSpeculativePreloadType(speculative_preload_type, discovery_time_);
81 87
82 return document->Loader()->StartPreload(resource_type_, params); 88 return document->Loader()->StartPreload(resource_type_, params);
83 } 89 }
84 90
85 } // namespace blink 91 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698