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

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

Issue 2975623002: Fix: Loading cid: resources in WebView. (Closed)
Patch Set: Rebase. Created 3 years, 5 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 | « no previous file | third_party/WebKit/Source/platform/loader/fetch/ResourceFetcherTest.cpp » ('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 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 rights reserved. 6 rights reserved.
7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
8 8
9 This library is free software; you can redistribute it and/or 9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public 10 modify it under the terms of the GNU Library General Public
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 if (result == kBlock) 637 if (result == kBlock)
638 return ResourceForBlockedRequest(params, factory, blocked_reason); 638 return ResourceForBlockedRequest(params, factory, blocked_reason);
639 639
640 if (!params.IsSpeculativePreload()) { 640 if (!params.IsSpeculativePreload()) {
641 // Only log if it's not for speculative preload. 641 // Only log if it's not for speculative preload.
642 Context().RecordLoadingActivity(identifier, resource_request, 642 Context().RecordLoadingActivity(identifier, resource_request,
643 factory.GetType(), 643 factory.GetType(),
644 params.Options().initiator_info.name); 644 params.Options().initiator_info.name);
645 } 645 }
646 646
647 // An URL with the "cid" scheme can only be handled by an MHTML Archive. 647 // A main resource request with the "cid" scheme can only be handled by an
648 // Abort the request when there is none. 648 // MHTML Archive. Abort the request when there is none.
649 if (!archive_ && resource_request.Url().ProtocolIs(kContentIdScheme)) 649 // Note: There are some embedders of WebView that are using Content-ID
650 // URLs for sub-resources, even without any MHTMLArchive. Please see
Torne 2017/07/14 13:55:47 Just a note (don't expect you to change this CL fo
arthursonzogni 2017/07/17 10:58:15 Thanks for this information. Without this check,
651 // https://crbug.com/739658.
652 if (!archive_ && factory.GetType() == Resource::kMainResource &&
653 resource_request.Url().ProtocolIs(kContentIdScheme)) {
650 return nullptr; 654 return nullptr;
655 }
651 656
652 bool is_data_url = resource_request.Url().ProtocolIsData(); 657 bool is_data_url = resource_request.Url().ProtocolIsData();
653 bool is_static_data = is_data_url || substitute_data.IsValid() || archive_; 658 bool is_static_data = is_data_url || substitute_data.IsValid() || archive_;
654 if (is_static_data) { 659 if (is_static_data) {
655 resource = ResourceForStaticData(params, factory, substitute_data); 660 resource = ResourceForStaticData(params, factory, substitute_data);
656 // Abort the request if the archive doesn't contain the resource, except in 661 // Abort the request if the archive doesn't contain the resource, except in
657 // the case of data URLs which might have resources such as fonts that need 662 // the case of data URLs which might have resources such as fonts that need
658 // to be decoded only on demand. These data URLs are allowed to be 663 // to be decoded only on demand. These data URLs are allowed to be
659 // processed using the normal ResourceFetcher machinery. 664 // processed using the normal ResourceFetcher machinery.
660 if (!resource && !is_data_url && archive_) 665 if (!resource && !is_data_url && archive_)
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after
1679 visitor->Trace(archive_); 1684 visitor->Trace(archive_);
1680 visitor->Trace(loaders_); 1685 visitor->Trace(loaders_);
1681 visitor->Trace(non_blocking_loaders_); 1686 visitor->Trace(non_blocking_loaders_);
1682 visitor->Trace(document_resources_); 1687 visitor->Trace(document_resources_);
1683 visitor->Trace(preloads_); 1688 visitor->Trace(preloads_);
1684 visitor->Trace(matched_preloads_); 1689 visitor->Trace(matched_preloads_);
1685 visitor->Trace(resource_timing_info_map_); 1690 visitor->Trace(resource_timing_info_map_);
1686 } 1691 }
1687 1692
1688 } // namespace blink 1693 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/loader/fetch/ResourceFetcherTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698