| 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 28 matching lines...) Expand all Loading... |
| 39 #include "core/inspector/ConsoleMessage.h" | 39 #include "core/inspector/ConsoleMessage.h" |
| 40 #include "core/origin_trials/OriginTrials.h" | 40 #include "core/origin_trials/OriginTrials.h" |
| 41 #include "core/workers/ParentFrameTaskRunners.h" | 41 #include "core/workers/ParentFrameTaskRunners.h" |
| 42 #include "core/workers/WorkerGlobalScope.h" | 42 #include "core/workers/WorkerGlobalScope.h" |
| 43 #include "core/workers/WorkerThread.h" | 43 #include "core/workers/WorkerThread.h" |
| 44 #include "modules/background_sync/SyncEvent.h" | 44 #include "modules/background_sync/SyncEvent.h" |
| 45 #include "modules/fetch/Headers.h" | 45 #include "modules/fetch/Headers.h" |
| 46 #include "modules/notifications/Notification.h" | 46 #include "modules/notifications/Notification.h" |
| 47 #include "modules/notifications/NotificationEvent.h" | 47 #include "modules/notifications/NotificationEvent.h" |
| 48 #include "modules/notifications/NotificationEventInit.h" | 48 #include "modules/notifications/NotificationEventInit.h" |
| 49 #include "modules/payments/PaymentAppRequestData.h" | 49 #include "modules/payments/PaymentAppRequest.h" |
| 50 #include "modules/payments/PaymentAppRequestDataConversion.h" | 50 #include "modules/payments/PaymentAppRequestConversion.h" |
| 51 #include "modules/payments/PaymentRequestEvent.h" | 51 #include "modules/payments/PaymentRequestEvent.h" |
| 52 #include "modules/push_messaging/PushEvent.h" | 52 #include "modules/push_messaging/PushEvent.h" |
| 53 #include "modules/push_messaging/PushMessageData.h" | 53 #include "modules/push_messaging/PushMessageData.h" |
| 54 #include "modules/serviceworkers/ExtendableEvent.h" | 54 #include "modules/serviceworkers/ExtendableEvent.h" |
| 55 #include "modules/serviceworkers/ExtendableMessageEvent.h" | 55 #include "modules/serviceworkers/ExtendableMessageEvent.h" |
| 56 #include "modules/serviceworkers/FetchEvent.h" | 56 #include "modules/serviceworkers/FetchEvent.h" |
| 57 #include "modules/serviceworkers/ForeignFetchEvent.h" | 57 #include "modules/serviceworkers/ForeignFetchEvent.h" |
| 58 #include "modules/serviceworkers/InstallEvent.h" | 58 #include "modules/serviceworkers/InstallEvent.h" |
| 59 #include "modules/serviceworkers/ServiceWorkerClient.h" | 59 #include "modules/serviceworkers/ServiceWorkerClient.h" |
| 60 #include "modules/serviceworkers/ServiceWorkerGlobalScope.h" | 60 #include "modules/serviceworkers/ServiceWorkerGlobalScope.h" |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 } | 332 } |
| 333 WaitUntilObserver* observer = WaitUntilObserver::create( | 333 WaitUntilObserver* observer = WaitUntilObserver::create( |
| 334 workerGlobalScope(), WaitUntilObserver::Sync, eventID); | 334 workerGlobalScope(), WaitUntilObserver::Sync, eventID); |
| 335 Event* event = SyncEvent::create(EventTypeNames::sync, tag, | 335 Event* event = SyncEvent::create(EventTypeNames::sync, tag, |
| 336 lastChance == IsLastChance, observer); | 336 lastChance == IsLastChance, observer); |
| 337 workerGlobalScope()->dispatchExtendableEvent(event, observer); | 337 workerGlobalScope()->dispatchExtendableEvent(event, observer); |
| 338 } | 338 } |
| 339 | 339 |
| 340 void ServiceWorkerGlobalScopeProxy::dispatchPaymentRequestEvent( | 340 void ServiceWorkerGlobalScopeProxy::dispatchPaymentRequestEvent( |
| 341 int eventID, | 341 int eventID, |
| 342 const WebPaymentAppRequestData& webData) { | 342 const WebPaymentAppRequest& webAppRequest) { |
| 343 WaitUntilObserver* observer = WaitUntilObserver::create( | 343 WaitUntilObserver* observer = WaitUntilObserver::create( |
| 344 workerGlobalScope(), WaitUntilObserver::PaymentRequest, eventID); | 344 workerGlobalScope(), WaitUntilObserver::PaymentRequest, eventID); |
| 345 Event* event = PaymentRequestEvent::create( | 345 Event* event = PaymentRequestEvent::create( |
| 346 EventTypeNames::paymentrequest, | 346 EventTypeNames::paymentrequest, |
| 347 PaymentAppRequestDataConversion::toPaymentAppRequestData( | 347 PaymentAppRequestConversion::toPaymentAppRequest( |
| 348 workerGlobalScope()->scriptController()->getScriptState(), webData), | 348 workerGlobalScope()->scriptController()->getScriptState(), |
| 349 webAppRequest), |
| 349 observer); | 350 observer); |
| 350 workerGlobalScope()->dispatchExtendableEvent(event, observer); | 351 workerGlobalScope()->dispatchExtendableEvent(event, observer); |
| 351 } | 352 } |
| 352 | 353 |
| 353 bool ServiceWorkerGlobalScopeProxy::hasFetchEventHandler() { | 354 bool ServiceWorkerGlobalScopeProxy::hasFetchEventHandler() { |
| 354 DCHECK(m_workerGlobalScope); | 355 DCHECK(m_workerGlobalScope); |
| 355 return m_workerGlobalScope->hasEventListeners(EventTypeNames::fetch); | 356 return m_workerGlobalScope->hasEventListeners(EventTypeNames::fetch); |
| 356 } | 357 } |
| 357 | 358 |
| 358 void ServiceWorkerGlobalScopeProxy::countFeature(UseCounter::Feature) { | 359 void ServiceWorkerGlobalScopeProxy::countFeature(UseCounter::Feature) { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 return *m_document; | 483 return *m_document; |
| 483 } | 484 } |
| 484 | 485 |
| 485 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() | 486 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() |
| 486 const { | 487 const { |
| 487 DCHECK(m_workerGlobalScope); | 488 DCHECK(m_workerGlobalScope); |
| 488 return m_workerGlobalScope; | 489 return m_workerGlobalScope; |
| 489 } | 490 } |
| 490 | 491 |
| 491 } // namespace blink | 492 } // namespace blink |
| OLD | NEW |