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

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

Issue 667423002: DevTools: failure of loading internal requests should not be reported. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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/loader/FrameFetchContext.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 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 1306
1307 void ResourceFetcher::didChangeLoadingPriority(const Resource* resource, Resourc eLoadPriority loadPriority, int intraPriorityValue) 1307 void ResourceFetcher::didChangeLoadingPriority(const Resource* resource, Resourc eLoadPriority loadPriority, int intraPriorityValue)
1308 { 1308 {
1309 TRACE_EVENT_ASYNC_STEP_INTO1("net", "Resource", resource, "ChangePriority", "priority", loadPriority); 1309 TRACE_EVENT_ASYNC_STEP_INTO1("net", "Resource", resource, "ChangePriority", "priority", loadPriority);
1310 context().dispatchDidChangeResourcePriority(resource->identifier(), loadPrio rity, intraPriorityValue); 1310 context().dispatchDidChangeResourcePriority(resource->identifier(), loadPrio rity, intraPriorityValue);
1311 } 1311 }
1312 1312
1313 void ResourceFetcher::didFailLoading(const Resource* resource, const ResourceErr or& error) 1313 void ResourceFetcher::didFailLoading(const Resource* resource, const ResourceErr or& error)
1314 { 1314 {
1315 TRACE_EVENT_ASYNC_END0("net", "Resource", resource); 1315 TRACE_EVENT_ASYNC_END0("net", "Resource", resource);
1316 context().dispatchDidFail(m_documentLoader, resource->identifier(), error); 1316 bool isInternalRequest = resource->options().initiatorInfo.name == FetchInit iatorTypeNames::internal;
1317 context().dispatchDidFail(m_documentLoader, resource->identifier(), error, i sInternalRequest);
1317 } 1318 }
1318 1319
1319 void ResourceFetcher::willSendRequest(unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse, const FetchInitiatorInfo& in itiatorInfo) 1320 void ResourceFetcher::willSendRequest(unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse, const FetchInitiatorInfo& in itiatorInfo)
1320 { 1321 {
1321 context().dispatchWillSendRequest(m_documentLoader, identifier, request, red irectResponse, initiatorInfo); 1322 context().dispatchWillSendRequest(m_documentLoader, identifier, request, red irectResponse, initiatorInfo);
1322 } 1323 }
1323 1324
1324 void ResourceFetcher::didReceiveResponse(const Resource* resource, const Resourc eResponse& response) 1325 void ResourceFetcher::didReceiveResponse(const Resource* resource, const Resourc eResponse& response)
1325 { 1326 {
1326 MixedContentChecker::checkMixedPrivatePublic(frame(), response.remoteIPAddre ss()); 1327 MixedContentChecker::checkMixedPrivatePublic(frame(), response.remoteIPAddre ss());
1327 1328
1328 // If the response is fetched via ServiceWorker, the original URL of the res ponse could be different from the URL of the request. 1329 // If the response is fetched via ServiceWorker, the original URL of the res ponse could be different from the URL of the request.
1329 if (response.wasFetchedViaServiceWorker()) { 1330 if (response.wasFetchedViaServiceWorker()) {
1330 if (!canRequest(resource->type(), resource->resourceRequest(), response. url(), resource->options(), false, FetchRequest::UseDefaultOriginRestrictionForT ype)) { 1331 if (!canRequest(resource->type(), resource->resourceRequest(), response. url(), resource->options(), false, FetchRequest::UseDefaultOriginRestrictionForT ype)) {
1331 resource->loader()->cancel(); 1332 resource->loader()->cancel();
1332 context().dispatchDidFail(m_documentLoader, resource->identifier(), ResourceError(errorDomainBlinkInternal, 0, response.url().string(), "Unsafe atte mpt to load URL " + response.url().elidedString() + " fetched by a ServiceWorker .")); 1333 bool isInternalRequest = resource->options().initiatorInfo.name == F etchInitiatorTypeNames::internal;
1334 context().dispatchDidFail(m_documentLoader, resource->identifier(), ResourceError(errorDomainBlinkInternal, 0, response.url().string(), "Unsafe atte mpt to load URL " + response.url().elidedString() + " fetched by a ServiceWorker ."), isInternalRequest);
1333 return; 1335 return;
1334 } 1336 }
1335 } 1337 }
1336 context().dispatchDidReceiveResponse(m_documentLoader, resource->identifier( ), response, resource->loader()); 1338 context().dispatchDidReceiveResponse(m_documentLoader, resource->identifier( ), response, resource->loader());
1337 } 1339 }
1338 1340
1339 void ResourceFetcher::didReceiveData(const Resource* resource, const char* data, int dataLength, int encodedDataLength) 1341 void ResourceFetcher::didReceiveData(const Resource* resource, const char* data, int dataLength, int encodedDataLength)
1340 { 1342 {
1341 context().dispatchDidReceiveData(m_documentLoader, resource->identifier(), d ata, dataLength, encodedDataLength); 1343 context().dispatchDidReceiveData(m_documentLoader, resource->identifier(), d ata, dataLength, encodedDataLength);
1342 } 1344 }
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
1542 1544
1543 void ResourceFetcher::trace(Visitor* visitor) 1545 void ResourceFetcher::trace(Visitor* visitor)
1544 { 1546 {
1545 visitor->trace(m_document); 1547 visitor->trace(m_document);
1546 visitor->trace(m_loaders); 1548 visitor->trace(m_loaders);
1547 visitor->trace(m_multipartLoaders); 1549 visitor->trace(m_multipartLoaders);
1548 ResourceLoaderHost::trace(visitor); 1550 ResourceLoaderHost::trace(visitor);
1549 } 1551 }
1550 1552
1551 } 1553 }
OLDNEW
« no previous file with comments | « Source/core/fetch/FetchContext.cpp ('k') | Source/core/loader/FrameFetchContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698