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

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

Issue 33353003: Have Frame::tree() 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/editing/SpellChecker.cpp ('k') | Source/core/frame/DOMWindow.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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 break; 359 break;
360 } 360 }
361 } 361 }
362 if (treatment == TreatAsActiveContent) { 362 if (treatment == TreatAsActiveContent) {
363 if (Frame* f = frame()) { 363 if (Frame* f = frame()) {
364 if (!f->loader()->mixedContentChecker()->canRunInsecureContent(m_doc ument->securityOrigin(), url)) 364 if (!f->loader()->mixedContentChecker()->canRunInsecureContent(m_doc ument->securityOrigin(), url))
365 return false; 365 return false;
366 } 366 }
367 } else if (treatment == TreatAsPassiveContent) { 367 } else if (treatment == TreatAsPassiveContent) {
368 if (Frame* f = frame()) { 368 if (Frame* f = frame()) {
369 Frame* top = f->tree()->top(); 369 Frame* top = f->tree().top();
370 if (!top->loader()->mixedContentChecker()->canDisplayInsecureContent (top->document()->securityOrigin(), url)) 370 if (!top->loader()->mixedContentChecker()->canDisplayInsecureContent (top->document()->securityOrigin(), url))
371 return false; 371 return false;
372 } 372 }
373 } else { 373 } else {
374 ASSERT(treatment == TreatAsAlwaysAllowedContent); 374 ASSERT(treatment == TreatAsAlwaysAllowedContent);
375 } 375 }
376 return true; 376 return true;
377 } 377 }
378 378
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)
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 m_documentResources.set(resource->url(), resource); 625 m_documentResources.set(resource->url(), resource);
626 return resource; 626 return resource;
627 } 627 }
628 628
629 void ResourceFetcher::determineTargetType(ResourceRequest& request, Resource::Ty pe type) 629 void ResourceFetcher::determineTargetType(ResourceRequest& request, Resource::Ty pe type)
630 { 630 {
631 ResourceRequest::TargetType targetType; 631 ResourceRequest::TargetType targetType;
632 632
633 switch (type) { 633 switch (type) {
634 case Resource::MainResource: 634 case Resource::MainResource:
635 if (frame()->tree()->parent()) 635 if (frame()->tree().parent())
636 targetType = ResourceRequest::TargetIsSubframe; 636 targetType = ResourceRequest::TargetIsSubframe;
637 else 637 else
638 targetType = ResourceRequest::TargetIsMainFrame; 638 targetType = ResourceRequest::TargetIsMainFrame;
639 break; 639 break;
640 case Resource::XSLStyleSheet: 640 case Resource::XSLStyleSheet:
641 ASSERT(RuntimeEnabledFeatures::xsltEnabled()); 641 ASSERT(RuntimeEnabledFeatures::xsltEnabled());
642 case Resource::CSSStyleSheet: 642 case Resource::CSSStyleSheet:
643 targetType = ResourceRequest::TargetIsStyleSheet; 643 targetType = ResourceRequest::TargetIsStyleSheet;
644 break; 644 break;
645 case Resource::Script: 645 case Resource::Script:
(...skipping 675 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/editing/SpellChecker.cpp ('k') | Source/core/frame/DOMWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698