WebView2 日本語リファレンス
WebView2インターフェース › ICoreWebView2ServiceWorkerRegistration

ICoreWebView2ServiceWorkerRegistration

COM
IID06003f5e-af92-5e7e-b497-3fa167dd37c2継承元IUnknown自前メソッド開始 vtbl3

メソッド 8

vtbl = vtable インデックス(0始まり)。HSP等からインデックス指定でCOMメソッドを呼ぶ際に使用します。0〜2 は IUnknown。

vtbl 3 HRESULT get_ActiveServiceWorker(ICoreWebView2ServiceWorker** value)
valueICoreWebView2ServiceWorker**outこの登録でアクティブな Service Worker を表す ICoreWebView2ServiceWorker オブジェクトを受け取る出力先へのポインタである。
vtbl 4 HRESULT get_Origin(LPWSTR* value)
valueLPWSTR*outこの Service Worker 登録のオリジンを受け取る出力先へのポインタである。
vtbl 5 HRESULT get_ScopeUri(LPWSTR* value)
valueLPWSTR*outこの Service Worker 登録のスコープ URI を受け取る出力先へのポインタである。
vtbl 6 HRESULT get_TopLevelOrigin(LPWSTR* value)
valueLPWSTR*outこの Service Worker 登録の最上位オリジンを受け取る出力先へのポインタである。
vtbl 7 HRESULT add_ServiceWorkerActivated(ICoreWebView2ServiceWorkerActivatedEventHandler* eventHandler, EventRegistrationToken* token)
eventHandlerICoreWebView2ServiceWorkerActivatedEventHandler*inService Worker がアクティブ化された際に呼び出されるイベントハンドラーへのポインタである。
tokenEventRegistrationToken*out登録したイベントハンドラーを後で解除するために用いるトークンを受け取る出力先へのポインタである。
vtbl 8 HRESULT remove_ServiceWorkerActivated(EventRegistrationToken token)
tokenEventRegistrationTokeninadd_ServiceWorkerActivated で取得した、解除対象のイベントハンドラーを示すトークンを指定する。
vtbl 9 HRESULT add_Unregistering(ICoreWebView2ServiceWorkerRegistrationUnregisteringEventHandler* eventHandler, EventRegistrationToken* token)
eventHandlerICoreWebView2ServiceWorkerRegistrationUnregisteringEventHandler*inService Worker の登録解除が開始される際に呼び出されるイベントハンドラーへのポインタである。
tokenEventRegistrationToken*out登録したイベントハンドラーを後で解除するために用いるトークンを受け取る出力先へのポインタである。
vtbl 10 HRESULT remove_Unregistering(EventRegistrationToken token)
tokenEventRegistrationTokeninadd_Unregistering で取得した、解除対象のイベントハンドラーを示すトークンを指定する。

HSP用 COM定義

#usecom / #comfunc によるHSPのCOM呼び出し定義。数字は vtbl インデックス(0始まり)。WebView2 のインターフェースは環境/ローダ経由で取得するため #usecom 末尾は "{}"

出力引数:
#define global IID_ICoreWebView2ServiceWorkerRegistration "{06003F5E-AF92-5E7E-B497-3FA167DD37C2}"
#usecom global ICoreWebView2ServiceWorkerRegistration IID_ICoreWebView2ServiceWorkerRegistration "{}"
#comfunc global ICoreWebView2ServiceWorkerRegistration_get_ActiveServiceWorker        3 sptr
#comfunc global ICoreWebView2ServiceWorkerRegistration_get_Origin                     4 var
#comfunc global ICoreWebView2ServiceWorkerRegistration_get_ScopeUri                   5 var
#comfunc global ICoreWebView2ServiceWorkerRegistration_get_TopLevelOrigin             6 var
#comfunc global ICoreWebView2ServiceWorkerRegistration_add_ServiceWorkerActivated     7 sptr,var
#comfunc global ICoreWebView2ServiceWorkerRegistration_remove_ServiceWorkerActivated  8 int
#comfunc global ICoreWebView2ServiceWorkerRegistration_add_Unregistering              9 sptr,var
#comfunc global ICoreWebView2ServiceWorkerRegistration_remove_Unregistering           10 int
; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。
; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。
; ※出力/バッファ引数は var(変数直渡し)。varptr 方式にも切替可。
; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。