Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 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 // This file has been auto-generated by code_generator_web_module.py. | |
| 6 // DO NOT MODIFY! | |
| 7 | |
| 8 // This file has been generated from the Jinja2 template in | |
| 9 // third_party/WebKit/Source/bindings/templates/web_module_interface.h.tmpl | |
| 10 | |
| 11 // clang-format off | |
| 12 | |
| 13 #ifndef WEB_API_DOCUMENT_H | |
| 14 #define WEB_API_DOCUMENT_H | |
| 15 | |
| 16 #include "core/dom/Document.h" | |
| 17 #include "web/api/node.h" | |
| 18 #include "wtf/Optional.h" | |
| 19 #include "wtf/Variant.h" | |
| 20 | |
| 21 namespace blink { | |
| 22 class Document; | |
| 23 class HTMLScriptElement; | |
| 24 class SVGScriptElement; | |
| 25 } | |
| 26 | |
| 27 namespace web { | |
| 28 | |
| 29 class HTMLScriptElement : public Node { | |
| 30 public: | |
| 31 virtual ~HTMLScriptElement() = default; | |
| 32 | |
| 33 static HTMLScriptElement* Create(blink::HTMLScriptElement*); | |
| 34 | |
| 35 void DoDummyThing() {} | |
| 36 protected: | |
| 37 blink::HTMLScriptElement* GetBlinkInstance() const; | |
| 38 explicit HTMLScriptElement(blink::HTMLScriptElement*); | |
| 39 }; | |
| 40 | |
| 41 class SVGScriptElement : public Node { | |
|
esprehn
2017/02/15 02:03:02
public Element ? seems you're missing the right su
| |
| 42 public: | |
| 43 virtual ~SVGScriptElement() = default; | |
| 44 | |
| 45 static SVGScriptElement* Create(blink::SVGScriptElement*); | |
| 46 protected: | |
| 47 blink::SVGScriptElement* GetBlinkInstance() const; | |
| 48 explicit SVGScriptElement(blink::SVGScriptElement*); | |
| 49 }; | |
| 50 | |
| 51 class Document : public Node { | |
| 52 public: | |
| 53 virtual ~Document() = default; | |
| 54 | |
| 55 static Document* Create(blink::Document*); | |
| 56 | |
| 57 // [CallWith=EnteredWindow, CEReactions, CustomElementCallbacks, | |
| 58 // RaisesException] | |
| 59 // void write(DOMString... text); | |
| 60 template<typename... Args> | |
| 61 void Write(Args... args) { | |
| 62 String array[] = { args... }; | |
| 63 // is_gc_type governs whether Vector or HeapVector is used here. | |
| 64 Vector<String> vector(sizeof...(args)); | |
| 65 for (auto item : array) | |
| 66 vector.push_back(item); | |
| 67 document()->write(document()->domWindow(), vector, ASSERT_NO_EXCEPTION); | |
| 68 } | |
| 69 | |
| 70 // typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement; | |
| 71 // [ImplementedAs=currentScriptForBinding] | |
| 72 // readonly attribute HTMLOrSVGScriptElement? currentScript; | |
| 73 using CurrentScript = WTF::Variant<blink::Member<HTMLScriptElement>, blink::Me mber<SVGScriptElement>>; | |
| 74 Optional<CurrentScript> GetCurrentScript() const; | |
| 75 | |
| 76 protected: | |
| 77 blink::Document* document() const; | |
| 78 explicit Document(blink::Document*); | |
| 79 }; | |
| 80 | |
| 81 } // namespace web | |
| 82 | |
| 83 #endif // WEB_API_DOCUMENT_H | |
| OLD | NEW |