| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "core/frame/DOMWindow.h" | 37 #include "core/frame/DOMWindow.h" |
| 38 #include "core/workers/WorkerGlobalScope.h" | 38 #include "core/workers/WorkerGlobalScope.h" |
| 39 #include "public/platform/WebString.h" | 39 #include "public/platform/WebString.h" |
| 40 #include "wtf/Functional.h" | 40 #include "wtf/Functional.h" |
| 41 #include "wtf/text/AtomicString.h" | 41 #include "wtf/text/AtomicString.h" |
| 42 | 42 |
| 43 namespace WebCore { | 43 namespace WebCore { |
| 44 | 44 |
| 45 PassRefPtr<MessagePort> MessagePort::create(ExecutionContext& executionContext) | 45 PassRefPtr<MessagePort> MessagePort::create(ExecutionContext& executionContext) |
| 46 { | 46 { |
| 47 RefPtr<MessagePort> port = adoptRef(new MessagePort(executionContext)); | 47 RefPtrWillBeRawPtr<MessagePort> port = adoptRefWillBeRefCountedGarbageCollec
ted(new MessagePort(executionContext)); |
| 48 port->suspendIfNeeded(); | 48 port->suspendIfNeeded(); |
| 49 return port.release(); | 49 return port.release(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 MessagePort::MessagePort(ExecutionContext& executionContext) | 52 MessagePort::MessagePort(ExecutionContext& executionContext) |
| 53 : ActiveDOMObject(&executionContext) | 53 : ActiveDOMObject(&executionContext) |
| 54 , m_started(false) | 54 , m_started(false) |
| 55 , m_closed(false) | 55 , m_closed(false) |
| 56 , m_weakFactory(this) | 56 , m_weakFactory(this) |
| 57 { | 57 { |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 OwnPtr<MessagePortArray> portArray = adoptPtr(new MessagePortArray(channels-
>size())); | 250 OwnPtr<MessagePortArray> portArray = adoptPtr(new MessagePortArray(channels-
>size())); |
| 251 for (unsigned i = 0; i < channels->size(); ++i) { | 251 for (unsigned i = 0; i < channels->size(); ++i) { |
| 252 RefPtr<MessagePort> port = MessagePort::create(context); | 252 RefPtr<MessagePort> port = MessagePort::create(context); |
| 253 port->entangle((*channels)[i].release()); | 253 port->entangle((*channels)[i].release()); |
| 254 (*portArray)[i] = port.release(); | 254 (*portArray)[i] = port.release(); |
| 255 } | 255 } |
| 256 return portArray.release(); | 256 return portArray.release(); |
| 257 } | 257 } |
| 258 | 258 |
| 259 } // namespace WebCore | 259 } // namespace WebCore |
| OLD | NEW |