@nativescript/canvas 2.0.0-beta.9 → 2.0.0-webgpu.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Canvas/common.d.ts +24 -17
- package/Canvas/common.js +133 -66
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.android.d.ts +5 -7
- package/Canvas/index.android.js +62 -133
- package/Canvas/index.android.js.map +1 -1
- package/Canvas/index.d.ts +4 -1
- package/Canvas/index.ios.d.ts +4 -5
- package/Canvas/index.ios.js +73 -82
- package/Canvas/index.ios.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.d.ts +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.js +8 -11
- package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
- package/Canvas2D/DOMMatrix/index.d.ts +14 -0
- package/Canvas2D/DOMMatrix/index.js +62 -0
- package/Canvas2D/DOMMatrix/index.js.map +1 -1
- package/Canvas2D/ImageData/index.js +4 -6
- package/Canvas2D/ImageData/index.js.map +1 -1
- package/ImageAsset/index.d.ts +1 -0
- package/ImageAsset/index.js +49 -0
- package/ImageAsset/index.js.map +1 -1
- package/WebGL/WebGLRenderingContext/index.d.ts +1 -0
- package/WebGL/WebGLRenderingContext/index.js +86 -32
- package/WebGL/WebGLRenderingContext/index.js.map +1 -1
- package/WebGL2/WebGL2RenderingContext/index.d.ts +1 -0
- package/WebGL2/WebGL2RenderingContext/index.js +2 -3
- package/WebGL2/WebGL2RenderingContext/index.js.map +1 -1
- package/WebGPU/Constants.d.ts +36 -0
- package/WebGPU/Constants.js +42 -0
- package/WebGPU/Constants.js.map +1 -0
- package/WebGPU/Errors.d.ts +18 -0
- package/WebGPU/Errors.js +21 -0
- package/WebGPU/Errors.js.map +1 -0
- package/WebGPU/GPU.d.ts +13 -0
- package/WebGPU/GPU.js +35 -0
- package/WebGPU/GPU.js.map +1 -0
- package/WebGPU/GPUAdapter.d.ts +23 -0
- package/WebGPU/GPUAdapter.js +62 -0
- package/WebGPU/GPUAdapter.js.map +1 -0
- package/WebGPU/GPUAdapterInfo.d.ts +9 -0
- package/WebGPU/GPUAdapterInfo.js +24 -0
- package/WebGPU/GPUAdapterInfo.js.map +1 -0
- package/WebGPU/GPUBindGroup.d.ts +5 -0
- package/WebGPU/GPUBindGroup.js +12 -0
- package/WebGPU/GPUBindGroup.js.map +1 -0
- package/WebGPU/GPUBindGroupLayout.d.ts +5 -0
- package/WebGPU/GPUBindGroupLayout.js +12 -0
- package/WebGPU/GPUBindGroupLayout.js.map +1 -0
- package/WebGPU/GPUBuffer.d.ts +15 -0
- package/WebGPU/GPUBuffer.js +54 -0
- package/WebGPU/GPUBuffer.js.map +1 -0
- package/WebGPU/GPUCanvasContext.d.ts +35 -0
- package/WebGPU/GPUCanvasContext.js +76 -0
- package/WebGPU/GPUCanvasContext.js.map +1 -0
- package/WebGPU/GPUCommandBuffer.d.ts +5 -0
- package/WebGPU/GPUCommandBuffer.js +12 -0
- package/WebGPU/GPUCommandBuffer.js.map +1 -0
- package/WebGPU/GPUCommandEncoder.d.ts +41 -0
- package/WebGPU/GPUCommandEncoder.js +110 -0
- package/WebGPU/GPUCommandEncoder.js.map +1 -0
- package/WebGPU/GPUComputePassEncoder.d.ts +16 -0
- package/WebGPU/GPUComputePassEncoder.js +50 -0
- package/WebGPU/GPUComputePassEncoder.js.map +1 -0
- package/WebGPU/GPUComputePipeline.d.ts +7 -0
- package/WebGPU/GPUComputePipeline.js +16 -0
- package/WebGPU/GPUComputePipeline.js.map +1 -0
- package/WebGPU/GPUDevice.d.ts +173 -0
- package/WebGPU/GPUDevice.js +356 -0
- package/WebGPU/GPUDevice.js.map +1 -0
- package/WebGPU/GPUDeviceLostInfo.d.ts +1 -0
- package/WebGPU/GPUDeviceLostInfo.js +10 -0
- package/WebGPU/GPUDeviceLostInfo.js.map +1 -0
- package/WebGPU/GPUExternalTexture.d.ts +5 -0
- package/WebGPU/GPUExternalTexture.js +12 -0
- package/WebGPU/GPUExternalTexture.js.map +1 -0
- package/WebGPU/GPUPipelineLayout.d.ts +5 -0
- package/WebGPU/GPUPipelineLayout.js +12 -0
- package/WebGPU/GPUPipelineLayout.js.map +1 -0
- package/WebGPU/GPUQuerySet.d.ts +5 -0
- package/WebGPU/GPUQuerySet.js +12 -0
- package/WebGPU/GPUQuerySet.js.map +1 -0
- package/WebGPU/GPUQueue.d.ts +14 -0
- package/WebGPU/GPUQueue.js +77 -0
- package/WebGPU/GPUQueue.js.map +1 -0
- package/WebGPU/GPURenderBundle.d.ts +5 -0
- package/WebGPU/GPURenderBundle.js +12 -0
- package/WebGPU/GPURenderBundle.js.map +1 -0
- package/WebGPU/GPURenderBundleEncoder.d.ts +20 -0
- package/WebGPU/GPURenderBundleEncoder.js +61 -0
- package/WebGPU/GPURenderBundleEncoder.js.map +1 -0
- package/WebGPU/GPURenderPassEncoder.d.ts +29 -0
- package/WebGPU/GPURenderPassEncoder.js +94 -0
- package/WebGPU/GPURenderPassEncoder.js.map +1 -0
- package/WebGPU/GPURenderPipeline.d.ts +7 -0
- package/WebGPU/GPURenderPipeline.js +16 -0
- package/WebGPU/GPURenderPipeline.js.map +1 -0
- package/WebGPU/GPUSampler.d.ts +5 -0
- package/WebGPU/GPUSampler.js +12 -0
- package/WebGPU/GPUSampler.js.map +1 -0
- package/WebGPU/GPUShaderModule.d.ts +6 -0
- package/WebGPU/GPUShaderModule.js +15 -0
- package/WebGPU/GPUShaderModule.js.map +1 -0
- package/WebGPU/GPUTexture.d.ts +17 -0
- package/WebGPU/GPUTexture.js +44 -0
- package/WebGPU/GPUTexture.js.map +1 -0
- package/WebGPU/GPUTextureView.d.ts +5 -0
- package/WebGPU/GPUTextureView.js +12 -0
- package/WebGPU/GPUTextureView.js.map +1 -0
- package/WebGPU/Interfaces.d.ts +155 -0
- package/WebGPU/Interfaces.js +2 -0
- package/WebGPU/Interfaces.js.map +1 -0
- package/WebGPU/Types.d.ts +39 -0
- package/WebGPU/Types.js +2 -0
- package/WebGPU/Types.js.map +1 -0
- package/WebGPU/Utils.d.ts +1 -0
- package/WebGPU/Utils.js +75 -0
- package/WebGPU/Utils.js.map +1 -0
- package/WebGPU/index.d.ts +28 -0
- package/WebGPU/index.js +29 -0
- package/WebGPU/index.js.map +1 -0
- package/common.d.ts +0 -3
- package/common.js +1 -5
- package/common.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +22 -1
- package/index.js.map +1 -1
- package/package.json +1 -4
- package/platforms/android/canvas-release.aar +0 -0
- package/platforms/ios/CanvasNative.xcframework/Info.plist +5 -5
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +23 -23
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_ios.h +41 -8
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +2318 -103
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Info.plist +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.abi.json +1563 -3729
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +27 -34
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +27 -34
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +602 -663
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative-Swift.h +46 -46
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_ios.h +41 -8
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +2318 -103
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Info.plist +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +1563 -3729
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +27 -34
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +27 -34
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +1563 -3729
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +27 -34
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +27 -34
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +31 -31
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +604 -662
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +638 -641
- package/platforms/ios/build.xcconfig +3 -1
- package/platforms/ios/src/cpp/Caches.h +69 -1
- package/platforms/ios/src/cpp/CanvasJSIModule.cpp +320 -395
- package/platforms/ios/src/cpp/CanvasJSIModule.h +7 -1
- package/platforms/ios/src/cpp/Helpers.h +43 -8
- package/platforms/ios/src/cpp/ImageAssetImpl.cpp +35 -37
- package/platforms/ios/src/cpp/ImageAssetImpl.h +14 -10
- package/platforms/ios/src/cpp/ImageBitmapImpl.cpp +2 -2
- package/platforms/ios/src/cpp/ImageBitmapImpl.h +1 -1
- package/platforms/ios/src/cpp/canvas2d/CanvasPattern.cpp +0 -10
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +41 -4
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.cpp +409 -3
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.h +27 -0
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +131 -149
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp +1766 -1659
- package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.cpp +302 -0
- package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.h +63 -0
- package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.cpp +174 -0
- package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.h +58 -0
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.cpp +53 -0
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.h +45 -0
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.cpp +53 -0
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.h +45 -0
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.cpp +229 -0
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.h +59 -0
- package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.cpp +317 -0
- package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.h +55 -0
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.cpp +54 -0
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.h +45 -0
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.cpp +1222 -0
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.h +69 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.cpp +260 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.h +62 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.cpp +84 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.h +49 -0
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.cpp +2750 -0
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.h +95 -0
- package/platforms/ios/src/cpp/webgpu/GPUImpl.cpp +186 -0
- package/platforms/ios/src/cpp/webgpu/GPUImpl.h +55 -0
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.cpp +54 -0
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.h +46 -0
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.cpp +137 -0
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.h +55 -0
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.cpp +521 -0
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.h +56 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.cpp +469 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.h +71 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.cpp +53 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.h +45 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.cpp +623 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.h +85 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.cpp +84 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.h +49 -0
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.cpp +53 -0
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.h +45 -0
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.cpp +56 -0
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.h +45 -0
- package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.cpp +1304 -0
- package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.h +288 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.cpp +360 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.h +75 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.cpp +53 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.h +45 -0
- package/platforms/ios/src/cpp/webgpu/GPUUtils.h +245 -0
- package/SVG/Circle.d.ts +0 -11
- package/SVG/Circle.js +0 -21
- package/SVG/Circle.js.map +0 -1
- package/SVG/ClipPath.d.ts +0 -4
- package/SVG/ClipPath.js +0 -9
- package/SVG/ClipPath.js.map +0 -1
- package/SVG/Defs.d.ts +0 -4
- package/SVG/Defs.js +0 -9
- package/SVG/Defs.js.map +0 -1
- package/SVG/Ellipse.d.ts +0 -13
- package/SVG/Ellipse.js +0 -26
- package/SVG/Ellipse.js.map +0 -1
- package/SVG/G.d.ts +0 -7
- package/SVG/G.js +0 -9
- package/SVG/G.js.map +0 -1
- package/SVG/Image.d.ts +0 -11
- package/SVG/Image.js +0 -40
- package/SVG/Image.js.map +0 -1
- package/SVG/Line.d.ts +0 -13
- package/SVG/Line.js +0 -26
- package/SVG/Line.js.map +0 -1
- package/SVG/LinearGradient.d.ts +0 -10
- package/SVG/LinearGradient.js +0 -13
- package/SVG/LinearGradient.js.map +0 -1
- package/SVG/Path.d.ts +0 -7
- package/SVG/Path.js +0 -14
- package/SVG/Path.js.map +0 -1
- package/SVG/Pattern.d.ts +0 -4
- package/SVG/Pattern.js +0 -9
- package/SVG/Pattern.js.map +0 -1
- package/SVG/Polygon.d.ts +0 -7
- package/SVG/Polygon.js +0 -14
- package/SVG/Polygon.js.map +0 -1
- package/SVG/Polyline.d.ts +0 -7
- package/SVG/Polyline.js +0 -14
- package/SVG/Polyline.js.map +0 -1
- package/SVG/Rect.d.ts +0 -8
- package/SVG/Rect.js +0 -13
- package/SVG/Rect.js.map +0 -1
- package/SVG/SVG.d.ts +0 -32
- package/SVG/SVG.js +0 -204
- package/SVG/SVG.js.map +0 -1
- package/SVG/SVGItem.d.ts +0 -5
- package/SVG/SVGItem.js +0 -8
- package/SVG/SVGItem.js.map +0 -1
- package/SVG/Stop.d.ts +0 -5
- package/SVG/Stop.js +0 -9
- package/SVG/Stop.js.map +0 -1
- package/SVG/Symbol.d.ts +0 -4
- package/SVG/Symbol.js +0 -9
- package/SVG/Symbol.js.map +0 -1
- package/SVG/Text.d.ts +0 -14
- package/SVG/Text.js +0 -26
- package/SVG/Text.js.map +0 -1
- package/SVG/Use.d.ts +0 -4
- package/SVG/Use.js +0 -9
- package/SVG/Use.js.map +0 -1
- package/SVG/index.d.ts +0 -18
- package/SVG/index.js +0 -19
- package/SVG/index.js.map +0 -1
- package/platforms/ios/src/cpp/PerIsolateData.cpp +0 -49
- package/platforms/ios/src/cpp/PerIsolateData.h +0 -54
- package/platforms/ios/src/cpp/URLImpl.cpp +0 -464
- package/platforms/ios/src/cpp/URLImpl.h +0 -121
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// PerIsolateData.h
|
|
3
|
-
//
|
|
4
|
-
// Created by Osei Fortune on 10/01/2024.
|
|
5
|
-
// Copyright © 2024 NativeScript. All rights reserved.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#ifndef PerIsolateData_h
|
|
9
|
-
#define PerIsolateData_h
|
|
10
|
-
|
|
11
|
-
#include "Common.h"
|
|
12
|
-
|
|
13
|
-
class PerIsolateData {
|
|
14
|
-
public:
|
|
15
|
-
PerIsolateData(v8::Isolate *isolate);
|
|
16
|
-
|
|
17
|
-
~PerIsolateData() {
|
|
18
|
-
INSTANCE_TYPE_PERSISTENT->Reset();
|
|
19
|
-
VERSION_PERSISTENT->Reset();
|
|
20
|
-
ALPHA_PERSISTENT->Reset();
|
|
21
|
-
ANTIALIAS_PERSISTENT->Reset();
|
|
22
|
-
FAIL_IF_MAJOR_PERFORMANCE_CAVEAT_PERSISTENT->Reset();
|
|
23
|
-
POWER_PREFERENCE_PERSISTENT->Reset();
|
|
24
|
-
PREMULTIPLIED_ALPHA_PERSISTENT->Reset();
|
|
25
|
-
PRESERVE_DRAWING_BUFFER_PERSISTENT->Reset();
|
|
26
|
-
STENCIL_PERSISTENT->Reset();
|
|
27
|
-
DESYNCHRONIZED_PERSISTENT->Reset();
|
|
28
|
-
XR_COMPATIBLE_PERSISTENT->Reset();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
v8::Persistent<v8::String> *INSTANCE_TYPE_PERSISTENT;
|
|
32
|
-
|
|
33
|
-
v8::Persistent<v8::String> *VERSION_PERSISTENT;
|
|
34
|
-
|
|
35
|
-
v8::Persistent<v8::String> *ALPHA_PERSISTENT;
|
|
36
|
-
|
|
37
|
-
v8::Persistent<v8::String> *ANTIALIAS_PERSISTENT;
|
|
38
|
-
|
|
39
|
-
v8::Persistent<v8::String> *FAIL_IF_MAJOR_PERFORMANCE_CAVEAT_PERSISTENT;
|
|
40
|
-
|
|
41
|
-
v8::Persistent<v8::String> *POWER_PREFERENCE_PERSISTENT;
|
|
42
|
-
|
|
43
|
-
v8::Persistent<v8::String> *PREMULTIPLIED_ALPHA_PERSISTENT;
|
|
44
|
-
|
|
45
|
-
v8::Persistent<v8::String> *PRESERVE_DRAWING_BUFFER_PERSISTENT;
|
|
46
|
-
|
|
47
|
-
v8::Persistent<v8::String> *STENCIL_PERSISTENT;
|
|
48
|
-
|
|
49
|
-
v8::Persistent<v8::String> *DESYNCHRONIZED_PERSISTENT;
|
|
50
|
-
|
|
51
|
-
v8::Persistent<v8::String> *XR_COMPATIBLE_PERSISTENT;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
#endif /* PerIsolateData_h */
|
|
@@ -1,464 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Created by Osei Fortune on 15/011/2023.
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
#include "URLImpl.h"
|
|
6
|
-
#include "Caches.h"
|
|
7
|
-
#include "Helpers.h"
|
|
8
|
-
#include "OneByteStringResource.h"
|
|
9
|
-
|
|
10
|
-
URLImpl::URLImpl(URL *url) : url_(url) {}
|
|
11
|
-
|
|
12
|
-
void URLImpl::Init(const v8::Local<v8::Object> &canvasModule, v8::Isolate *isolate) {
|
|
13
|
-
v8::Locker locker(isolate);
|
|
14
|
-
v8::Isolate::Scope isolate_scope(isolate);
|
|
15
|
-
v8::HandleScope handle_scope(isolate);
|
|
16
|
-
|
|
17
|
-
auto ctor = GetCtor(isolate);
|
|
18
|
-
auto context = isolate->GetCurrentContext();
|
|
19
|
-
auto func = ctor->GetFunction(context).ToLocalChecked();
|
|
20
|
-
|
|
21
|
-
canvasModule->Set(context, ConvertToV8String(isolate, "URL"), func);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
URLImpl *URLImpl::GetPointer(v8::Local<v8::Object> object) {
|
|
25
|
-
auto ptr = object->GetAlignedPointerFromInternalField(0);
|
|
26
|
-
if (ptr == nullptr) {
|
|
27
|
-
return nullptr;
|
|
28
|
-
}
|
|
29
|
-
return static_cast<URLImpl *>(ptr);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
URL *URLImpl::GetURL() {
|
|
33
|
-
return this->url_;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
v8::Local<v8::FunctionTemplate> URLImpl::GetCtor(v8::Isolate *isolate) {
|
|
37
|
-
auto cache = Caches::Get(isolate);
|
|
38
|
-
auto ctor = cache->URLTmpl.get();
|
|
39
|
-
if (ctor != nullptr) {
|
|
40
|
-
return ctor->Get(isolate);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
v8::Local<v8::FunctionTemplate> ctorTmpl = v8::FunctionTemplate::New(isolate, Ctor);
|
|
44
|
-
ctorTmpl->InstanceTemplate()->SetInternalFieldCount(2);
|
|
45
|
-
ctorTmpl->SetClassName(ConvertToV8String(isolate, "URL"));
|
|
46
|
-
|
|
47
|
-
auto tmpl = ctorTmpl->InstanceTemplate();
|
|
48
|
-
tmpl->SetInternalFieldCount(2);
|
|
49
|
-
tmpl->SetAccessor(
|
|
50
|
-
ConvertToV8String(isolate, "hash"),
|
|
51
|
-
GetHash, SetHash);
|
|
52
|
-
tmpl->SetAccessor(
|
|
53
|
-
ConvertToV8String(isolate, "host"),
|
|
54
|
-
GetHost, SetHost);
|
|
55
|
-
tmpl->SetAccessor(
|
|
56
|
-
ConvertToV8String(isolate, "hostname"),
|
|
57
|
-
GetHostName, SetHostName);
|
|
58
|
-
tmpl->SetAccessor(
|
|
59
|
-
ConvertToV8String(isolate, "href"),
|
|
60
|
-
GetHref, SetHref);
|
|
61
|
-
|
|
62
|
-
tmpl->SetAccessor(
|
|
63
|
-
ConvertToV8String(isolate, "origin"),
|
|
64
|
-
GetOrigin);
|
|
65
|
-
|
|
66
|
-
tmpl->SetAccessor(
|
|
67
|
-
ConvertToV8String(isolate, "password"),
|
|
68
|
-
GetPassword, SetPassword);
|
|
69
|
-
|
|
70
|
-
tmpl->SetAccessor(
|
|
71
|
-
ConvertToV8String(isolate, "pathname"),
|
|
72
|
-
GetPathName, SetPathName);
|
|
73
|
-
|
|
74
|
-
tmpl->SetAccessor(
|
|
75
|
-
ConvertToV8String(isolate, "port"),
|
|
76
|
-
GetPort, SetPort);
|
|
77
|
-
|
|
78
|
-
tmpl->SetAccessor(
|
|
79
|
-
ConvertToV8String(isolate, "protocol"),
|
|
80
|
-
GetProtocol, SetProtocol);
|
|
81
|
-
|
|
82
|
-
tmpl->SetAccessor(
|
|
83
|
-
ConvertToV8String(isolate, "search"),
|
|
84
|
-
GetSearch, SetSearch);
|
|
85
|
-
|
|
86
|
-
tmpl->SetAccessor(
|
|
87
|
-
ConvertToV8String(isolate, "username"),
|
|
88
|
-
GetUserName, SetUserName);
|
|
89
|
-
|
|
90
|
-
tmpl->Set(ConvertToV8String(isolate, "toString"),
|
|
91
|
-
v8::FunctionTemplate::New(isolate, &ToString));
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
ctorTmpl->Set(ConvertToV8String(isolate, "canParse"),
|
|
95
|
-
v8::FunctionTemplate::New(isolate, &CanParse));
|
|
96
|
-
|
|
97
|
-
cache->URLTmpl =
|
|
98
|
-
std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
|
|
99
|
-
return ctorTmpl;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
void URLImpl::Ctor(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
103
|
-
auto count = args.Length();
|
|
104
|
-
auto value = args[0];
|
|
105
|
-
auto isolate = args.GetIsolate();
|
|
106
|
-
if (count >= 1 && !value->IsString()) {
|
|
107
|
-
isolate->ThrowException(v8::Exception::TypeError(ConvertToV8String(isolate, "")));
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
URL *url;
|
|
113
|
-
|
|
114
|
-
if (count > 1) {
|
|
115
|
-
url = canvas_url_create(ConvertFromV8String(isolate, args[0]).c_str(),
|
|
116
|
-
ConvertFromV8String(isolate, args[1]).c_str());
|
|
117
|
-
} else {
|
|
118
|
-
url = canvas_url_create(ConvertFromV8String(isolate, args[0]).c_str(), nullptr);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
auto ret = args.This();
|
|
122
|
-
|
|
123
|
-
auto urlImpl = new URLImpl(url);
|
|
124
|
-
|
|
125
|
-
ret->SetAlignedPointerInInternalField(0, urlImpl);
|
|
126
|
-
|
|
127
|
-
urlImpl->BindFinalizer(isolate, ret);
|
|
128
|
-
|
|
129
|
-
args.GetReturnValue().Set(ret);
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
void URLImpl::GetHash(v8::Local<v8::String> property,
|
|
135
|
-
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
136
|
-
URLImpl *ptr = GetPointer(info.This());
|
|
137
|
-
if (ptr == nullptr) {
|
|
138
|
-
info.GetReturnValue().SetEmptyString();
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
auto isolate = info.GetIsolate();
|
|
142
|
-
|
|
143
|
-
auto value = canvas_url_hash(ptr->GetURL());
|
|
144
|
-
info.GetReturnValue().Set(ConvertToV8String(isolate, value));
|
|
145
|
-
canvas_native_string_destroy((char *) value);
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
void URLImpl::SetHash(v8::Local<v8::String> property,
|
|
150
|
-
v8::Local<v8::Value> value,
|
|
151
|
-
const v8::PropertyCallbackInfo<void> &info) {
|
|
152
|
-
URLImpl *ptr = GetPointer(info.This());
|
|
153
|
-
if (ptr == nullptr) {
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
auto isolate = info.GetIsolate();
|
|
157
|
-
auto context = isolate->GetCurrentContext();
|
|
158
|
-
auto val = ConvertFromV8String(isolate, value->ToString(context).ToLocalChecked());
|
|
159
|
-
canvas_url_set_hash(ptr->GetURL(), val.c_str());
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
void URLImpl::GetHost(v8::Local<v8::String> property,
|
|
164
|
-
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
165
|
-
URLImpl *ptr = GetPointer(info.This());
|
|
166
|
-
if (ptr == nullptr) {
|
|
167
|
-
info.GetReturnValue().SetEmptyString();
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
auto isolate = info.GetIsolate();
|
|
171
|
-
|
|
172
|
-
auto value = canvas_url_host(ptr->GetURL());
|
|
173
|
-
info.GetReturnValue().Set(ConvertToV8String(isolate, value));
|
|
174
|
-
canvas_native_string_destroy((char *) value);
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
void URLImpl::SetHost(v8::Local<v8::String> property,
|
|
179
|
-
v8::Local<v8::Value> value,
|
|
180
|
-
const v8::PropertyCallbackInfo<void> &info) {
|
|
181
|
-
URLImpl *ptr = GetPointer(info.This());
|
|
182
|
-
if (ptr == nullptr) {
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
auto isolate = info.GetIsolate();
|
|
186
|
-
auto context = isolate->GetCurrentContext();
|
|
187
|
-
auto val = ConvertFromV8String(isolate, value->ToString(context).ToLocalChecked());
|
|
188
|
-
canvas_url_set_host(ptr->GetURL(), val.c_str());
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
void URLImpl::GetHostName(v8::Local<v8::String> property,
|
|
193
|
-
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
194
|
-
URLImpl *ptr = GetPointer(info.This());
|
|
195
|
-
if (ptr == nullptr) {
|
|
196
|
-
info.GetReturnValue().SetEmptyString();
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
auto isolate = info.GetIsolate();
|
|
200
|
-
|
|
201
|
-
auto value = canvas_url_host_name(ptr->GetURL());
|
|
202
|
-
info.GetReturnValue().Set(ConvertToV8String(isolate, value));
|
|
203
|
-
canvas_native_string_destroy((char *) value);
|
|
204
|
-
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
void URLImpl::SetHostName(v8::Local<v8::String> property,
|
|
208
|
-
v8::Local<v8::Value> value,
|
|
209
|
-
const v8::PropertyCallbackInfo<void> &info) {
|
|
210
|
-
URLImpl *ptr = GetPointer(info.This());
|
|
211
|
-
if (ptr == nullptr) {
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
auto isolate = info.GetIsolate();
|
|
215
|
-
auto context = isolate->GetCurrentContext();
|
|
216
|
-
auto val = ConvertFromV8String(isolate, value->ToString(context).ToLocalChecked());
|
|
217
|
-
canvas_url_set_host_name(ptr->GetURL(), val.c_str());
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
void URLImpl::GetHref(v8::Local<v8::String> property,
|
|
222
|
-
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
223
|
-
URLImpl *ptr = GetPointer(info.This());
|
|
224
|
-
if (ptr == nullptr) {
|
|
225
|
-
info.GetReturnValue().SetEmptyString();
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
auto isolate = info.GetIsolate();
|
|
229
|
-
|
|
230
|
-
auto value = canvas_url_href(ptr->GetURL());
|
|
231
|
-
info.GetReturnValue().Set(ConvertToV8String(isolate, value));
|
|
232
|
-
canvas_native_string_destroy((char *) value);
|
|
233
|
-
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
void URLImpl::SetHref(v8::Local<v8::String> property,
|
|
237
|
-
v8::Local<v8::Value> value,
|
|
238
|
-
const v8::PropertyCallbackInfo<void> &info) {
|
|
239
|
-
URLImpl *ptr = GetPointer(info.This());
|
|
240
|
-
if (ptr == nullptr) {
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
auto isolate = info.GetIsolate();
|
|
244
|
-
auto context = isolate->GetCurrentContext();
|
|
245
|
-
auto val = ConvertFromV8String(isolate, value->ToString(context).ToLocalChecked());
|
|
246
|
-
canvas_url_set_href(ptr->GetURL(), val.c_str());
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
void URLImpl::GetOrigin(v8::Local<v8::String> property,
|
|
250
|
-
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
251
|
-
URLImpl *ptr = GetPointer(info.This());
|
|
252
|
-
if (ptr == nullptr) {
|
|
253
|
-
info.GetReturnValue().SetEmptyString();
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
256
|
-
auto isolate = info.GetIsolate();
|
|
257
|
-
|
|
258
|
-
auto value = canvas_url_origin(ptr->GetURL());
|
|
259
|
-
info.GetReturnValue().Set(ConvertToV8String(isolate, value));
|
|
260
|
-
canvas_native_string_destroy((char *) value);
|
|
261
|
-
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
void URLImpl::GetPassword(v8::Local<v8::String> property,
|
|
265
|
-
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
266
|
-
URLImpl *ptr = GetPointer(info.This());
|
|
267
|
-
if (ptr == nullptr) {
|
|
268
|
-
info.GetReturnValue().SetEmptyString();
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
auto isolate = info.GetIsolate();
|
|
272
|
-
|
|
273
|
-
auto value = canvas_url_password(ptr->GetURL());
|
|
274
|
-
info.GetReturnValue().Set(ConvertToV8String(isolate, value));
|
|
275
|
-
canvas_native_string_destroy((char *) value);
|
|
276
|
-
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
void URLImpl::SetPassword(v8::Local<v8::String> property,
|
|
280
|
-
v8::Local<v8::Value> value,
|
|
281
|
-
const v8::PropertyCallbackInfo<void> &info) {
|
|
282
|
-
URLImpl *ptr = GetPointer(info.This());
|
|
283
|
-
if (ptr == nullptr) {
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
auto isolate = info.GetIsolate();
|
|
287
|
-
auto context = isolate->GetCurrentContext();
|
|
288
|
-
auto val = ConvertFromV8String(isolate, value->ToString(context).ToLocalChecked());
|
|
289
|
-
canvas_url_set_password(ptr->GetURL(), val.c_str());
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
void URLImpl::GetPathName(v8::Local<v8::String> property,
|
|
293
|
-
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
294
|
-
URLImpl *ptr = GetPointer(info.This());
|
|
295
|
-
if (ptr == nullptr) {
|
|
296
|
-
info.GetReturnValue().SetEmptyString();
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
auto isolate = info.GetIsolate();
|
|
300
|
-
|
|
301
|
-
auto value = canvas_url_pathname(ptr->GetURL());
|
|
302
|
-
info.GetReturnValue().Set(ConvertToV8String(isolate, value));
|
|
303
|
-
canvas_native_string_destroy((char *) value);
|
|
304
|
-
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
void URLImpl::SetPathName(v8::Local<v8::String> property,
|
|
308
|
-
v8::Local<v8::Value> value,
|
|
309
|
-
const v8::PropertyCallbackInfo<void> &info) {
|
|
310
|
-
URLImpl *ptr = GetPointer(info.This());
|
|
311
|
-
if (ptr == nullptr) {
|
|
312
|
-
return;
|
|
313
|
-
}
|
|
314
|
-
auto isolate = info.GetIsolate();
|
|
315
|
-
auto context = isolate->GetCurrentContext();
|
|
316
|
-
auto val = ConvertFromV8String(isolate, value->ToString(context).ToLocalChecked());
|
|
317
|
-
canvas_url_set_pathname(ptr->GetURL(), val.c_str());
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
void URLImpl::GetPort(v8::Local<v8::String> property,
|
|
321
|
-
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
322
|
-
URLImpl *ptr = GetPointer(info.This());
|
|
323
|
-
if (ptr == nullptr) {
|
|
324
|
-
info.GetReturnValue().SetEmptyString();
|
|
325
|
-
return;
|
|
326
|
-
}
|
|
327
|
-
auto isolate = info.GetIsolate();
|
|
328
|
-
|
|
329
|
-
auto value = canvas_url_port(ptr->GetURL());
|
|
330
|
-
info.GetReturnValue().Set(ConvertToV8String(isolate, value));
|
|
331
|
-
canvas_native_string_destroy((char *) value);
|
|
332
|
-
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
void URLImpl::SetPort(v8::Local<v8::String> property,
|
|
336
|
-
v8::Local<v8::Value> value,
|
|
337
|
-
const v8::PropertyCallbackInfo<void> &info) {
|
|
338
|
-
URLImpl *ptr = GetPointer(info.This());
|
|
339
|
-
if (ptr == nullptr) {
|
|
340
|
-
return;
|
|
341
|
-
}
|
|
342
|
-
auto isolate = info.GetIsolate();
|
|
343
|
-
auto context = isolate->GetCurrentContext();
|
|
344
|
-
auto val = ConvertFromV8String(isolate, value->ToString(context).ToLocalChecked());
|
|
345
|
-
canvas_url_set_port(ptr->GetURL(), val.c_str());
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
void URLImpl::GetProtocol(v8::Local<v8::String> property,
|
|
349
|
-
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
350
|
-
URLImpl *ptr = GetPointer(info.This());
|
|
351
|
-
if (ptr == nullptr) {
|
|
352
|
-
info.GetReturnValue().SetEmptyString();
|
|
353
|
-
return;
|
|
354
|
-
}
|
|
355
|
-
auto isolate = info.GetIsolate();
|
|
356
|
-
|
|
357
|
-
auto value = canvas_url_protocol(ptr->GetURL());
|
|
358
|
-
info.GetReturnValue().Set(ConvertToV8String(isolate, value));
|
|
359
|
-
canvas_native_string_destroy((char *) value);
|
|
360
|
-
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
void URLImpl::SetProtocol(v8::Local<v8::String> property,
|
|
364
|
-
v8::Local<v8::Value> value,
|
|
365
|
-
const v8::PropertyCallbackInfo<void> &info) {
|
|
366
|
-
URLImpl *ptr = GetPointer(info.This());
|
|
367
|
-
if (ptr == nullptr) {
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
auto isolate = info.GetIsolate();
|
|
371
|
-
auto context = isolate->GetCurrentContext();
|
|
372
|
-
auto val = ConvertFromV8String(isolate, value->ToString(context).ToLocalChecked());
|
|
373
|
-
canvas_url_set_protocol(ptr->GetURL(), val.c_str());
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
void URLImpl::GetSearch(v8::Local<v8::String> property,
|
|
378
|
-
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
379
|
-
URLImpl *ptr = GetPointer(info.This());
|
|
380
|
-
if (ptr == nullptr) {
|
|
381
|
-
info.GetReturnValue().SetEmptyString();
|
|
382
|
-
return;
|
|
383
|
-
}
|
|
384
|
-
auto isolate = info.GetIsolate();
|
|
385
|
-
|
|
386
|
-
auto value = canvas_url_search(ptr->GetURL());
|
|
387
|
-
info.GetReturnValue().Set(ConvertToV8String(isolate, value));
|
|
388
|
-
canvas_native_string_destroy((char *) value);
|
|
389
|
-
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
void URLImpl::SetSearch(v8::Local<v8::String> property,
|
|
393
|
-
v8::Local<v8::Value> value,
|
|
394
|
-
const v8::PropertyCallbackInfo<void> &info) {
|
|
395
|
-
URLImpl *ptr = GetPointer(info.This());
|
|
396
|
-
if (ptr == nullptr) {
|
|
397
|
-
return;
|
|
398
|
-
}
|
|
399
|
-
auto isolate = info.GetIsolate();
|
|
400
|
-
auto context = isolate->GetCurrentContext();
|
|
401
|
-
auto val = ConvertFromV8String(isolate, value->ToString(context).ToLocalChecked());
|
|
402
|
-
canvas_url_set_search(ptr->GetURL(), val.c_str());
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
void URLImpl::GetUserName(v8::Local<v8::String> property,
|
|
407
|
-
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
408
|
-
URLImpl *ptr = GetPointer(info.This());
|
|
409
|
-
if (ptr == nullptr) {
|
|
410
|
-
info.GetReturnValue().SetEmptyString();
|
|
411
|
-
return;
|
|
412
|
-
}
|
|
413
|
-
auto isolate = info.GetIsolate();
|
|
414
|
-
|
|
415
|
-
auto value = canvas_url_username(ptr->GetURL());
|
|
416
|
-
info.GetReturnValue().Set(ConvertToV8String(isolate, value));
|
|
417
|
-
canvas_native_string_destroy((char *) value);
|
|
418
|
-
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
void URLImpl::SetUserName(v8::Local<v8::String> property,
|
|
422
|
-
v8::Local<v8::Value> value,
|
|
423
|
-
const v8::PropertyCallbackInfo<void> &info) {
|
|
424
|
-
URLImpl *ptr = GetPointer(info.This());
|
|
425
|
-
if (ptr == nullptr) {
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
auto isolate = info.GetIsolate();
|
|
429
|
-
auto context = isolate->GetCurrentContext();
|
|
430
|
-
auto val = ConvertFromV8String(isolate, value->ToString(context).ToLocalChecked());
|
|
431
|
-
canvas_url_set_username(ptr->GetURL(), val.c_str());
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
void URLImpl::ToString(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
436
|
-
URLImpl *ptr = GetPointer(args.This());
|
|
437
|
-
if (ptr == nullptr) {
|
|
438
|
-
args.GetReturnValue().SetEmptyString();
|
|
439
|
-
return;
|
|
440
|
-
}
|
|
441
|
-
auto isolate = args.GetIsolate();
|
|
442
|
-
|
|
443
|
-
auto value = canvas_url_to_string(ptr->GetURL());
|
|
444
|
-
|
|
445
|
-
auto returnValue = new OneByteStringResource(value);
|
|
446
|
-
auto ret = v8::String::NewExternalOneByte(isolate, returnValue);
|
|
447
|
-
args.GetReturnValue().Set(ret.ToLocalChecked());
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
void URLImpl::CanParse(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
452
|
-
auto isolate = args.GetIsolate();
|
|
453
|
-
bool value;
|
|
454
|
-
auto count = args.Length();
|
|
455
|
-
|
|
456
|
-
if (count > 1) {
|
|
457
|
-
value = canvas_url_can_parse(ConvertFromV8String(isolate, args[0]).c_str(),
|
|
458
|
-
ConvertFromV8String(isolate, args[1]).c_str());
|
|
459
|
-
} else {
|
|
460
|
-
value = canvas_url_can_parse(ConvertFromV8String(isolate, args[0]).c_str(), nullptr);
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
args.GetReturnValue().Set(value);
|
|
464
|
-
}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Created by Osei Fortune on 15/011/2023.
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
#pragma once
|
|
6
|
-
|
|
7
|
-
#include <vector>
|
|
8
|
-
#include "Common.h"
|
|
9
|
-
#include "ObjectWrapperImpl.h"
|
|
10
|
-
|
|
11
|
-
class URLImpl: ObjectWrapperImpl {
|
|
12
|
-
public:
|
|
13
|
-
URLImpl(URL *url);
|
|
14
|
-
|
|
15
|
-
~URLImpl() {
|
|
16
|
-
canvas_url_destroy(this->GetURL());
|
|
17
|
-
this->url_ = nullptr;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
URL *GetURL();
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
static void Init(const v8::Local<v8::Object> &canvasModule, v8::Isolate *isolate);
|
|
24
|
-
|
|
25
|
-
static URLImpl *GetPointer(v8::Local<v8::Object> object);
|
|
26
|
-
|
|
27
|
-
static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate);
|
|
28
|
-
|
|
29
|
-
static void Ctor(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
static void
|
|
33
|
-
GetHash(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
34
|
-
|
|
35
|
-
static void SetHash(v8::Local<v8::String> property,
|
|
36
|
-
v8::Local<v8::Value> value,
|
|
37
|
-
const v8::PropertyCallbackInfo<void> &info);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
static void
|
|
41
|
-
GetHost(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
42
|
-
|
|
43
|
-
static void SetHost(v8::Local<v8::String> property,
|
|
44
|
-
v8::Local<v8::Value> value,
|
|
45
|
-
const v8::PropertyCallbackInfo<void> &info);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
static void
|
|
49
|
-
GetHostName(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
50
|
-
|
|
51
|
-
static void SetHostName(v8::Local<v8::String> property,
|
|
52
|
-
v8::Local<v8::Value> value,
|
|
53
|
-
const v8::PropertyCallbackInfo<void> &info);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
static void
|
|
57
|
-
GetHref(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
58
|
-
|
|
59
|
-
static void SetHref(v8::Local<v8::String> property,
|
|
60
|
-
v8::Local<v8::Value> value,
|
|
61
|
-
const v8::PropertyCallbackInfo<void> &info);
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
static void
|
|
65
|
-
GetOrigin(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
static void
|
|
69
|
-
GetPassword(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
70
|
-
|
|
71
|
-
static void SetPassword(v8::Local<v8::String> property,
|
|
72
|
-
v8::Local<v8::Value> value,
|
|
73
|
-
const v8::PropertyCallbackInfo<void> &info);
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
static void
|
|
77
|
-
GetPathName(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
78
|
-
|
|
79
|
-
static void SetPathName(v8::Local<v8::String> property,
|
|
80
|
-
v8::Local<v8::Value> value,
|
|
81
|
-
const v8::PropertyCallbackInfo<void> &info);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
static void
|
|
85
|
-
GetPort(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
86
|
-
|
|
87
|
-
static void SetPort(v8::Local<v8::String> property,
|
|
88
|
-
v8::Local<v8::Value> value,
|
|
89
|
-
const v8::PropertyCallbackInfo<void> &info);
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
static void
|
|
93
|
-
GetProtocol(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
94
|
-
|
|
95
|
-
static void SetProtocol(v8::Local<v8::String> property,
|
|
96
|
-
v8::Local<v8::Value> value,
|
|
97
|
-
const v8::PropertyCallbackInfo<void> &info);
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
static void
|
|
101
|
-
GetSearch(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
102
|
-
|
|
103
|
-
static void SetSearch(v8::Local<v8::String> property,
|
|
104
|
-
v8::Local<v8::Value> value,
|
|
105
|
-
const v8::PropertyCallbackInfo<void> &info);
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
static void
|
|
109
|
-
GetUserName(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
110
|
-
|
|
111
|
-
static void SetUserName(v8::Local<v8::String> property,
|
|
112
|
-
v8::Local<v8::Value> value,
|
|
113
|
-
const v8::PropertyCallbackInfo<void> &info);
|
|
114
|
-
|
|
115
|
-
static void ToString(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
116
|
-
|
|
117
|
-
static void CanParse(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
118
|
-
|
|
119
|
-
private:
|
|
120
|
-
URL *url_;
|
|
121
|
-
};
|