OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 #include "modules/background_fetch/BackgroundFetchEventInit.h" | 47 #include "modules/background_fetch/BackgroundFetchEventInit.h" |
48 #include "modules/background_fetch/BackgroundFetchFailEvent.h" | 48 #include "modules/background_fetch/BackgroundFetchFailEvent.h" |
49 #include "modules/background_fetch/BackgroundFetchFailEventInit.h" | 49 #include "modules/background_fetch/BackgroundFetchFailEventInit.h" |
50 #include "modules/background_fetch/BackgroundFetchedEvent.h" | 50 #include "modules/background_fetch/BackgroundFetchedEvent.h" |
51 #include "modules/background_fetch/BackgroundFetchedEventInit.h" | 51 #include "modules/background_fetch/BackgroundFetchedEventInit.h" |
52 #include "modules/background_sync/SyncEvent.h" | 52 #include "modules/background_sync/SyncEvent.h" |
53 #include "modules/fetch/Headers.h" | 53 #include "modules/fetch/Headers.h" |
54 #include "modules/notifications/Notification.h" | 54 #include "modules/notifications/Notification.h" |
55 #include "modules/notifications/NotificationEvent.h" | 55 #include "modules/notifications/NotificationEvent.h" |
56 #include "modules/notifications/NotificationEventInit.h" | 56 #include "modules/notifications/NotificationEventInit.h" |
57 #include "modules/payments/PaymentAppRequest.h" | |
58 #include "modules/payments/PaymentAppRequestConversion.h" | |
59 #include "modules/payments/PaymentRequestEvent.h" | 57 #include "modules/payments/PaymentRequestEvent.h" |
| 58 #include "modules/payments/PaymentRequestEventDataConversion.h" |
| 59 #include "modules/payments/PaymentRequestEventInit.h" |
60 #include "modules/payments/PaymentRequestRespondWithObserver.h" | 60 #include "modules/payments/PaymentRequestRespondWithObserver.h" |
61 #include "modules/push_messaging/PushEvent.h" | 61 #include "modules/push_messaging/PushEvent.h" |
62 #include "modules/push_messaging/PushMessageData.h" | 62 #include "modules/push_messaging/PushMessageData.h" |
63 #include "modules/serviceworkers/ExtendableEvent.h" | 63 #include "modules/serviceworkers/ExtendableEvent.h" |
64 #include "modules/serviceworkers/ExtendableMessageEvent.h" | 64 #include "modules/serviceworkers/ExtendableMessageEvent.h" |
65 #include "modules/serviceworkers/FetchEvent.h" | 65 #include "modules/serviceworkers/FetchEvent.h" |
66 #include "modules/serviceworkers/ForeignFetchEvent.h" | 66 #include "modules/serviceworkers/ForeignFetchEvent.h" |
67 #include "modules/serviceworkers/InstallEvent.h" | 67 #include "modules/serviceworkers/InstallEvent.h" |
68 #include "modules/serviceworkers/ServiceWorkerClient.h" | 68 #include "modules/serviceworkers/ServiceWorkerClient.h" |
69 #include "modules/serviceworkers/ServiceWorkerGlobalScope.h" | 69 #include "modules/serviceworkers/ServiceWorkerGlobalScope.h" |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 } | 446 } |
447 WaitUntilObserver* observer = WaitUntilObserver::Create( | 447 WaitUntilObserver* observer = WaitUntilObserver::Create( |
448 WorkerGlobalScope(), WaitUntilObserver::kSync, event_id); | 448 WorkerGlobalScope(), WaitUntilObserver::kSync, event_id); |
449 Event* event = SyncEvent::Create(EventTypeNames::sync, tag, | 449 Event* event = SyncEvent::Create(EventTypeNames::sync, tag, |
450 last_chance == kIsLastChance, observer); | 450 last_chance == kIsLastChance, observer); |
451 WorkerGlobalScope()->DispatchExtendableEvent(event, observer); | 451 WorkerGlobalScope()->DispatchExtendableEvent(event, observer); |
452 } | 452 } |
453 | 453 |
454 void ServiceWorkerGlobalScopeProxy::DispatchPaymentRequestEvent( | 454 void ServiceWorkerGlobalScopeProxy::DispatchPaymentRequestEvent( |
455 int event_id, | 455 int event_id, |
456 const WebPaymentAppRequest& web_app_request) { | 456 const WebPaymentRequestEventData& web_app_request) { |
457 WaitUntilObserver* wait_until_observer = WaitUntilObserver::Create( | 457 WaitUntilObserver* wait_until_observer = WaitUntilObserver::Create( |
458 WorkerGlobalScope(), WaitUntilObserver::kPaymentRequest, event_id); | 458 WorkerGlobalScope(), WaitUntilObserver::kPaymentRequest, event_id); |
459 RespondWithObserver* respond_with_observer = | 459 RespondWithObserver* respond_with_observer = |
460 PaymentRequestRespondWithObserver::Create(WorkerGlobalScope(), event_id, | 460 PaymentRequestRespondWithObserver::Create(WorkerGlobalScope(), event_id, |
461 wait_until_observer); | 461 wait_until_observer); |
462 | 462 |
463 Event* event = PaymentRequestEvent::Create( | 463 Event* event = PaymentRequestEvent::Create( |
464 EventTypeNames::paymentrequest, | 464 EventTypeNames::paymentrequest, |
465 PaymentAppRequestConversion::ToPaymentAppRequest( | 465 PaymentRequestEventDataConversion::ToPaymentRequestEventInit( |
466 WorkerGlobalScope()->ScriptController()->GetScriptState(), | 466 WorkerGlobalScope()->ScriptController()->GetScriptState(), |
467 web_app_request), | 467 web_app_request), |
468 respond_with_observer, wait_until_observer); | 468 respond_with_observer, wait_until_observer); |
469 | 469 |
470 wait_until_observer->WillDispatchEvent(); | 470 wait_until_observer->WillDispatchEvent(); |
471 respond_with_observer->WillDispatchEvent(); | 471 respond_with_observer->WillDispatchEvent(); |
472 DispatchEventResult dispatch_result = | 472 DispatchEventResult dispatch_result = |
473 WorkerGlobalScope()->DispatchEvent(event); | 473 WorkerGlobalScope()->DispatchEvent(event); |
474 respond_with_observer->DidDispatchEvent(dispatch_result); | 474 respond_with_observer->DidDispatchEvent(dispatch_result); |
475 // false is okay because waitUntil for payment request event doesn't care | 475 // false is okay because waitUntil for payment request event doesn't care |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 return *client_; | 599 return *client_; |
600 } | 600 } |
601 | 601 |
602 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::WorkerGlobalScope() | 602 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::WorkerGlobalScope() |
603 const { | 603 const { |
604 DCHECK(worker_global_scope_); | 604 DCHECK(worker_global_scope_); |
605 return worker_global_scope_; | 605 return worker_global_scope_; |
606 } | 606 } |
607 | 607 |
608 } // namespace blink | 608 } // namespace blink |
OLD | NEW |