| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 return; | 63 return; |
| 64 if (m_handle->serviceWorker()->state() == WebServiceWorkerStateRedundant) { | 64 if (m_handle->serviceWorker()->state() == WebServiceWorkerStateRedundant) { |
| 65 exceptionState.throwDOMException(InvalidStateError, "ServiceWorker is in
redundant state."); | 65 exceptionState.throwDOMException(InvalidStateError, "ServiceWorker is in
redundant state."); |
| 66 return; | 66 return; |
| 67 } | 67 } |
| 68 | 68 |
| 69 if (message->containsTransferableArrayBuffer()) | 69 if (message->containsTransferableArrayBuffer()) |
| 70 context->addConsoleMessage(ConsoleMessage::create(JSMessageSource, Warni
ngMessageLevel, "ServiceWorker cannot send an ArrayBuffer as a transferable obje
ct yet. See http://crbug.com/511119")); | 70 context->addConsoleMessage(ConsoleMessage::create(JSMessageSource, Warni
ngMessageLevel, "ServiceWorker cannot send an ArrayBuffer as a transferable obje
ct yet. See http://crbug.com/511119")); |
| 71 | 71 |
| 72 WebString messageString = message->toWireString(); | 72 WebString messageString = message->toWireString(); |
| 73 OwnPtr<WebMessagePortChannelArray> webChannels = MessagePort::toWebMessagePo
rtChannelArray(channels.release()); | 73 OwnPtr<WebMessagePortChannelArray> webChannels = MessagePort::toWebMessagePo
rtChannelArray(std::move(channels)); |
| 74 m_handle->serviceWorker()->postMessage(client->provider(), messageString, We
bSecurityOrigin(getExecutionContext()->getSecurityOrigin()), webChannels.leakPtr
()); | 74 m_handle->serviceWorker()->postMessage(client->provider(), messageString, We
bSecurityOrigin(getExecutionContext()->getSecurityOrigin()), webChannels.leakPtr
()); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void ServiceWorker::internalsTerminate() | 77 void ServiceWorker::internalsTerminate() |
| 78 { | 78 { |
| 79 m_handle->serviceWorker()->terminate(); | 79 m_handle->serviceWorker()->terminate(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 void ServiceWorker::dispatchStateChangeEvent() | 82 void ServiceWorker::dispatchStateChangeEvent() |
| 83 { | 83 { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 ServiceWorker::~ServiceWorker() | 158 ServiceWorker::~ServiceWorker() |
| 159 { | 159 { |
| 160 } | 160 } |
| 161 | 161 |
| 162 DEFINE_TRACE(ServiceWorker) | 162 DEFINE_TRACE(ServiceWorker) |
| 163 { | 163 { |
| 164 AbstractWorker::trace(visitor); | 164 AbstractWorker::trace(visitor); |
| 165 } | 165 } |
| 166 | 166 |
| 167 } // namespace blink | 167 } // namespace blink |
| OLD | NEW |