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

Side by Side Diff: Source/core/dom/ScriptLoader.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/dom/ProcessingInstruction.cpp ('k') | Source/core/fetch/CSSStyleSheetResource.h » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> 6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 AtomicString crossOriginMode = m_element->fastGetAttribute(HTMLNames::cr ossoriginAttr); 290 AtomicString crossOriginMode = m_element->fastGetAttribute(HTMLNames::cr ossoriginAttr);
291 if (!crossOriginMode.isNull()) 291 if (!crossOriginMode.isNull())
292 request.setCrossOriginAccessControl(elementDocument->securityOrigin( ), crossOriginMode); 292 request.setCrossOriginAccessControl(elementDocument->securityOrigin( ), crossOriginMode);
293 request.setCharset(scriptCharset()); 293 request.setCharset(scriptCharset());
294 294
295 bool scriptPassesCSP = elementDocument->contentSecurityPolicy()->allowSc riptWithNonce(m_element->fastGetAttribute(HTMLNames::nonceAttr)); 295 bool scriptPassesCSP = elementDocument->contentSecurityPolicy()->allowSc riptWithNonce(m_element->fastGetAttribute(HTMLNames::nonceAttr));
296 if (scriptPassesCSP) 296 if (scriptPassesCSP)
297 request.setContentSecurityCheck(DoNotCheckContentSecurityPolicy); 297 request.setContentSecurityCheck(DoNotCheckContentSecurityPolicy);
298 request.setDefer(defer); 298 request.setDefer(defer);
299 299
300 m_resource = elementDocument->fetcher()->fetchScript(request); 300 m_resource = ScriptResource::fetch(request, elementDocument->fetcher());
301 m_isExternalScript = true; 301 m_isExternalScript = true;
302 } 302 }
303 303
304 if (m_resource) 304 if (m_resource)
305 return true; 305 return true;
306 306
307 dispatchErrorEvent(); 307 dispatchErrorEvent();
308 return false; 308 return false;
309 } 309 }
310 310
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 if (isHTMLScriptLoader(element)) 496 if (isHTMLScriptLoader(element))
497 return toHTMLScriptElement(element)->loader(); 497 return toHTMLScriptElement(element)->loader();
498 498
499 if (isSVGScriptLoader(element)) 499 if (isSVGScriptLoader(element))
500 return toSVGScriptElement(element)->loader(); 500 return toSVGScriptElement(element)->loader();
501 501
502 return 0; 502 return 0;
503 } 503 }
504 504
505 } // namespace blink 505 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/ProcessingInstruction.cpp ('k') | Source/core/fetch/CSSStyleSheetResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698