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

Side by Side Diff: Source/core/fetch/ResourceFetcher.cpp

Issue 33523002: Have Frame::script() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 2 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/ScriptLoader.cpp ('k') | Source/core/frame/ContentSecurityPolicy.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) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 bool ResourceFetcher::canRequest(Resource::Type type, const KURL& url, const Res ourceLoaderOptions& options, bool forPreload) 379 bool ResourceFetcher::canRequest(Resource::Type type, const KURL& url, const Res ourceLoaderOptions& options, bool forPreload)
380 { 380 {
381 if (document() && !document()->securityOrigin()->canDisplay(url)) { 381 if (document() && !document()->securityOrigin()->canDisplay(url)) {
382 if (!forPreload) 382 if (!forPreload)
383 context().reportLocalLoadFailed(url); 383 context().reportLocalLoadFailed(url);
384 LOG(ResourceLoading, "ResourceFetcher::requestResource URL was not allow ed by SecurityOrigin::canDisplay"); 384 LOG(ResourceLoading, "ResourceFetcher::requestResource URL was not allow ed by SecurityOrigin::canDisplay");
385 return 0; 385 return 0;
386 } 386 }
387 387
388 // FIXME: Convert this to check the isolated world's Content Security Policy once webkit.org/b/104520 is solved. 388 // FIXME: Convert this to check the isolated world's Content Security Policy once webkit.org/b/104520 is solved.
389 bool shouldBypassMainWorldContentSecurityPolicy = (frame() && frame()->scrip t()->shouldBypassMainWorldContentSecurityPolicy()) || (options.contentSecurityPo licyOption == DoNotCheckContentSecurityPolicy); 389 bool shouldBypassMainWorldContentSecurityPolicy = (frame() && frame()->scrip t().shouldBypassMainWorldContentSecurityPolicy()) || (options.contentSecurityPol icyOption == DoNotCheckContentSecurityPolicy);
390 390
391 // Some types of resources can be loaded only from the same origin. Other 391 // Some types of resources can be loaded only from the same origin. Other
392 // types of resources, like Images, Scripts, and CSS, can be loaded from 392 // types of resources, like Images, Scripts, and CSS, can be loaded from
393 // any URL. 393 // any URL.
394 switch (type) { 394 switch (type) {
395 case Resource::MainResource: 395 case Resource::MainResource:
396 case Resource::Image: 396 case Resource::Image:
397 case Resource::CSSStyleSheet: 397 case Resource::CSSStyleSheet:
398 case Resource::Script: 398 case Resource::Script:
399 case Resource::Font: 399 case Resource::Font:
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after
1321 } 1321 }
1322 #endif 1322 #endif
1323 1323
1324 const ResourceLoaderOptions& ResourceFetcher::defaultResourceOptions() 1324 const ResourceLoaderOptions& ResourceFetcher::defaultResourceOptions()
1325 { 1325 {
1326 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SendCallbacks, SniffCon tent, BufferData, AllowStoredCredentials, ClientRequestedCredentials, AskClientF orCrossOriginCredentials, DoSecurityCheck, CheckContentSecurityPolicy, UseDefaul tOriginRestrictionsForType, DocumentContext)); 1326 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SendCallbacks, SniffCon tent, BufferData, AllowStoredCredentials, ClientRequestedCredentials, AskClientF orCrossOriginCredentials, DoSecurityCheck, CheckContentSecurityPolicy, UseDefaul tOriginRestrictionsForType, DocumentContext));
1327 return options; 1327 return options;
1328 } 1328 }
1329 1329
1330 } 1330 }
OLDNEW
« no previous file with comments | « Source/core/dom/ScriptLoader.cpp ('k') | Source/core/frame/ContentSecurityPolicy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698