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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 void ServiceWorkerGlobalScopeClientImpl::didHandleActivateEvent(int eventID, Web
ServiceWorkerEventResult result) | 67 void ServiceWorkerGlobalScopeClientImpl::didHandleActivateEvent(int eventID, Web
ServiceWorkerEventResult result) |
68 { | 68 { |
69 m_client.didHandleActivateEvent(eventID, result); | 69 m_client.didHandleActivateEvent(eventID, result); |
70 } | 70 } |
71 | 71 |
72 void ServiceWorkerGlobalScopeClientImpl::didHandleInstallEvent(int installEventI
D, WebServiceWorkerEventResult result) | 72 void ServiceWorkerGlobalScopeClientImpl::didHandleInstallEvent(int installEventI
D, WebServiceWorkerEventResult result) |
73 { | 73 { |
74 m_client.didHandleInstallEvent(installEventID, result); | 74 m_client.didHandleInstallEvent(installEventID, result); |
75 } | 75 } |
76 | 76 |
77 void ServiceWorkerGlobalScopeClientImpl::didHandleFetchEvent(int fetchEventID, R
esponse* response) | 77 void ServiceWorkerGlobalScopeClientImpl::didHandleFetchEvent(int fetchEventID) |
78 { | 78 { |
79 if (!response) { | 79 m_client.didHandleFetchEvent(fetchEventID); |
80 m_client.didHandleFetchEvent(fetchEventID); | 80 } |
81 return; | |
82 } | |
83 | 81 |
84 WebServiceWorkerResponse webResponse; | 82 void ServiceWorkerGlobalScopeClientImpl::didHandleFetchEvent(int fetchEventID, c
onst WebServiceWorkerResponse& webResponse) |
85 response->populateWebServiceWorkerResponse(webResponse); | 83 { |
86 if (webResponse.status() == 0) { | |
87 // The status code is 0 means a network error. | |
88 m_client.didHandleFetchEvent(fetchEventID); | |
89 return; | |
90 } | |
91 m_client.didHandleFetchEvent(fetchEventID, webResponse); | 84 m_client.didHandleFetchEvent(fetchEventID, webResponse); |
92 } | 85 } |
93 | 86 |
94 void ServiceWorkerGlobalScopeClientImpl::didHandleSyncEvent(int syncEventID) | 87 void ServiceWorkerGlobalScopeClientImpl::didHandleSyncEvent(int syncEventID) |
95 { | 88 { |
96 m_client.didHandleSyncEvent(syncEventID); | 89 m_client.didHandleSyncEvent(syncEventID); |
97 } | 90 } |
98 | 91 |
99 void ServiceWorkerGlobalScopeClientImpl::postMessageToClient(int clientID, const
WebString& message, PassOwnPtr<WebMessagePortChannelArray> webChannels) | 92 void ServiceWorkerGlobalScopeClientImpl::postMessageToClient(int clientID, const
WebString& message, PassOwnPtr<WebMessagePortChannelArray> webChannels) |
100 { | 93 { |
101 m_client.postMessageToClient(clientID, message, webChannels.leakPtr()); | 94 m_client.postMessageToClient(clientID, message, webChannels.leakPtr()); |
102 } | 95 } |
103 | 96 |
104 ServiceWorkerGlobalScopeClientImpl::ServiceWorkerGlobalScopeClientImpl(WebServic
eWorkerContextClient& client) | 97 ServiceWorkerGlobalScopeClientImpl::ServiceWorkerGlobalScopeClientImpl(WebServic
eWorkerContextClient& client) |
105 : m_client(client) | 98 : m_client(client) |
106 { | 99 { |
107 } | 100 } |
108 | 101 |
109 } // namespace blink | 102 } // namespace blink |
OLD | NEW |