diff options
author | Andreas Kling <kling@serenityos.org> | 2020-06-23 16:57:39 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-06-23 16:57:39 +0200 |
commit | fc4ed8d444535f6ddf5b2d8f414466e2bdfb46b5 (patch) | |
tree | da312b4d7a231ef27f421213552bba25c5db3710 /Libraries/LibWeb/Bindings/NodeWrapperFactory.cpp | |
parent | c24f5585b29a52c32315dbed49aa66c7fe94caa0 (diff) | |
download | serenity-fc4ed8d444535f6ddf5b2d8f414466e2bdfb46b5.zip |
LibWeb: Make wrapper factory functions take JS::GlobalObject&
Instead of taking the JS::Heap&. This allows us to get rid of some
calls to JS::Interpreter::global_object(). We're getting closer and
closer to multiple global objects. :^)
Diffstat (limited to 'Libraries/LibWeb/Bindings/NodeWrapperFactory.cpp')
-rw-r--r-- | Libraries/LibWeb/Bindings/NodeWrapperFactory.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Libraries/LibWeb/Bindings/NodeWrapperFactory.cpp b/Libraries/LibWeb/Bindings/NodeWrapperFactory.cpp index 30bc0edeb1..9647829240 100644 --- a/Libraries/LibWeb/Bindings/NodeWrapperFactory.cpp +++ b/Libraries/LibWeb/Bindings/NodeWrapperFactory.cpp @@ -24,7 +24,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <LibJS/Interpreter.h> #include <LibWeb/Bindings/DocumentWrapper.h> #include <LibWeb/Bindings/HTMLCanvasElementWrapper.h> #include <LibWeb/Bindings/HTMLImageElementWrapper.h> @@ -38,19 +37,19 @@ namespace Web { namespace Bindings { -NodeWrapper* wrap(JS::Heap& heap, Node& node) +NodeWrapper* wrap(JS::GlobalObject& global_object, Node& node) { if (is<Document>(node)) - return static_cast<NodeWrapper*>(wrap_impl(heap, to<Document>(node))); + return static_cast<NodeWrapper*>(wrap_impl(global_object, to<Document>(node))); if (is<HTMLCanvasElement>(node)) - return static_cast<NodeWrapper*>(wrap_impl(heap, to<HTMLCanvasElement>(node))); + return static_cast<NodeWrapper*>(wrap_impl(global_object, to<HTMLCanvasElement>(node))); if (is<HTMLImageElement>(node)) - return static_cast<NodeWrapper*>(wrap_impl(heap, to<HTMLImageElement>(node))); + return static_cast<NodeWrapper*>(wrap_impl(global_object, to<HTMLImageElement>(node))); if (is<HTMLElement>(node)) - return static_cast<NodeWrapper*>(wrap_impl(heap, to<HTMLElement>(node))); + return static_cast<NodeWrapper*>(wrap_impl(global_object, to<HTMLElement>(node))); if (is<Element>(node)) - return static_cast<NodeWrapper*>(wrap_impl(heap, to<Element>(node))); - return static_cast<NodeWrapper*>(wrap_impl(heap, node)); + return static_cast<NodeWrapper*>(wrap_impl(global_object, to<Element>(node))); + return static_cast<NodeWrapper*>(wrap_impl(global_object, node)); } } |