OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 const AtomicString& DedicatedWorkerGlobalScope::interfaceName() const { | 83 const AtomicString& DedicatedWorkerGlobalScope::interfaceName() const { |
84 return EventTargetNames::DedicatedWorkerGlobalScope; | 84 return EventTargetNames::DedicatedWorkerGlobalScope; |
85 } | 85 } |
86 | 86 |
87 void DedicatedWorkerGlobalScope::postMessage( | 87 void DedicatedWorkerGlobalScope::postMessage( |
88 ScriptState* scriptState, | 88 ScriptState* scriptState, |
89 PassRefPtr<SerializedScriptValue> message, | 89 PassRefPtr<SerializedScriptValue> message, |
90 const MessagePortArray& ports, | 90 const MessagePortArray& ports, |
91 ExceptionState& exceptionState) { | 91 ExceptionState& exceptionState) { |
92 // Disentangle the port in preparation for sending it to the remote context. | 92 // Disentangle the port in preparation for sending it to the remote context. |
93 std::unique_ptr<MessagePortChannelArray> channels = | 93 MessagePortChannelArray channels = |
94 MessagePort::disentanglePorts(scriptState->getExecutionContext(), ports, | 94 MessagePort::disentanglePorts(scriptState->getExecutionContext(), ports, |
95 exceptionState); | 95 exceptionState); |
96 if (exceptionState.hadException()) | 96 if (exceptionState.hadException()) |
97 return; | 97 return; |
98 workerObjectProxy().postMessageToWorkerObject(std::move(message), | 98 workerObjectProxy().postMessageToWorkerObject(std::move(message), |
99 std::move(channels)); | 99 std::move(channels)); |
100 } | 100 } |
101 | 101 |
102 InProcessWorkerObjectProxy& DedicatedWorkerGlobalScope::workerObjectProxy() | 102 InProcessWorkerObjectProxy& DedicatedWorkerGlobalScope::workerObjectProxy() |
103 const { | 103 const { |
104 return static_cast<DedicatedWorkerThread*>(thread())->workerObjectProxy(); | 104 return static_cast<DedicatedWorkerThread*>(thread())->workerObjectProxy(); |
105 } | 105 } |
106 | 106 |
107 DEFINE_TRACE(DedicatedWorkerGlobalScope) { | 107 DEFINE_TRACE(DedicatedWorkerGlobalScope) { |
108 WorkerGlobalScope::trace(visitor); | 108 WorkerGlobalScope::trace(visitor); |
109 } | 109 } |
110 | 110 |
111 } // namespace blink | 111 } // namespace blink |
OLD | NEW |