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

Side by Side Diff: third_party/WebKit/Source/core/loader/DocumentLoader.cpp

Issue 1595793002: Revert of Add <link rel=preload> onload support for scripts and styles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 /* 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 const ResourceRequest& DocumentLoader::request() const 153 const ResourceRequest& DocumentLoader::request() const
154 { 154 {
155 return m_request; 155 return m_request;
156 } 156 }
157 157
158 const KURL& DocumentLoader::url() const 158 const KURL& DocumentLoader::url() const
159 { 159 {
160 return m_request.url(); 160 return m_request.url();
161 } 161 }
162 162
163 ResourcePtr<Resource> DocumentLoader::startPreload(Resource::Type type, FetchReq uest& request) 163 void DocumentLoader::startPreload(Resource::Type type, FetchRequest& request)
164 { 164 {
165 ResourcePtr<Resource> resource; 165 ResourcePtr<Resource> resource;
166 switch (type) { 166 switch (type) {
167 case Resource::Image: 167 case Resource::Image:
168 resource = ImageResource::fetch(request, fetcher()); 168 resource = ImageResource::fetch(request, fetcher());
169 break; 169 break;
170 case Resource::Script: 170 case Resource::Script:
171 resource = ScriptResource::fetch(request, fetcher()); 171 resource = ScriptResource::fetch(request, fetcher());
172 break; 172 break;
173 case Resource::CSSStyleSheet: 173 case Resource::CSSStyleSheet:
(...skipping 13 matching lines...) Expand all
187 break; 187 break;
188 case Resource::LinkSubresource: 188 case Resource::LinkSubresource:
189 resource = RawResource::fetch(request, fetcher()); 189 resource = RawResource::fetch(request, fetcher());
190 break; 190 break;
191 default: 191 default:
192 ASSERT_NOT_REACHED(); 192 ASSERT_NOT_REACHED();
193 } 193 }
194 194
195 if (resource) 195 if (resource)
196 fetcher()->preloadStarted(resource.get()); 196 fetcher()->preloadStarted(resource.get());
197 return resource;
198 } 197 }
199 198
200 void DocumentLoader::didChangePerformanceTiming() 199 void DocumentLoader::didChangePerformanceTiming()
201 { 200 {
202 if (frame() && frame()->isMainFrame() && m_state >= Committed) { 201 if (frame() && frame()->isMainFrame() && m_state >= Committed) {
203 frameLoader()->client()->didChangePerformanceTiming(); 202 frameLoader()->client()->didChangePerformanceTiming();
204 } 203 }
205 } 204 }
206 205
207 void DocumentLoader::updateForSameDocumentNavigation(const KURL& newURL, SameDoc umentNavigationSource sameDocumentNavigationSource) 206 void DocumentLoader::updateForSameDocumentNavigation(const KURL& newURL, SameDoc umentNavigationSource sameDocumentNavigationSource)
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 { 843 {
845 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true, ForceSynchronousParsing); 844 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true, ForceSynchronousParsing);
846 if (!source.isNull()) 845 if (!source.isNull())
847 m_writer->appendReplacingData(source); 846 m_writer->appendReplacingData(source);
848 endWriting(m_writer.get()); 847 endWriting(m_writer.get());
849 } 848 }
850 849
851 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 850 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
852 851
853 } // namespace blink 852 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentLoader.h ('k') | third_party/WebKit/Source/core/loader/LinkLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698