@@ -27,11 +27,9 @@ void ScenarioServiceWorkerManager::CreateServiceWorkerManager()
2727
2828 wil::com_ptr<ICoreWebView2Profile> webView2Profile;
2929 CHECK_FAILURE (webView2_13->get_Profile (&webView2Profile));
30- auto webViewExperimentalProfile13 =
31- webView2Profile.try_query <ICoreWebView2ExperimentalProfile13>();
32- CHECK_FEATURE_RETURN_EMPTY (webViewExperimentalProfile13);
33- CHECK_FAILURE (
34- webViewExperimentalProfile13->get_ServiceWorkerManager (&m_serviceWorkerManager));
30+ auto webViewProfile9 = webView2Profile.try_query <ICoreWebView2Profile9>();
31+ CHECK_FEATURE_RETURN_EMPTY (webViewProfile9);
32+ CHECK_FAILURE (webViewProfile9->get_ServiceWorkerManager (&m_serviceWorkerManager));
3533 // ! [ServiceWorkerManager]
3634}
3735
@@ -44,13 +42,12 @@ void ScenarioServiceWorkerManager::SetupEventsOnWebview()
4442
4543 // ! [ServiceWorkerRegistered]
4644 CHECK_FAILURE (m_serviceWorkerManager->add_ServiceWorkerRegistered (
47- Callback<ICoreWebView2ExperimentalServiceWorkerRegisteredEventHandler >(
45+ Callback<ICoreWebView2ServiceWorkerRegisteredEventHandler >(
4846 [this ](
49- ICoreWebView2ExperimentalServiceWorkerManager * sender,
50- ICoreWebView2ExperimentalServiceWorkerRegisteredEventArgs * args)
47+ ICoreWebView2ServiceWorkerManager * sender,
48+ ICoreWebView2ServiceWorkerRegisteredEventArgs * args)
5149 {
52- wil::com_ptr<ICoreWebView2ExperimentalServiceWorkerRegistration>
53- serviceWorkerRegistration;
50+ wil::com_ptr<ICoreWebView2ServiceWorkerRegistration> serviceWorkerRegistration;
5451 CHECK_FAILURE (args->get_ServiceWorkerRegistration (&serviceWorkerRegistration));
5552
5653 if (serviceWorkerRegistration)
@@ -69,9 +66,9 @@ void ScenarioServiceWorkerManager::SetupEventsOnWebview()
6966 // Subscribe to worker registration unregistering event
7067 serviceWorkerRegistration->add_Unregistering (
7168 Callback<
72- ICoreWebView2ExperimentalServiceWorkerRegistrationUnregisteringEventHandler >(
69+ ICoreWebView2ServiceWorkerRegistrationUnregisteringEventHandler >(
7370 [this , scopeUriStr](
74- ICoreWebView2ExperimentalServiceWorkerRegistration * sender,
71+ ICoreWebView2ServiceWorkerRegistration * sender,
7572 IUnknown* args) -> HRESULT
7673 {
7774 /* Cleanup on worker registration destruction*/
@@ -82,7 +79,7 @@ void ScenarioServiceWorkerManager::SetupEventsOnWebview()
8279 .Get (),
8380 nullptr );
8481
85- wil::com_ptr<ICoreWebView2ExperimentalServiceWorker > serviceWorker;
82+ wil::com_ptr<ICoreWebView2ServiceWorker > serviceWorker;
8683 CHECK_FAILURE (
8784 serviceWorkerRegistration->get_ActiveServiceWorker (&serviceWorker));
8885
@@ -94,10 +91,9 @@ void ScenarioServiceWorkerManager::SetupEventsOnWebview()
9491
9592 // Subscribe to worker destroying event
9693 serviceWorker->add_Destroying (
97- Callback<
98- ICoreWebView2ExperimentalServiceWorkerDestroyingEventHandler>(
94+ Callback<ICoreWebView2ServiceWorkerDestroyingEventHandler>(
9995 [this , scriptUriStr](
100- ICoreWebView2ExperimentalServiceWorker * sender,
96+ ICoreWebView2ServiceWorker * sender,
10197 IUnknown* args) -> HRESULT
10298 {
10399 /* Cleanup on worker destruction*/
@@ -111,15 +107,13 @@ void ScenarioServiceWorkerManager::SetupEventsOnWebview()
111107 else
112108 {
113109 CHECK_FAILURE (serviceWorkerRegistration->add_ServiceWorkerActivated (
114- Callback<
115- ICoreWebView2ExperimentalServiceWorkerActivatedEventHandler>(
110+ Callback<ICoreWebView2ServiceWorkerActivatedEventHandler>(
116111 [this ](
117- ICoreWebView2ExperimentalServiceWorkerRegistration * sender,
118- ICoreWebView2ExperimentalServiceWorkerActivatedEventArgs*
119- args) -> HRESULT
112+ ICoreWebView2ServiceWorkerRegistration * sender,
113+ ICoreWebView2ServiceWorkerActivatedEventArgs* args)
114+ -> HRESULT
120115 {
121- wil::com_ptr<ICoreWebView2ExperimentalServiceWorker>
122- serviceWorker;
116+ wil::com_ptr<ICoreWebView2ServiceWorker> serviceWorker;
123117 CHECK_FAILURE (
124118 args->get_ActiveServiceWorker (&serviceWorker));
125119 wil::unique_cotaskmem_string scriptUri;
@@ -129,9 +123,9 @@ void ScenarioServiceWorkerManager::SetupEventsOnWebview()
129123 // Subscribe to worker destroying event
130124 serviceWorker->add_Destroying (
131125 Callback<
132- ICoreWebView2ExperimentalServiceWorkerDestroyingEventHandler >(
126+ ICoreWebView2ServiceWorkerDestroyingEventHandler >(
133127 [this , scriptUriStr](
134- ICoreWebView2ExperimentalServiceWorker * sender,
128+ ICoreWebView2ServiceWorker * sender,
135129 IUnknown* args) -> HRESULT
136130 {
137131 /* Cleanup on worker destruction*/
@@ -166,9 +160,9 @@ void ScenarioServiceWorkerManager::GetAllServiceWorkerRegistrations()
166160{
167161 CHECK_FEATURE_RETURN_EMPTY (m_serviceWorkerManager);
168162 CHECK_FAILURE (m_serviceWorkerManager->GetServiceWorkerRegistrations (
169- Callback<ICoreWebView2ExperimentalGetServiceWorkerRegistrationsCompletedHandler >(
163+ Callback<ICoreWebView2GetServiceWorkerRegistrationsCompletedHandler >(
170164 [this ](
171- HRESULT error, ICoreWebView2ExperimentalServiceWorkerRegistrationCollectionView *
165+ HRESULT error, ICoreWebView2ServiceWorkerRegistrationCollectionView *
172166 workerRegistrationCollection) -> HRESULT
173167 {
174168 CHECK_FAILURE (error);
@@ -181,8 +175,7 @@ void ScenarioServiceWorkerManager::GetAllServiceWorkerRegistrations()
181175
182176 for (UINT32 i = 0 ; i < workersCount; i++)
183177 {
184- ComPtr<ICoreWebView2ExperimentalServiceWorkerRegistration>
185- serviceWorkerRegistration;
178+ ComPtr<ICoreWebView2ServiceWorkerRegistration> serviceWorkerRegistration;
186179 CHECK_FAILURE (workerRegistrationCollection->GetValueAtIndex (
187180 i, &serviceWorkerRegistration));
188181
@@ -221,11 +214,10 @@ void ScenarioServiceWorkerManager::GetServiceWorkerRegisteredForScope()
221214 std::wstring scope = dialog.input .c_str ();
222215 CHECK_FAILURE (m_serviceWorkerManager->GetServiceWorkerRegistrationsForScope (
223216 scope.c_str (),
224- Callback<ICoreWebView2ExperimentalGetServiceWorkerRegistrationsCompletedHandler >(
217+ Callback<ICoreWebView2GetServiceWorkerRegistrationsCompletedHandler >(
225218 [this , scope](
226- HRESULT error,
227- ICoreWebView2ExperimentalServiceWorkerRegistrationCollectionView*
228- workerRegistrationCollection) -> HRESULT
219+ HRESULT error, ICoreWebView2ServiceWorkerRegistrationCollectionView*
220+ workerRegistrationCollection) -> HRESULT
229221 {
230222 CHECK_FAILURE (error);
231223 UINT32 workersCount = 0 ;
@@ -237,7 +229,7 @@ void ScenarioServiceWorkerManager::GetServiceWorkerRegisteredForScope()
237229
238230 for (UINT32 i = 0 ; i < workersCount; i++)
239231 {
240- ComPtr<ICoreWebView2ExperimentalServiceWorkerRegistration >
232+ ComPtr<ICoreWebView2ServiceWorkerRegistration >
241233 serviceWorkerRegistration;
242234 CHECK_FAILURE (workerRegistrationCollection->GetValueAtIndex (
243235 i, &serviceWorkerRegistration));
0 commit comments