Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 30 matching lines...) Expand all Loading... | |
| 41 | 41 |
| 42 PassOwnPtr<WebCore::ServiceWorkerGlobalScopeClient> ServiceWorkerGlobalScopeClie ntImpl::create(PassOwnPtr<WebServiceWorkerContextClient> client) | 42 PassOwnPtr<WebCore::ServiceWorkerGlobalScopeClient> ServiceWorkerGlobalScopeClie ntImpl::create(PassOwnPtr<WebServiceWorkerContextClient> client) |
| 43 { | 43 { |
| 44 return adoptPtr(new ServiceWorkerGlobalScopeClientImpl(client)); | 44 return adoptPtr(new ServiceWorkerGlobalScopeClientImpl(client)); |
| 45 } | 45 } |
| 46 | 46 |
| 47 ServiceWorkerGlobalScopeClientImpl::~ServiceWorkerGlobalScopeClientImpl() | 47 ServiceWorkerGlobalScopeClientImpl::~ServiceWorkerGlobalScopeClientImpl() |
| 48 { | 48 { |
| 49 } | 49 } |
| 50 | 50 |
| 51 void ServiceWorkerGlobalScopeClientImpl::didHandleActivateEvent(int eventID, Web ServiceWorkerEventResult result) | |
| 52 { | |
| 53 if (m_client) | |
| 54 m_client->didHandleActivateEvent(eventID, result); | |
|
kinuko
2014/03/28 05:24:45
nit: looks like our current assumption is m_client
| |
| 55 } | |
| 56 | |
| 51 void ServiceWorkerGlobalScopeClientImpl::didHandleInstallEvent(int installEventI D, WebServiceWorkerEventResult result) | 57 void ServiceWorkerGlobalScopeClientImpl::didHandleInstallEvent(int installEventI D, WebServiceWorkerEventResult result) |
| 52 { | 58 { |
| 53 m_client->didHandleInstallEvent(installEventID, result); | 59 m_client->didHandleInstallEvent(installEventID, result); |
| 54 } | 60 } |
| 55 | 61 |
| 56 void ServiceWorkerGlobalScopeClientImpl::didHandleFetchEvent(int fetchEventID, P assRefPtr<WebCore::Response> response) | 62 void ServiceWorkerGlobalScopeClientImpl::didHandleFetchEvent(int fetchEventID, P assRefPtr<WebCore::Response> response) |
| 57 { | 63 { |
| 58 if (!response) { | 64 if (!response) { |
| 59 m_client->didHandleFetchEvent(fetchEventID); | 65 m_client->didHandleFetchEvent(fetchEventID); |
| 60 return; | 66 return; |
| 61 } | 67 } |
| 62 | 68 |
| 63 WebServiceWorkerResponse webResponse; | 69 WebServiceWorkerResponse webResponse; |
| 64 response->populateWebServiceWorkerResponse(webResponse); | 70 response->populateWebServiceWorkerResponse(webResponse); |
| 65 m_client->didHandleFetchEvent(fetchEventID, webResponse); | 71 m_client->didHandleFetchEvent(fetchEventID, webResponse); |
| 66 } | 72 } |
| 67 | 73 |
| 68 void ServiceWorkerGlobalScopeClientImpl::didHandleSyncEvent(int syncEventID) | 74 void ServiceWorkerGlobalScopeClientImpl::didHandleSyncEvent(int syncEventID) |
| 69 { | 75 { |
| 70 m_client->didHandleSyncEvent(syncEventID); | 76 m_client->didHandleSyncEvent(syncEventID); |
| 71 } | 77 } |
| 72 | 78 |
| 73 ServiceWorkerGlobalScopeClientImpl::ServiceWorkerGlobalScopeClientImpl(PassOwnPt r<WebServiceWorkerContextClient> client) | 79 ServiceWorkerGlobalScopeClientImpl::ServiceWorkerGlobalScopeClientImpl(PassOwnPt r<WebServiceWorkerContextClient> client) |
| 74 : m_client(client) | 80 : m_client(client) |
| 75 { | 81 { |
| 76 } | 82 } |
| 77 | 83 |
| 78 } // namespace blink | 84 } // namespace blink |
| OLD | NEW |