| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 DedicatedWorkerContext::~DedicatedWorkerContext() | 54 DedicatedWorkerContext::~DedicatedWorkerContext() |
| 55 { | 55 { |
| 56 } | 56 } |
| 57 | 57 |
| 58 const AtomicString& DedicatedWorkerContext::interfaceName() const | 58 const AtomicString& DedicatedWorkerContext::interfaceName() const |
| 59 { | 59 { |
| 60 return eventNames().interfaceForDedicatedWorkerContext; | 60 return eventNames().interfaceForDedicatedWorkerContext; |
| 61 } | 61 } |
| 62 | 62 |
| 63 void DedicatedWorkerContext::postMessage(PassRefPtr<SerializedScriptValue> messa
ge, MessagePort* port, ExceptionCode& ec) | |
| 64 { | |
| 65 MessagePortArray ports; | |
| 66 if (port) | |
| 67 ports.append(port); | |
| 68 postMessage(message, &ports, ec); | |
| 69 } | |
| 70 | |
| 71 void DedicatedWorkerContext::postMessage(PassRefPtr<SerializedScriptValue> messa
ge, const MessagePortArray* ports, ExceptionCode& ec) | 63 void DedicatedWorkerContext::postMessage(PassRefPtr<SerializedScriptValue> messa
ge, const MessagePortArray* ports, ExceptionCode& ec) |
| 72 { | 64 { |
| 73 // Disentangle the port in preparation for sending it to the remote context. | 65 // Disentangle the port in preparation for sending it to the remote context. |
| 74 OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(por
ts, ec); | 66 OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(por
ts, ec); |
| 75 if (ec) | 67 if (ec) |
| 76 return; | 68 return; |
| 77 thread()->workerObjectProxy().postMessageToWorkerObject(message, channels.re
lease()); | 69 thread()->workerObjectProxy().postMessageToWorkerObject(message, channels.re
lease()); |
| 78 } | 70 } |
| 79 | 71 |
| 80 void DedicatedWorkerContext::importScripts(const Vector<String>& urls, Exception
Code& ec) | 72 void DedicatedWorkerContext::importScripts(const Vector<String>& urls, Exception
Code& ec) |
| 81 { | 73 { |
| 82 Base::importScripts(urls, ec); | 74 Base::importScripts(urls, ec); |
| 83 thread()->workerObjectProxy().reportPendingActivity(hasPendingActivity()); | 75 thread()->workerObjectProxy().reportPendingActivity(hasPendingActivity()); |
| 84 } | 76 } |
| 85 | 77 |
| 86 DedicatedWorkerThread* DedicatedWorkerContext::thread() | 78 DedicatedWorkerThread* DedicatedWorkerContext::thread() |
| 87 { | 79 { |
| 88 return static_cast<DedicatedWorkerThread*>(Base::thread()); | 80 return static_cast<DedicatedWorkerThread*>(Base::thread()); |
| 89 } | 81 } |
| 90 | 82 |
| 91 } // namespace WebCore | 83 } // namespace WebCore |
| OLD | NEW |