| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // Disentangle the port in preparation for sending it to the remote context. | 78 // Disentangle the port in preparation for sending it to the remote context. |
| 79 OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(por
ts, exceptionState); | 79 OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(por
ts, exceptionState); |
| 80 if (exceptionState.hadException()) | 80 if (exceptionState.hadException()) |
| 81 return; | 81 return; |
| 82 | 82 |
| 83 WebString messageString = message->toWireString(); | 83 WebString messageString = message->toWireString(); |
| 84 OwnPtr<WebMessagePortChannelArray> webChannels = MessagePort::toWebMessagePo
rtChannelArray(channels.release()); | 84 OwnPtr<WebMessagePortChannelArray> webChannels = MessagePort::toWebMessagePo
rtChannelArray(channels.release()); |
| 85 m_outerWorker->postMessage(messageString, webChannels.leakPtr()); | 85 m_outerWorker->postMessage(messageString, webChannels.leakPtr()); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void ServiceWorker::terminate(ExceptionState& exceptionState) | |
| 89 { | |
| 90 exceptionState.throwDOMException(InvalidAccessError, "Not supported."); | |
| 91 } | |
| 92 | |
| 93 bool ServiceWorker::isReady() | 88 bool ServiceWorker::isReady() |
| 94 { | 89 { |
| 95 return m_proxyState == Ready; | 90 return m_proxyState == Ready; |
| 96 } | 91 } |
| 97 | 92 |
| 98 void ServiceWorker::dispatchStateChangeEvent() | 93 void ServiceWorker::dispatchStateChangeEvent() |
| 99 { | 94 { |
| 100 ASSERT(isReady()); | 95 ASSERT(isReady()); |
| 101 this->dispatchEvent(Event::create(EventTypeNames::statechange)); | 96 this->dispatchEvent(Event::create(EventTypeNames::statechange)); |
| 102 } | 97 } |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 , WebServiceWorkerProxy(this) | 243 , WebServiceWorkerProxy(this) |
| 249 , m_outerWorker(worker) | 244 , m_outerWorker(worker) |
| 250 , m_proxyState(Initial) | 245 , m_proxyState(Initial) |
| 251 { | 246 { |
| 252 ScriptWrappable::init(this); | 247 ScriptWrappable::init(this); |
| 253 ASSERT(m_outerWorker); | 248 ASSERT(m_outerWorker); |
| 254 m_outerWorker->setProxy(this); | 249 m_outerWorker->setProxy(this); |
| 255 } | 250 } |
| 256 | 251 |
| 257 } // namespace blink | 252 } // namespace blink |
| OLD | NEW |