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

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

Issue 2873283002: [Reland] Allow headless TabSocket in isolated worlds & remove obsolete logic (Closed)
Patch Set: Fix GN Issue Created 3 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/xml/DocumentXMLTreeViewer.h" 5 #include "core/xml/DocumentXMLTreeViewer.h"
6 6
7 #include "bindings/core/v8/ScriptController.h" 7 #include "bindings/core/v8/ScriptController.h"
8 #include "bindings/core/v8/ScriptSourceCode.h" 8 #include "bindings/core/v8/ScriptSourceCode.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/dom/Element.h" 10 #include "core/dom/Element.h"
11 #include "core/frame/LocalFrame.h" 11 #include "core/frame/LocalFrame.h"
12 #include "platform/PlatformResourceLoader.h" 12 #include "platform/PlatformResourceLoader.h"
13 #include "platform/bindings/DOMWrapperWorld.h" 13 #include "platform/bindings/DOMWrapperWorld.h"
14 #include "platform/bindings/V8PerIsolateData.h" 14 #include "platform/bindings/V8PerIsolateData.h"
15 15
16 namespace blink { 16 namespace blink {
17 17
18 void TransformDocumentToXMLTreeView(Document& document) { 18 void TransformDocumentToXMLTreeView(Document& document) {
19 String script_string = LoadResourceAsASCIIString("DocumentXMLTreeViewer.js"); 19 String script_string = LoadResourceAsASCIIString("DocumentXMLTreeViewer.js");
20 String css_string = LoadResourceAsASCIIString("DocumentXMLTreeViewer.css"); 20 String css_string = LoadResourceAsASCIIString("DocumentXMLTreeViewer.css");
21 21
22 HeapVector<ScriptSourceCode> sources; 22 HeapVector<ScriptSourceCode> sources;
23 sources.push_back(ScriptSourceCode(script_string)); 23 sources.push_back(ScriptSourceCode(script_string));
24 v8::HandleScope handle_scope(V8PerIsolateData::MainThreadIsolate()); 24 v8::HandleScope handle_scope(V8PerIsolateData::MainThreadIsolate());
25 25
26 document.GetFrame()->GetScriptController().ExecuteScriptInIsolatedWorld( 26 document.GetFrame()->GetScriptController().ExecuteScriptInIsolatedWorld(
27 DOMWrapperWorld::kDocumentXMLTreeViewerWorldId, sources, nullptr); 27 IsolatedWorldId::kDocumentXMLTreeViewerWorldId, sources, nullptr);
28 28
29 Element* element = document.getElementById("xml-viewer-style"); 29 Element* element = document.getElementById("xml-viewer-style");
30 if (element) { 30 if (element) {
31 element->setTextContent(css_string); 31 element->setTextContent(css_string);
32 } 32 }
33 } 33 }
34 34
35 } // namespace blink 35 } // namespace blink
OLDNEW
« no previous file with comments | « headless/test/headless_browser_test.cc ('k') | third_party/WebKit/Source/platform/bindings/DOMWrapperWorld.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698