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

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

Issue 2359963003: MHTML: Allows 'data:' URLs to be processed using normal request processing. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/linux/mhtml/data-uri-font-expected.txt ('k') | no next file » | 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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 activityLogger = V8DOMActivityLogger::currentActivityLoggerIfIsolate dWorld(); 436 activityLogger = V8DOMActivityLogger::currentActivityLoggerIfIsolate dWorld();
437 437
438 if (activityLogger) { 438 if (activityLogger) {
439 Vector<String> argv; 439 Vector<String> argv;
440 argv.append(Resource::resourceTypeToString(factory.type(), request.o ptions().initiatorInfo)); 440 argv.append(Resource::resourceTypeToString(factory.type(), request.o ptions().initiatorInfo));
441 argv.append(request.url()); 441 argv.append(request.url());
442 activityLogger->logEvent("blinkRequestResource", argv.size(), argv.d ata()); 442 activityLogger->logEvent("blinkRequestResource", argv.size(), argv.d ata());
443 } 443 }
444 } 444 }
445 445
446 bool isStaticData = request.resourceRequest().url().protocolIsData() || subs tituteData.isValid() || m_archive; 446 bool isDataUrl = request.resourceRequest().url().protocolIsData();
447 bool isStaticData = isDataUrl || substituteData.isValid() || m_archive;
447 Resource* resource(nullptr); 448 Resource* resource(nullptr);
448 if (isStaticData) { 449 if (isStaticData) {
449 resource = resourceForStaticData(request, factory, substituteData); 450 resource = resourceForStaticData(request, factory, substituteData);
450 // Abort the request if the archive doesn't contain the resource. 451 // Abort the request if the archive doesn't contain the resource, except
451 if (!resource && m_archive) 452 // in the case of data URLs which might have resources such as fonts
453 // that need to be decoded only on demand. These data URLs are allowed
454 // to be processed using the normal ResourceFetcher machinery.
455 if (!resource && !isDataUrl && m_archive)
452 return nullptr; 456 return nullptr;
453 } 457 }
454 if (!resource) 458 if (!resource)
455 resource = memoryCache()->resourceForURL(request.url(), getCacheIdentifi er()); 459 resource = memoryCache()->resourceForURL(request.url(), getCacheIdentifi er());
456 460
457 // See if we can use an existing resource from the cache. If so, we need to move it to be load blocking. 461 // See if we can use an existing resource from the cache. If so, we need to move it to be load blocking.
458 moveCachedNonBlockingResourceToBlocking(resource, request); 462 moveCachedNonBlockingResourceToBlocking(resource, request);
459 463
460 const RevalidationPolicy policy = determineRevalidationPolicy(factory.type() , request, resource, isStaticData); 464 const RevalidationPolicy policy = determineRevalidationPolicy(factory.type() , request, resource, isStaticData);
461 TRACE_EVENT_INSTANT1("blink", "ResourceFetcher::determineRevalidationPolicy" , TRACE_EVENT_SCOPE_THREAD, "revalidationPolicy", policy); 465 TRACE_EVENT_INSTANT1("blink", "ResourceFetcher::determineRevalidationPolicy" , TRACE_EVENT_SCOPE_THREAD, "revalidationPolicy", policy);
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
1314 visitor->trace(m_context); 1318 visitor->trace(m_context);
1315 visitor->trace(m_archive); 1319 visitor->trace(m_archive);
1316 visitor->trace(m_loaders); 1320 visitor->trace(m_loaders);
1317 visitor->trace(m_nonBlockingLoaders); 1321 visitor->trace(m_nonBlockingLoaders);
1318 visitor->trace(m_documentResources); 1322 visitor->trace(m_documentResources);
1319 visitor->trace(m_preloads); 1323 visitor->trace(m_preloads);
1320 visitor->trace(m_resourceTimingInfoMap); 1324 visitor->trace(m_resourceTimingInfoMap);
1321 } 1325 }
1322 1326
1323 } // namespace blink 1327 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/linux/mhtml/data-uri-font-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698