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

Side by Side Diff: Source/core/loader/DocumentLoader.cpp

Issue 1125053002: Move renderFallbackContent() into FrameOwner interface. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Experiment Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLObjectElement.cpp ('k') | Source/web/RemoteBridgeFrameOwner.h » ('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) 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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 m_mainResource->setDataBufferingPolicy(BufferData); 451 m_mainResource->setDataBufferingPolicy(BufferData);
452 452
453 if (!shouldContinueForResponse()) { 453 if (!shouldContinueForResponse()) {
454 InspectorInstrumentation::continueWithPolicyIgnore(m_frame, this, m_main Resource->identifier(), m_response); 454 InspectorInstrumentation::continueWithPolicyIgnore(m_frame, this, m_main Resource->identifier(), m_response);
455 cancelMainResourceLoad(ResourceError::cancelledError(m_request.url())); 455 cancelMainResourceLoad(ResourceError::cancelledError(m_request.url()));
456 return; 456 return;
457 } 457 }
458 458
459 if (m_response.isHTTP()) { 459 if (m_response.isHTTP()) {
460 int status = m_response.httpStatusCode(); 460 int status = m_response.httpStatusCode();
461 // FIXME: Fallback content only works if the parent is in the same proce sss.
462 if ((status < 200 || status >= 300) && m_frame->owner()) { 461 if ((status < 200 || status >= 300) && m_frame->owner()) {
463 if (!m_frame->deprecatedLocalOwner()) { 462 if (m_frame->owner()->renderFallbackContent()) {
Nate Chapin 2015/05/07 18:01:07 This block looks empty? Is returning a bool actual
dcheng 2015/05/07 18:02:12 I think this is already cleaned up in the latest P
464 ASSERT_NOT_REACHED();
465 } else if (m_frame->deprecatedLocalOwner()->isObjectElement()) {
466 m_frame->deprecatedLocalOwner()->renderFallbackContent();
467 // object elements are no longer rendered after we fallback, so don't
468 // keep trying to process data from their load
469 cancelMainResourceLoad(ResourceError::cancelledError(m_request.u rl()));
470 } 463 }
471 } 464 }
472 } 465 }
473 } 466 }
474 467
475 void DocumentLoader::ensureWriter(const AtomicString& mimeType, const KURL& over ridingURL) 468 void DocumentLoader::ensureWriter(const AtomicString& mimeType, const KURL& over ridingURL)
476 { 469 {
477 if (m_writer) 470 if (m_writer)
478 return; 471 return;
479 472
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L() 777 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L()
785 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument) 778 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument)
786 { 779 {
787 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true, ForceSynchronousParsing); 780 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true, ForceSynchronousParsing);
788 if (!source.isNull()) 781 if (!source.isNull())
789 m_writer->appendReplacingData(source); 782 m_writer->appendReplacingData(source);
790 endWriting(m_writer.get()); 783 endWriting(m_writer.get());
791 } 784 }
792 785
793 } // namespace blink 786 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/HTMLObjectElement.cpp ('k') | Source/web/RemoteBridgeFrameOwner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698