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

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

Issue 14949017: Implementation of W3C compliant CSP script-src nonce. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed broken nonce behavior on script redirects. Added test for redirects as well. Created 7 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved.
3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com) 3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com)
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 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. 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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 { 316 {
317 if (documentLoader()->applicationCacheHost()->maybeLoadFallbackForRedirect(t his, request, redirectResponse)) 317 if (documentLoader()->applicationCacheHost()->maybeLoadFallbackForRedirect(t his, request, redirectResponse))
318 return; 318 return;
319 319
320 // Store the previous URL because we may modify it. 320 // Store the previous URL because we may modify it.
321 KURL previousURL = m_request.url(); 321 KURL previousURL = m_request.url();
322 RefPtr<ResourceLoader> protect(this); 322 RefPtr<ResourceLoader> protect(this);
323 323
324 ASSERT(!request.isNull()); 324 ASSERT(!request.isNull());
325 if (!redirectResponse.isNull()) { 325 if (!redirectResponse.isNull()) {
326 if (!m_documentLoader->cachedResourceLoader()->canRequest(m_resource->ty pe(), request.url())) { 326 if (!m_documentLoader->cachedResourceLoader()->canRequest(m_resource->ty pe(), request.url(), m_options.cspNonce == NonceCheckValid)) {
327 cancel(); 327 cancel();
328 return; 328 return;
329 } 329 }
330 if (m_resource->type() == CachedResource::ImageResource && m_documentLoa der->cachedResourceLoader()->shouldDeferImageLoad(request.url())) { 330 if (m_resource->type() == CachedResource::ImageResource && m_documentLoa der->cachedResourceLoader()->shouldDeferImageLoad(request.url())) {
331 cancel(); 331 cancel();
332 return; 332 return;
333 } 333 }
334 m_resource->willSendRequest(request, redirectResponse); 334 m_resource->willSendRequest(request, redirectResponse);
335 } 335 }
336 336
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 info.addMember(m_request, "request"); 530 info.addMember(m_request, "request");
531 info.addMember(m_originalRequest, "originalRequest"); 531 info.addMember(m_originalRequest, "originalRequest");
532 info.addMember(m_deferredRequest, "deferredRequest"); 532 info.addMember(m_deferredRequest, "deferredRequest");
533 info.addMember(m_options, "options"); 533 info.addMember(m_options, "options");
534 info.addMember(m_resource, "resource"); 534 info.addMember(m_resource, "resource");
535 info.addMember(m_documentLoader, "documentLoader"); 535 info.addMember(m_documentLoader, "documentLoader");
536 info.addMember(m_requestCountTracker, "requestCountTracker"); 536 info.addMember(m_requestCountTracker, "requestCountTracker");
537 } 537 }
538 538
539 } 539 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698