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

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: Add comment 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
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()) {
464 ASSERT_NOT_REACHED(); 463 // Don't keep trying to process the data from the load if the
465 } else if (m_frame->deprecatedLocalOwner()->isObjectElement()) { 464 // fallback content replaces the frame.
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())); 465 cancelMainResourceLoad(ResourceError::cancelledError(m_request.u rl()));
470 } 466 }
471 } 467 }
472 } 468 }
473 } 469 }
474 470
475 void DocumentLoader::ensureWriter(const AtomicString& mimeType, const KURL& over ridingURL) 471 void DocumentLoader::ensureWriter(const AtomicString& mimeType, const KURL& over ridingURL)
476 { 472 {
477 if (m_writer) 473 if (m_writer)
478 return; 474 return;
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L() 780 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L()
785 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument) 781 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument)
786 { 782 {
787 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true, ForceSynchronousParsing); 783 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true, ForceSynchronousParsing);
788 if (!source.isNull()) 784 if (!source.isNull())
789 m_writer->appendReplacingData(source); 785 m_writer->appendReplacingData(source);
790 endWriting(m_writer.get()); 786 endWriting(m_writer.get());
791 } 787 }
792 788
793 } // namespace blink 789 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698