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

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

Issue 570563003: Implement CSP check for manifest fetching (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase corrected Created 6 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
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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 newRequest.setOriginRestriction(FetchRequest::NoOriginRestriction); 497 newRequest.setOriginRestriction(FetchRequest::NoOriginRestriction);
498 ASSERT(!resource()); 498 ASSERT(!resource());
499 if (request.requestContext() == blink::WebURLRequest::RequestContextVide o || request.requestContext() == blink::WebURLRequest::RequestContextAudio) 499 if (request.requestContext() == blink::WebURLRequest::RequestContextVide o || request.requestContext() == blink::WebURLRequest::RequestContextAudio)
500 setResource(m_document.fetcher()->fetchMedia(newRequest)); 500 setResource(m_document.fetcher()->fetchMedia(newRequest));
501 else 501 else
502 setResource(m_document.fetcher()->fetchRawResource(newRequest)); 502 setResource(m_document.fetcher()->fetchRawResource(newRequest));
503 if (resource() && resource()->loader()) { 503 if (resource() && resource()->loader()) {
504 unsigned long identifier = resource()->identifier(); 504 unsigned long identifier = resource()->identifier();
505 InspectorInstrumentation::documentThreadableLoaderStartedLoadingForC lient(&m_document, identifier, m_client); 505 InspectorInstrumentation::documentThreadableLoaderStartedLoadingForC lient(&m_document, identifier, m_client);
506 } 506 }
507 if (!resource())
508 m_client->didFail(ResourceError());
507 return; 509 return;
508 } 510 }
509 511
510 FetchRequest fetchRequest(request, m_options.initiator, resourceLoaderOption s); 512 FetchRequest fetchRequest(request, m_options.initiator, resourceLoaderOption s);
511 if (m_options.crossOriginRequestPolicy == AllowCrossOriginRequests) 513 if (m_options.crossOriginRequestPolicy == AllowCrossOriginRequests)
512 fetchRequest.setOriginRestriction(FetchRequest::NoOriginRestriction); 514 fetchRequest.setOriginRestriction(FetchRequest::NoOriginRestriction);
513 ResourcePtr<Resource> resource = m_document.fetcher()->fetchSynchronously(fe tchRequest); 515 ResourcePtr<Resource> resource = m_document.fetcher()->fetchSynchronously(fe tchRequest);
514 ResourceResponse response = resource ? resource->response() : ResourceRespon se(); 516 ResourceResponse response = resource ? resource->response() : ResourceRespon se();
515 unsigned long identifier = resource ? resource->identifier() : std::numeric_ limits<unsigned long>::max(); 517 unsigned long identifier = resource ? resource->identifier() : std::numeric_ limits<unsigned long>::max();
516 ResourceError error = resource ? resource->resourceError() : ResourceError() ; 518 ResourceError error = resource ? resource->resourceError() : ResourceError() ;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 return DoNotAllowStoredCredentials; 569 return DoNotAllowStoredCredentials;
568 return m_resourceLoaderOptions.allowCredentials; 570 return m_resourceLoaderOptions.allowCredentials;
569 } 571 }
570 572
571 SecurityOrigin* DocumentThreadableLoader::securityOrigin() const 573 SecurityOrigin* DocumentThreadableLoader::securityOrigin() const
572 { 574 {
573 return m_securityOrigin ? m_securityOrigin.get() : m_document.securityOrigin (); 575 return m_securityOrigin ? m_securityOrigin.get() : m_document.securityOrigin ();
574 } 576 }
575 577
576 } // namespace blink 578 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698