Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 435 activityLogger = V8DOMActivityLogger::currentActivityLoggerIfIsolate dWorld(); | 435 activityLogger = V8DOMActivityLogger::currentActivityLoggerIfIsolate dWorld(); |
| 436 | 436 |
| 437 if (activityLogger) { | 437 if (activityLogger) { |
| 438 Vector<String> argv; | 438 Vector<String> argv; |
| 439 argv.append(Resource::resourceTypeToString(factory.type(), request.o ptions().initiatorInfo)); | 439 argv.append(Resource::resourceTypeToString(factory.type(), request.o ptions().initiatorInfo)); |
| 440 argv.append(request.url()); | 440 argv.append(request.url()); |
| 441 activityLogger->logEvent("blinkRequestResource", argv.size(), argv.d ata()); | 441 activityLogger->logEvent("blinkRequestResource", argv.size(), argv.d ata()); |
| 442 } | 442 } |
| 443 } | 443 } |
| 444 | 444 |
| 445 bool isStaticData = request.resourceRequest().url().protocolIsData() || subs tituteData.isValid() || m_archive; | 445 bool isDataUrl = request.resourceRequest().url().protocolIsData(); |
| 446 bool isStaticData = isDataUrl || substituteData.isValid() || m_archive; | |
| 446 Resource* resource(nullptr); | 447 Resource* resource(nullptr); |
| 447 if (isStaticData) { | 448 if (isStaticData) { |
| 448 resource = resourceForStaticData(request, factory, substituteData); | 449 resource = resourceForStaticData(request, factory, substituteData); |
| 449 // Abort the request if the archive doesn't contain the resource. | 450 // Abort the request if the archive doesn't contain the resource, except |
|
Dmitry Titov
2016/09/19 19:54:16
I still feel the resourceForStaticData should succ
dewittj
2016/09/20 22:44:55
The CSS spec says that fonts should not be "downlo
Nate Chapin
2016/09/21 19:30:02
What if resourceForStaticData() checks resourceNee
| |
| 450 if (!resource && m_archive) | 451 // in the case of data URLs which might have resources such as fonts |
| 452 // that need to be decoded only on demand. These data URLs are allowed | |
| 453 // to be processed using the normal ResourceFetcher machinery. | |
| 454 if (!resource && !isDataUrl && m_archive) | |
| 451 return nullptr; | 455 return nullptr; |
| 452 } | 456 } |
| 453 if (!resource) | 457 if (!resource) |
| 454 resource = memoryCache()->resourceForURL(request.url(), getCacheIdentifi er()); | 458 resource = memoryCache()->resourceForURL(request.url(), getCacheIdentifi er()); |
| 455 | 459 |
| 456 // See if we can use an existing resource from the cache. If so, we need to move it to be load blocking. | 460 // See if we can use an existing resource from the cache. If so, we need to move it to be load blocking. |
| 457 moveCachedNonBlockingResourceToBlocking(resource, request); | 461 moveCachedNonBlockingResourceToBlocking(resource, request); |
| 458 | 462 |
| 459 const RevalidationPolicy policy = determineRevalidationPolicy(factory.type() , request, resource, isStaticData); | 463 const RevalidationPolicy policy = determineRevalidationPolicy(factory.type() , request, resource, isStaticData); |
| 460 TRACE_EVENT_INSTANT1("blink", "ResourceFetcher::determineRevalidationPolicy" , TRACE_EVENT_SCOPE_THREAD, "revalidationPolicy", policy); | 464 TRACE_EVENT_INSTANT1("blink", "ResourceFetcher::determineRevalidationPolicy" , TRACE_EVENT_SCOPE_THREAD, "revalidationPolicy", policy); |
| (...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1333 visitor->trace(m_context); | 1337 visitor->trace(m_context); |
| 1334 visitor->trace(m_archive); | 1338 visitor->trace(m_archive); |
| 1335 visitor->trace(m_loaders); | 1339 visitor->trace(m_loaders); |
| 1336 visitor->trace(m_nonBlockingLoaders); | 1340 visitor->trace(m_nonBlockingLoaders); |
| 1337 visitor->trace(m_documentResources); | 1341 visitor->trace(m_documentResources); |
| 1338 visitor->trace(m_preloads); | 1342 visitor->trace(m_preloads); |
| 1339 visitor->trace(m_resourceTimingInfoMap); | 1343 visitor->trace(m_resourceTimingInfoMap); |
| 1340 } | 1344 } |
| 1341 | 1345 |
| 1342 } // namespace blink | 1346 } // namespace blink |
| OLD | NEW |