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

Side by Side Diff: Source/core/loader/DocumentThreadableLoader.cpp

Issue 23437013: Consider "mixed content XHR" as mixed script instead of mixed display. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add missing test expectation file. Created 7 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013, Intel Corporation 3 * Copyright (C) 2013, Intel Corporation
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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * 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 17 matching lines...) Expand all
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32 #include "config.h" 32 #include "config.h"
33 #include "core/loader/DocumentThreadableLoader.h" 33 #include "core/loader/DocumentThreadableLoader.h"
34 34
35 #include "core/dom/Document.h" 35 #include "core/dom/Document.h"
36 #include "core/fetch/FetchRequest.h" 36 #include "core/fetch/FetchRequest.h"
37 #include "core/fetch/RawResource.h" 37 #include "core/fetch/RawResource.h"
38 #include "core/fetch/Resource.h"
38 #include "core/fetch/ResourceFetcher.h" 39 #include "core/fetch/ResourceFetcher.h"
39 #include "core/inspector/InspectorInstrumentation.h" 40 #include "core/inspector/InspectorInstrumentation.h"
40 #include "core/loader/CrossOriginAccessControl.h" 41 #include "core/loader/CrossOriginAccessControl.h"
41 #include "core/loader/CrossOriginPreflightResultCache.h" 42 #include "core/loader/CrossOriginPreflightResultCache.h"
42 #include "core/loader/DocumentThreadableLoaderClient.h" 43 #include "core/loader/DocumentThreadableLoaderClient.h"
43 #include "core/loader/FrameLoader.h" 44 #include "core/loader/FrameLoader.h"
44 #include "core/loader/ThreadableLoaderClient.h" 45 #include "core/loader/ThreadableLoaderClient.h"
45 #include "core/page/ContentSecurityPolicy.h" 46 #include "core/page/ContentSecurityPolicy.h"
46 #include "core/page/Frame.h" 47 #include "core/page/Frame.h"
47 #include "core/platform/network/ResourceError.h" 48 #include "core/platform/network/ResourceError.h"
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 } 399 }
399 400
400 void DocumentThreadableLoader::loadRequest(const ResourceRequest& request, Secur ityCheckPolicy securityCheck) 401 void DocumentThreadableLoader::loadRequest(const ResourceRequest& request, Secur ityCheckPolicy securityCheck)
401 { 402 {
402 // Any credential should have been removed from the cross-site requests. 403 // Any credential should have been removed from the cross-site requests.
403 const KURL& requestURL = request.url(); 404 const KURL& requestURL = request.url();
404 m_options.securityCheck = securityCheck; 405 m_options.securityCheck = securityCheck;
405 ASSERT(m_sameOriginRequest || requestURL.user().isEmpty()); 406 ASSERT(m_sameOriginRequest || requestURL.user().isEmpty());
406 ASSERT(m_sameOriginRequest || requestURL.pass().isEmpty()); 407 ASSERT(m_sameOriginRequest || requestURL.pass().isEmpty());
407 408
409 ThreadableLoaderOptions options = m_options;
408 if (m_async) { 410 if (m_async) {
409 ThreadableLoaderOptions options = m_options;
410 options.crossOriginCredentialPolicy = DoNotAskClientForCrossOriginCreden tials; 411 options.crossOriginCredentialPolicy = DoNotAskClientForCrossOriginCreden tials;
411 if (m_actualRequest) { 412 if (m_actualRequest) {
412 // Don't sniff content or send load callbacks for the preflight requ est. 413 // Don't sniff content or send load callbacks for the preflight requ est.
413 options.sendLoadCallbacks = DoNotSendCallbacks; 414 options.sendLoadCallbacks = DoNotSendCallbacks;
414 options.sniffContent = DoNotSniffContent; 415 options.sniffContent = DoNotSniffContent;
415 // Keep buffering the data for the preflight request. 416 // Keep buffering the data for the preflight request.
416 options.dataBufferingPolicy = BufferData; 417 options.dataBufferingPolicy = BufferData;
417 } 418 }
418 419
419 if (m_options.timeoutMilliseconds > 0) 420 if (m_options.timeoutMilliseconds > 0)
(...skipping 11 matching lines...) Expand all
431 } 432 }
432 return; 433 return;
433 } 434 }
434 435
435 // FIXME: ThreadableLoaderOptions.sniffContent is not supported for synchron ous requests. 436 // FIXME: ThreadableLoaderOptions.sniffContent is not supported for synchron ous requests.
436 Vector<char> data; 437 Vector<char> data;
437 ResourceError error; 438 ResourceError error;
438 ResourceResponse response; 439 ResourceResponse response;
439 unsigned long identifier = std::numeric_limits<unsigned long>::max(); 440 unsigned long identifier = std::numeric_limits<unsigned long>::max();
440 if (Frame* frame = m_document->frame()) { 441 if (Frame* frame = m_document->frame()) {
441 Frame* top = frame->tree()->top(); 442 if (!m_document->fetcher()->checkInsecureContent(Resource::Raw, requestU RL, options.mixedRawContentBlockingOption)) {
442 if (!top->loader()->mixedContentChecker()->canDisplayInsecureContent(top ->document()->securityOrigin(), requestURL)) {
443 m_client->didFail(error); 443 m_client->didFail(error);
444 return; 444 return;
445 } 445 }
446 identifier = frame->loader()->loadResourceSynchronously(request, m_optio ns.allowCredentials, error, response, data); 446 identifier = frame->loader()->loadResourceSynchronously(request, m_optio ns.allowCredentials, error, response, data);
447 } 447 }
448 448
449 InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient(m_ document, identifier, m_client); 449 InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient(m_ document, identifier, m_client);
450 450
451 // No exception for file:/// resources, see <rdar://problem/4962298>. 451 // No exception for file:/// resources, see <rdar://problem/4962298>.
452 // Also, if we have an HTTP response, then it wasn't a network error in fact . 452 // Also, if we have an HTTP response, then it wasn't a network error in fact .
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 return true; 486 return true;
487 return m_document->contentSecurityPolicy()->allowConnectToSource(url); 487 return m_document->contentSecurityPolicy()->allowConnectToSource(url);
488 } 488 }
489 489
490 SecurityOrigin* DocumentThreadableLoader::securityOrigin() const 490 SecurityOrigin* DocumentThreadableLoader::securityOrigin() const
491 { 491 {
492 return m_options.securityOrigin ? m_options.securityOrigin.get() : m_documen t->securityOrigin(); 492 return m_options.securityOrigin ? m_options.securityOrigin.get() : m_documen t->securityOrigin();
493 } 493 }
494 494
495 } // namespace WebCore 495 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698