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

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

Issue 2346293002: MHTML: Allows 'data:' URLs to be processed using normal request processing. (Closed)
Patch Set: Adds a rebaseline line to test expectations. 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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 activityLogger = V8DOMActivityLogger::currentActivityLoggerIfIsolate dWorld(); 437 activityLogger = V8DOMActivityLogger::currentActivityLoggerIfIsolate dWorld();
438 438
439 if (activityLogger) { 439 if (activityLogger) {
440 Vector<String> argv; 440 Vector<String> argv;
441 argv.append(Resource::resourceTypeToString(factory.type(), request.o ptions().initiatorInfo)); 441 argv.append(Resource::resourceTypeToString(factory.type(), request.o ptions().initiatorInfo));
442 argv.append(request.url()); 442 argv.append(request.url());
443 activityLogger->logEvent("blinkRequestResource", argv.size(), argv.d ata()); 443 activityLogger->logEvent("blinkRequestResource", argv.size(), argv.d ata());
444 } 444 }
445 } 445 }
446 446
447 bool isStaticData = request.resourceRequest().url().protocolIsData() || subs tituteData.isValid() || m_archive; 447 bool isDataUrl = request.resourceRequest().url().protocolIsData();
448 bool isStaticData = isDataUrl || substituteData.isValid() || m_archive;
448 Resource* resource(nullptr); 449 Resource* resource(nullptr);
449 if (isStaticData) { 450 if (isStaticData) {
450 resource = resourceForStaticData(request, factory, substituteData); 451 resource = resourceForStaticData(request, factory, substituteData);
451 // Abort the request if the archive doesn't contain the resource. 452 // Abort the request if the archive doesn't contain the resource, except
452 if (!resource && m_archive) 453 // in the case of data URLs which might have resources such as fonts
454 // that need to be decoded only on demand. These data URLs are allowed
455 // to be processed using the normal ResourceFetcher machinery.
456 if (!resource && !isDataUrl && m_archive)
453 return nullptr; 457 return nullptr;
454 } 458 }
455 if (!resource) 459 if (!resource)
456 resource = memoryCache()->resourceForURL(request.url(), getCacheIdentifi er()); 460 resource = memoryCache()->resourceForURL(request.url(), getCacheIdentifi er());
457 461
458 // See if we can use an existing resource from the cache. If so, we need to move it to be load blocking. 462 // See if we can use an existing resource from the cache. If so, we need to move it to be load blocking.
459 moveCachedNonBlockingResourceToBlocking(resource, request); 463 moveCachedNonBlockingResourceToBlocking(resource, request);
460 464
461 const RevalidationPolicy policy = determineRevalidationPolicy(factory.type() , request, resource, isStaticData); 465 const RevalidationPolicy policy = determineRevalidationPolicy(factory.type() , request, resource, isStaticData);
462 TRACE_EVENT_INSTANT1("blink", "ResourceFetcher::determineRevalidationPolicy" , TRACE_EVENT_SCOPE_THREAD, "revalidationPolicy", policy); 466 TRACE_EVENT_INSTANT1("blink", "ResourceFetcher::determineRevalidationPolicy" , TRACE_EVENT_SCOPE_THREAD, "revalidationPolicy", policy);
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
1356 visitor->trace(m_context); 1360 visitor->trace(m_context);
1357 visitor->trace(m_archive); 1361 visitor->trace(m_archive);
1358 visitor->trace(m_loaders); 1362 visitor->trace(m_loaders);
1359 visitor->trace(m_nonBlockingLoaders); 1363 visitor->trace(m_nonBlockingLoaders);
1360 visitor->trace(m_documentResources); 1364 visitor->trace(m_documentResources);
1361 visitor->trace(m_preloads); 1365 visitor->trace(m_preloads);
1362 visitor->trace(m_resourceTimingInfoMap); 1366 visitor->trace(m_resourceTimingInfoMap);
1363 } 1367 }
1364 1368
1365 } // namespace blink 1369 } // 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