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

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

Issue 1009583003: Add CSP header for resources with an active policy (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add return statement to avoid compiler error Created 5 years, 9 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
« no previous file with comments | « Source/core/fetch/FetchContext.cpp ('k') | Source/core/frame/csp/CSPDirectiveList.h » ('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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 } 459 }
460 460
461 ResourcePtr<Resource> ResourceFetcher::requestResource(Resource::Type type, Fetc hRequest& request) 461 ResourcePtr<Resource> ResourceFetcher::requestResource(Resource::Type type, Fetc hRequest& request)
462 { 462 {
463 ASSERT(request.options().synchronousPolicy == RequestAsynchronously || type == Resource::Raw); 463 ASSERT(request.options().synchronousPolicy == RequestAsynchronously || type == Resource::Raw);
464 464
465 TRACE_EVENT0("blink", "ResourceFetcher::requestResource"); 465 TRACE_EVENT0("blink", "ResourceFetcher::requestResource");
466 466
467 context().upgradeInsecureRequest(request); 467 context().upgradeInsecureRequest(request);
468 context().addClientHintsIfNecessary(request); 468 context().addClientHintsIfNecessary(request);
469 context().addCSPHeaderIfNecessary(type, request);
469 470
470 KURL url = request.resourceRequest().url(); 471 KURL url = request.resourceRequest().url();
471 472
472 WTF_LOG(ResourceLoading, "ResourceFetcher::requestResource '%s', charset '%s ', priority=%d, forPreload=%u, type=%s", url.elidedString().latin1().data(), req uest.charset().latin1().data(), request.priority(), request.forPreload(), Resour ceTypeName(type)); 473 WTF_LOG(ResourceLoading, "ResourceFetcher::requestResource '%s', charset '%s ', priority=%d, forPreload=%u, type=%s", url.elidedString().latin1().data(), req uest.charset().latin1().data(), request.priority(), request.forPreload(), Resour ceTypeName(type));
473 474
474 // If only the fragment identifiers differ, it is the same resource. 475 // If only the fragment identifiers differ, it is the same resource.
475 url = MemoryCache::removeFragmentIdentifierIfNeeded(url); 476 url = MemoryCache::removeFragmentIdentifierIfNeeded(url);
476 477
477 if (!url.isValid()) 478 if (!url.isValid())
478 return nullptr; 479 return nullptr;
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
1291 ResourceLoaderHost::trace(visitor); 1292 ResourceLoaderHost::trace(visitor);
1292 } 1293 }
1293 1294
1294 ResourceFetcher* ResourceFetcher::toResourceFetcher(ResourceLoaderHost* host) 1295 ResourceFetcher* ResourceFetcher::toResourceFetcher(ResourceLoaderHost* host)
1295 { 1296 {
1296 ASSERT(host->objectType() == ResourceLoaderHost::ResourceFetcherType); 1297 ASSERT(host->objectType() == ResourceLoaderHost::ResourceFetcherType);
1297 return static_cast<ResourceFetcher*>(host); 1298 return static_cast<ResourceFetcher*>(host);
1298 } 1299 }
1299 1300
1300 } 1301 }
OLDNEW
« no previous file with comments | « Source/core/fetch/FetchContext.cpp ('k') | Source/core/frame/csp/CSPDirectiveList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698