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

Side by Side Diff: third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp

Issue 2562093002: Move DocumentXMLTreeViewer off of private script (Closed)
Patch Set: Use V8PerIsolateData::mainThreadIsolate() Created 4 years 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) 2000 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2005, 2006, 2008, 2014 Apple Inc. All rights reserved. 3 * Copyright (C) 2005, 2006, 2008, 2014 Apple Inc. All rights reserved.
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
5 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 5 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2008 Holger Hans Peter Freyther 7 * Copyright (C) 2008 Holger Hans Peter Freyther
8 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * 10 *
(...skipping 12 matching lines...) Expand all
23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 * Boston, MA 02110-1301, USA. 24 * Boston, MA 02110-1301, USA.
25 */ 25 */
26 26
27 #include "core/xml/parser/XMLDocumentParser.h" 27 #include "core/xml/parser/XMLDocumentParser.h"
28 28
29 #include "bindings/core/v8/ExceptionState.h" 29 #include "bindings/core/v8/ExceptionState.h"
30 #include "bindings/core/v8/ExceptionStatePlaceholder.h" 30 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
31 #include "bindings/core/v8/ScriptController.h" 31 #include "bindings/core/v8/ScriptController.h"
32 #include "bindings/core/v8/ScriptSourceCode.h" 32 #include "bindings/core/v8/ScriptSourceCode.h"
33 #include "bindings/core/v8/V8Document.h"
34 #include "core/HTMLNames.h" 33 #include "core/HTMLNames.h"
35 #include "core/XMLNSNames.h" 34 #include "core/XMLNSNames.h"
36 #include "core/dom/CDATASection.h" 35 #include "core/dom/CDATASection.h"
37 #include "core/dom/Comment.h" 36 #include "core/dom/Comment.h"
38 #include "core/dom/Document.h" 37 #include "core/dom/Document.h"
39 #include "core/dom/DocumentFragment.h" 38 #include "core/dom/DocumentFragment.h"
40 #include "core/dom/DocumentParserTiming.h" 39 #include "core/dom/DocumentParserTiming.h"
41 #include "core/dom/DocumentType.h" 40 #include "core/dom/DocumentType.h"
42 #include "core/dom/ProcessingInstruction.h" 41 #include "core/dom/ProcessingInstruction.h"
43 #include "core/dom/ScriptLoader.h" 42 #include "core/dom/ScriptLoader.h"
44 #include "core/dom/StyleEngine.h" 43 #include "core/dom/StyleEngine.h"
45 #include "core/dom/TransformSource.h" 44 #include "core/dom/TransformSource.h"
46 #include "core/fetch/FetchInitiatorTypeNames.h" 45 #include "core/fetch/FetchInitiatorTypeNames.h"
47 #include "core/fetch/RawResource.h" 46 #include "core/fetch/RawResource.h"
48 #include "core/fetch/ResourceFetcher.h" 47 #include "core/fetch/ResourceFetcher.h"
49 #include "core/frame/LocalFrame.h" 48 #include "core/frame/LocalFrame.h"
50 #include "core/frame/UseCounter.h" 49 #include "core/frame/UseCounter.h"
51 #include "core/html/HTMLHtmlElement.h" 50 #include "core/html/HTMLHtmlElement.h"
52 #include "core/html/HTMLTemplateElement.h" 51 #include "core/html/HTMLTemplateElement.h"
53 #include "core/html/parser/HTMLEntityParser.h" 52 #include "core/html/parser/HTMLEntityParser.h"
54 #include "core/html/parser/TextResourceDecoder.h" 53 #include "core/html/parser/TextResourceDecoder.h"
55 #include "core/inspector/ConsoleMessage.h" 54 #include "core/inspector/ConsoleMessage.h"
56 #include "core/loader/FrameLoader.h" 55 #include "core/loader/FrameLoader.h"
57 #include "core/loader/ImageLoader.h" 56 #include "core/loader/ImageLoader.h"
58 #include "core/svg/graphics/SVGImage.h" 57 #include "core/svg/graphics/SVGImage.h"
58 #include "core/xml/DocumentXMLTreeViewer.h"
59 #include "core/xml/DocumentXSLT.h" 59 #include "core/xml/DocumentXSLT.h"
60 #include "core/xml/parser/SharedBufferReader.h" 60 #include "core/xml/parser/SharedBufferReader.h"
61 #include "core/xml/parser/XMLDocumentParserScope.h" 61 #include "core/xml/parser/XMLDocumentParserScope.h"
62 #include "core/xml/parser/XMLParserInput.h" 62 #include "core/xml/parser/XMLParserInput.h"
63 #include "platform/RuntimeEnabledFeatures.h" 63 #include "platform/RuntimeEnabledFeatures.h"
64 #include "platform/SharedBuffer.h" 64 #include "platform/SharedBuffer.h"
65 #include "platform/network/ResourceError.h" 65 #include "platform/network/ResourceError.h"
66 #include "platform/network/ResourceRequest.h" 66 #include "platform/network/ResourceRequest.h"
67 #include "platform/network/ResourceResponse.h" 67 #include "platform/network/ResourceResponse.h"
68 #include "platform/tracing/TraceEvent.h" 68 #include "platform/tracing/TraceEvent.h"
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after
1533 finishParsing(context()); 1533 finishParsing(context());
1534 } 1534 }
1535 1535
1536 m_context = nullptr; 1536 m_context = nullptr;
1537 } 1537 }
1538 } 1538 }
1539 1539
1540 bool xmlViewerMode = !m_sawError && !m_sawCSS && !m_sawXSLTransform && 1540 bool xmlViewerMode = !m_sawError && !m_sawCSS && !m_sawXSLTransform &&
1541 hasNoStyleInformation(document()); 1541 hasNoStyleInformation(document());
1542 if (xmlViewerMode) { 1542 if (xmlViewerMode) {
1543 const char noStyleMessage[] =
1544 "This XML file does not appear to have any style information "
1545 "associated with it. The document tree is shown below.";
1546 document()->setIsViewSource(true); 1543 document()->setIsViewSource(true);
1547 V8Document::PrivateScript::transformDocumentToTreeViewMethod( 1544 transformDocumentToXMLTreeView(*document());
1548 document()->frame(), document(), noStyleMessage);
1549 } else if (m_sawXSLTransform) { 1545 } else if (m_sawXSLTransform) {
1550 xmlDocPtr doc = 1546 xmlDocPtr doc =
1551 xmlDocPtrForString(document(), m_originalSourceForTransform.toString(), 1547 xmlDocPtrForString(document(), m_originalSourceForTransform.toString(),
1552 document()->url().getString()); 1548 document()->url().getString());
1553 document()->setTransformSource(WTF::makeUnique<TransformSource>(doc)); 1549 document()->setTransformSource(WTF::makeUnique<TransformSource>(doc));
1554 DocumentParser::stopParsing(); 1550 DocumentParser::stopParsing();
1555 } 1551 }
1556 } 1552 }
1557 1553
1558 xmlDocPtr xmlDocPtrForString(Document* document, 1554 xmlDocPtr xmlDocPtrForString(Document* document,
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1707 RefPtr<XMLParserContext> parser = 1703 RefPtr<XMLParserContext> parser =
1708 XMLParserContext::createStringParser(&sax, &state); 1704 XMLParserContext::createStringParser(&sax, &state);
1709 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; 1705 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />";
1710 parseChunk(parser->context(), parseString); 1706 parseChunk(parser->context(), parseString);
1711 finishParsing(parser->context()); 1707 finishParsing(parser->context());
1712 attrsOK = state.gotAttributes; 1708 attrsOK = state.gotAttributes;
1713 return state.attributes; 1709 return state.attributes;
1714 } 1710 }
1715 1711
1716 } // namespace blink 1712 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/xml/DocumentXMLTreeViewer.js ('k') | third_party/WebKit/public/blink_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698