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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "public/platform/WebString.h" | 42 #include "public/platform/WebString.h" |
43 #include "public/platform/modules/serviceworker/WebServiceWorkerState.h" | 43 #include "public/platform/modules/serviceworker/WebServiceWorkerState.h" |
44 | 44 |
45 namespace blink { | 45 namespace blink { |
46 | 46 |
47 const AtomicString& ServiceWorker::interfaceName() const | 47 const AtomicString& ServiceWorker::interfaceName() const |
48 { | 48 { |
49 return EventTargetNames::ServiceWorker; | 49 return EventTargetNames::ServiceWorker; |
50 } | 50 } |
51 | 51 |
52 void ServiceWorker::postMessage(ExecutionContext* context, PassRefPtr<Serialized
ScriptValue> message, const MessagePortArray* ports, ExceptionState& exceptionSt
ate) | 52 void ServiceWorker::postMessage(ExecutionContext* context, PassRefPtr<Serialized
ScriptValue> message, const MessagePortArray& ports, ExceptionState& exceptionSt
ate) |
53 { | 53 { |
54 ServiceWorkerContainerClient* client = ServiceWorkerContainerClient::from(ge
tExecutionContext()); | 54 ServiceWorkerContainerClient* client = ServiceWorkerContainerClient::from(ge
tExecutionContext()); |
55 if (!client || !client->provider()) { | 55 if (!client || !client->provider()) { |
56 exceptionState.throwDOMException(InvalidStateError, "Failed to post a me
ssage: No associated provider is available."); | 56 exceptionState.throwDOMException(InvalidStateError, "Failed to post a me
ssage: No associated provider is available."); |
57 return; | 57 return; |
58 } | 58 } |
59 | 59 |
60 // Disentangle the port in preparation for sending it to the remote context. | 60 // Disentangle the port in preparation for sending it to the remote context. |
61 OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(con
text, ports, exceptionState); | 61 OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(con
text, ports, exceptionState); |
62 if (exceptionState.hadException()) | 62 if (exceptionState.hadException()) |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 { | 153 { |
154 ASSERT(m_handle); | 154 ASSERT(m_handle); |
155 m_handle->serviceWorker()->setProxy(this); | 155 m_handle->serviceWorker()->setProxy(this); |
156 } | 156 } |
157 | 157 |
158 ServiceWorker::~ServiceWorker() | 158 ServiceWorker::~ServiceWorker() |
159 { | 159 { |
160 } | 160 } |
161 | 161 |
162 } // namespace blink | 162 } // namespace blink |
OLD | NEW |