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

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: Simplify 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.h ('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. 461 if ((status < 200 || status >= 300) && m_frame->owner())
462 if ((status < 200 || status >= 300) && m_frame->owner()) { 462 m_frame->owner()->renderFallbackContent();
463 if (!m_frame->deprecatedLocalOwner()) {
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 }
471 }
472 } 463 }
473 } 464 }
474 465
475 void DocumentLoader::ensureWriter(const AtomicString& mimeType, const KURL& over ridingURL) 466 void DocumentLoader::ensureWriter(const AtomicString& mimeType, const KURL& over ridingURL)
476 { 467 {
477 if (m_writer) 468 if (m_writer)
478 return; 469 return;
479 470
480 const AtomicString& encoding = m_frame->host()->overrideEncoding().isNull() ? response().textEncodingName() : m_frame->host()->overrideEncoding(); 471 const AtomicString& encoding = m_frame->host()->overrideEncoding().isNull() ? response().textEncodingName() : m_frame->host()->overrideEncoding();
481 472
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L() 775 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L()
785 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument) 776 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument)
786 { 777 {
787 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true, ForceSynchronousParsing); 778 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true, ForceSynchronousParsing);
788 if (!source.isNull()) 779 if (!source.isNull())
789 m_writer->appendReplacingData(source); 780 m_writer->appendReplacingData(source);
790 endWriting(m_writer.get()); 781 endWriting(m_writer.get());
791 } 782 }
792 783
793 } // namespace blink 784 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/HTMLObjectElement.h ('k') | Source/web/RemoteBridgeFrameOwner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698