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

Side by Side Diff: Source/core/dom/Document.cpp

Issue 695943002: Reland "Prepare blink to unify definitions of load completion" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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/dom/Document.h ('k') | Source/core/dom/ProcessingInstruction.cpp » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 2473 matching lines...) Expand 10 before | Expand all | Expand 10 after
2484 } 2484 }
2485 2485
2486 m_frame->loader().checkCompleted(); 2486 m_frame->loader().checkCompleted();
2487 } 2487 }
2488 2488
2489 void Document::implicitClose() 2489 void Document::implicitClose()
2490 { 2490 {
2491 ASSERT(!inStyleRecalc()); 2491 ASSERT(!inStyleRecalc());
2492 if (processingLoadEvent() || !m_parser) 2492 if (processingLoadEvent() || !m_parser)
2493 return; 2493 return;
2494 if (frame() && frame()->navigationScheduler().locationChangePending()) 2494 if (frame() && frame()->navigationScheduler().locationChangePending()) {
2495 suppressLoadEvent();
2495 return; 2496 return;
2497 }
2496 2498
2497 // The call to dispatchWindowLoadEvent can detach the LocalDOMWindow and cau se it (and its 2499 // The call to dispatchWindowLoadEvent can detach the LocalDOMWindow and cau se it (and its
2498 // attached Document) to be destroyed. 2500 // attached Document) to be destroyed.
2499 RefPtrWillBeRawPtr<LocalDOMWindow> protectedWindow(this->domWindow()); 2501 RefPtrWillBeRawPtr<LocalDOMWindow> protectedWindow(this->domWindow());
2500 2502
2501 m_loadEventProgress = LoadEventInProgress; 2503 m_loadEventProgress = LoadEventInProgress;
2502 2504
2503 ScriptableDocumentParser* parser = scriptableDocumentParser(); 2505 ScriptableDocumentParser* parser = scriptableDocumentParser();
2504 m_wellFormed = parser && parser->wellFormed(); 2506 m_wellFormed = parser && parser->wellFormed();
2505 2507
(...skipping 1912 matching lines...) Expand 10 before | Expand all | Expand 10 after
4418 4420
4419 void Document::applyXSLTransform(ProcessingInstruction* pi) 4421 void Document::applyXSLTransform(ProcessingInstruction* pi)
4420 { 4422 {
4421 ASSERT(!pi->isLoading()); 4423 ASSERT(!pi->isLoading());
4422 UseCounter::count(*this, UseCounter::XSLProcessingInstruction); 4424 UseCounter::count(*this, UseCounter::XSLProcessingInstruction);
4423 RefPtrWillBeRawPtr<XSLTProcessor> processor = XSLTProcessor::create(*this); 4425 RefPtrWillBeRawPtr<XSLTProcessor> processor = XSLTProcessor::create(*this);
4424 processor->setXSLStyleSheet(toXSLStyleSheet(pi->sheet())); 4426 processor->setXSLStyleSheet(toXSLStyleSheet(pi->sheet()));
4425 String resultMIMEType; 4427 String resultMIMEType;
4426 String newSource; 4428 String newSource;
4427 String resultEncoding; 4429 String resultEncoding;
4428 if (!processor->transformToString(this, resultMIMEType, newSource, resultEnc oding)) 4430 setParsing(true);
4431 if (!processor->transformToString(this, resultMIMEType, newSource, resultEnc oding)) {
4432 setParsing(false);
4429 return; 4433 return;
4434 }
4430 // FIXME: If the transform failed we should probably report an error (like M ozilla does). 4435 // FIXME: If the transform failed we should probably report an error (like M ozilla does).
4431 LocalFrame* ownerFrame = frame(); 4436 LocalFrame* ownerFrame = frame();
4432 processor->createDocumentFromSource(newSource, resultEncoding, resultMIMETyp e, this, ownerFrame); 4437 processor->createDocumentFromSource(newSource, resultEncoding, resultMIMETyp e, this, ownerFrame);
4433 InspectorInstrumentation::frameDocumentUpdated(ownerFrame); 4438 InspectorInstrumentation::frameDocumentUpdated(ownerFrame);
4439 setParsing(false);
4434 } 4440 }
4435 4441
4436 void Document::setTransformSource(PassOwnPtr<TransformSource> source) 4442 void Document::setTransformSource(PassOwnPtr<TransformSource> source)
4437 { 4443 {
4438 m_transformSource = source; 4444 m_transformSource = source;
4439 } 4445 }
4440 4446
4441 void Document::setDesignMode(InheritedBool value) 4447 void Document::setDesignMode(InheritedBool value)
4442 { 4448 {
4443 m_designMode = value; 4449 m_designMode = value;
(...skipping 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after
5825 #ifndef NDEBUG 5831 #ifndef NDEBUG
5826 using namespace blink; 5832 using namespace blink;
5827 void showLiveDocumentInstances() 5833 void showLiveDocumentInstances()
5828 { 5834 {
5829 WeakDocumentSet& set = liveDocumentSet(); 5835 WeakDocumentSet& set = liveDocumentSet();
5830 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5836 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5831 for (Document* document : set) 5837 for (Document* document : set)
5832 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5838 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5833 } 5839 }
5834 #endif 5840 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/ProcessingInstruction.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698