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

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

Issue 2866873002: Validate generated MHTML in mhtml_generation_browsertest.cc tests. (Closed)
Patch Set: Fixed layout test expectation. Created 3 years, 7 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/mhtml/mhtml_in_iframe-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 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 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 " was preloaded using link preload but not used within a few " 1150 " was preloaded using link preload but not used within a few "
1151 "seconds from the window's load event. Please make sure it " 1151 "seconds from the window's load event. Please make sure it "
1152 "wasn't preloaded for nothing.", 1152 "wasn't preloaded for nothing.",
1153 FetchContext::kLogWarningMessage); 1153 FetchContext::kLogWarningMessage);
1154 } 1154 }
1155 } 1155 }
1156 } 1156 }
1157 1157
1158 ArchiveResource* ResourceFetcher::CreateArchive(Resource* resource) { 1158 ArchiveResource* ResourceFetcher::CreateArchive(Resource* resource) {
1159 // Only the top-frame can load MHTML. 1159 // Only the top-frame can load MHTML.
1160 if (!Context().IsMainFrame()) 1160 if (!Context().IsMainFrame()) {
1161 Context().AddConsoleMessage(
1162 "Attempted to load a multipart archive into an subframe: " +
1163 resource->Url().GetString(),
1164 FetchContext::kLogErrorMessage);
1161 return nullptr; 1165 return nullptr;
1166 }
1167
1162 archive_ = MHTMLArchive::Create(resource->Url(), resource->ResourceBuffer()); 1168 archive_ = MHTMLArchive::Create(resource->Url(), resource->ResourceBuffer());
1163 return archive_ ? archive_->MainResource() : nullptr; 1169 if (!archive_) {
1170 // Log if attempting to load an invalid archive resource.
1171 Context().AddConsoleMessage(
1172 "Malformed multipart archive: " + resource->Url().GetString(),
1173 FetchContext::kLogErrorMessage);
1174 return nullptr;
1175 }
1176
1177 return archive_->MainResource();
1164 } 1178 }
1165 1179
1166 ResourceTimingInfo* ResourceFetcher::GetNavigationTimingInfo() { 1180 ResourceTimingInfo* ResourceFetcher::GetNavigationTimingInfo() {
1167 return navigation_timing_info_.Get(); 1181 return navigation_timing_info_.Get();
1168 } 1182 }
1169 1183
1170 void ResourceFetcher::HandleLoadCompletion(Resource* resource) { 1184 void ResourceFetcher::HandleLoadCompletion(Resource* resource) {
1171 Context().DidLoadResource(resource); 1185 Context().DidLoadResource(resource);
1172 1186
1173 resource->ReloadIfLoFiOrPlaceholderImage(this, Resource::kReloadIfNeeded); 1187 resource->ReloadIfLoFiOrPlaceholderImage(this, Resource::kReloadIfNeeded);
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
1559 visitor->Trace(context_); 1573 visitor->Trace(context_);
1560 visitor->Trace(archive_); 1574 visitor->Trace(archive_);
1561 visitor->Trace(loaders_); 1575 visitor->Trace(loaders_);
1562 visitor->Trace(non_blocking_loaders_); 1576 visitor->Trace(non_blocking_loaders_);
1563 visitor->Trace(document_resources_); 1577 visitor->Trace(document_resources_);
1564 visitor->Trace(preloads_); 1578 visitor->Trace(preloads_);
1565 visitor->Trace(resource_timing_info_map_); 1579 visitor->Trace(resource_timing_info_map_);
1566 } 1580 }
1567 1581
1568 } // namespace blink 1582 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/mhtml/mhtml_in_iframe-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698