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

Side by Side Diff: Source/core/html/imports/HTMLImportsController.cpp

Issue 1170503003: Remove resource type-specific fetching logic from ResourceFetcher (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Null-check Document::loader() before calling startPreload() Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLLinkElement.cpp ('k') | Source/core/html/parser/HTMLResourcePreloader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 ASSERT(loader); 122 ASSERT(loader);
123 HTMLImportChild* child = createChild(request.url(), loader, parent, clie nt); 123 HTMLImportChild* child = createChild(request.url(), loader, parent, clie nt);
124 child->didShareLoader(); 124 child->didShareLoader();
125 return child; 125 return child;
126 } 126 }
127 127
128 bool sameOriginRequest = master()->securityOrigin()->canRequest(request.url( )); 128 bool sameOriginRequest = master()->securityOrigin()->canRequest(request.url( ));
129 request.setCrossOriginAccessControl( 129 request.setCrossOriginAccessControl(
130 master()->securityOrigin(), sameOriginRequest ? AllowStoredCredentials : DoNotAllowStoredCredentials, 130 master()->securityOrigin(), sameOriginRequest ? AllowStoredCredentials : DoNotAllowStoredCredentials,
131 ClientDidNotRequestCredentials); 131 ClientDidNotRequestCredentials);
132 ResourcePtr<RawResource> resource = parent->document()->fetcher()->fetchImpo rt(request); 132 ResourcePtr<RawResource> resource = RawResource::fetchImport(request, parent ->document()->fetcher());
133 if (!resource) 133 if (!resource)
134 return nullptr; 134 return nullptr;
135 135
136 HTMLImportLoader* loader = createLoader(); 136 HTMLImportLoader* loader = createLoader();
137 HTMLImportChild* child = createChild(request.url(), loader, parent, client); 137 HTMLImportChild* child = createChild(request.url(), loader, parent, client);
138 // We set resource after the import tree is built since 138 // We set resource after the import tree is built since
139 // Resource::addClient() immediately calls back to feed the bytes when the r esource is cached. 139 // Resource::addClient() immediately calls back to feed the bytes when the r esource is cached.
140 loader->startLoading(resource); 140 loader->startLoading(resource);
141 child->didStartLoading(); 141 child->didStartLoading();
142 return child; 142 return child;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 } 177 }
178 178
179 DEFINE_TRACE(HTMLImportsController) 179 DEFINE_TRACE(HTMLImportsController)
180 { 180 {
181 visitor->trace(m_root); 181 visitor->trace(m_root);
182 visitor->trace(m_loaders); 182 visitor->trace(m_loaders);
183 WillBeHeapSupplement<Document>::trace(visitor); 183 WillBeHeapSupplement<Document>::trace(visitor);
184 } 184 }
185 185
186 } // namespace blink 186 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/HTMLLinkElement.cpp ('k') | Source/core/html/parser/HTMLResourcePreloader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698