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

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

Issue 2562093002: Move DocumentXMLTreeViewer off of private script (Closed)
Patch Set: Code review changes 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "core/xml/DocumentXMLTreeViewer.h"
6
7 #include "bindings/core/v8/DOMWrapperWorld.h"
8 #include "bindings/core/v8/ScriptController.h"
9 #include "bindings/core/v8/ScriptSourceCode.h"
10 #include "core/dom/Document.h"
11 #include "core/dom/Element.h"
12 #include "core/frame/LocalFrame.h"
13 #include "platform/PlatformResourceLoader.h"
14 #include "public/platform/Platform.h"
jbroman 2016/12/13 15:41:05 last minute nit: this include is now unused
adithyas 2016/12/13 16:18:16 Removed.
15
16 namespace blink {
17
18 void transformDocumentToXMLTreeView(Document* document) {
19 String scriptString = loadResourceAsASCIIString("DocumentXMLTreeViewer.js");
20 String cssString = loadResourceAsASCIIString("DocumentXMLTreeViewer.css");
21
22 HeapVector<ScriptSourceCode> sources;
23 sources.append(ScriptSourceCode(scriptString));
24 v8::HandleScope handleScope(v8::Isolate::GetCurrent());
jbroman 2016/12/13 15:41:05 super-nit: V8PerIsolateData::mainThreadIsolate() i
adithyas 2016/12/13 16:18:16 Changed to use V8PerIsolateData::mainThreadIsolate
25
26 document->frame()->script().executeScriptInIsolatedWorld(
27 WorldIdConstants::DocumentXMLTreeViewerWorldId, sources, 0, nullptr);
28 document->getElementById("xml-viewer-style")->setTextContent(cssString);
esprehn 2016/12/12 22:21:57 I'm pretty sure you can actually get into a situat
adithyas 2016/12/13 16:18:17 Fixed
29 }
30
31 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698