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/loader/DocumentLoader.cpp

Issue 2866873002: Validate generated MHTML in mhtml_generation_browsertest.cc tests. (Closed)
Patch Set: 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 if (!response_end_time) 434 if (!response_end_time)
435 response_end_time = time_of_last_data_received_; 435 response_end_time = time_of_last_data_received_;
436 if (!response_end_time) 436 if (!response_end_time)
437 response_end_time = MonotonicallyIncreasingTime(); 437 response_end_time = MonotonicallyIncreasingTime();
438 GetTiming().SetResponseEnd(response_end_time); 438 GetTiming().SetResponseEnd(response_end_time);
439 if (!MaybeCreateArchive()) { 439 if (!MaybeCreateArchive()) {
440 // If this is an empty document, it will not have actually been created yet. 440 // If this is an empty document, it will not have actually been created yet.
441 // Commit dummy data so that DocumentWriter::begin() gets called and creates 441 // Commit dummy data so that DocumentWriter::begin() gets called and creates
442 // the Document. 442 // the Document.
443 if (!writer_) 443 if (!writer_)
444 CommitData(0, 0); 444 CommitData(0, 0);
carlosk 2017/05/05 23:46:27 IIUC the local frame is only initialized when data
Łukasz Anforowicz 2017/05/06 00:14:48 Thank you for the comment above. Unfortunately, I
carlosk 2017/05/16 20:56:08 I was confused by all the checks for |frame_| not
445
446 // Log if attempting to load an invalid archive resource.
447 if (IsArchiveMIMEType(response_.MimeType())) {
448 frame_->GetDocument()->AddConsoleMessage(ConsoleMessage::Create(
449 kOtherMessageSource, kErrorMessageLevel,
450 "Malformed multipart archive: " + response_.Url().ElidedString()));
Łukasz Anforowicz 2017/05/06 00:14:48 I see that KURL::ElidedString returns an empty str
Łukasz Anforowicz 2017/05/06 00:42:47 Ooops. I think I misread the code - what I said a
carlosk 2017/05/16 20:56:08 This is me copy/pasting without fully understandin
451 }
445 } 452 }
446 453
447 if (!frame_) 454 if (!frame_)
448 return; 455 return;
449 456
450 application_cache_host_->FinishedLoadingMainResource(); 457 application_cache_host_->FinishedLoadingMainResource();
451 EndWriting(); 458 EndWriting();
452 ClearMainResourceHandle(); 459 ClearMainResourceHandle();
453 } 460 }
454 461
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 InstallNewDocumentReason::kJavascriptURL, 1110 InstallNewDocumentReason::kJavascriptURL,
1104 kForceSynchronousParsing, KURL()); 1111 kForceSynchronousParsing, KURL());
1105 if (!source.IsNull()) 1112 if (!source.IsNull())
1106 writer_->AppendReplacingData(source); 1113 writer_->AppendReplacingData(source);
1107 EndWriting(); 1114 EndWriting();
1108 } 1115 }
1109 1116
1110 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 1117 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
1111 1118
1112 } // namespace blink 1119 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698