| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Apple Inc. All rights reserved. | 3 * Copyright (C) 2010 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 */ | 30 */ |
| 31 | 31 |
| 32 #ifndef SharedWorker_h | 32 #ifndef SharedWorker_h |
| 33 #define SharedWorker_h | 33 #define SharedWorker_h |
| 34 | 34 |
| 35 #include "core/workers/AbstractWorker.h" | 35 #include "core/workers/AbstractWorker.h" |
| 36 #include "heap/Handle.h" |
| 36 #include "platform/Supplementable.h" | 37 #include "platform/Supplementable.h" |
| 37 | 38 |
| 38 namespace WebCore { | 39 namespace WebCore { |
| 39 | 40 |
| 40 class ExceptionState; | 41 class ExceptionState; |
| 41 | 42 |
| 42 class SharedWorker FINAL : public AbstractWorker, public ScriptWrappable, public
Supplementable<SharedWorker> { | 43 class SharedWorker FINAL : public AbstractWorker, public ScriptWrappable, public
Supplementable<SharedWorker> { |
| 43 public: | 44 public: |
| 44 static PassRefPtr<SharedWorker> create(ExecutionContext*, const String& url,
const String& name, ExceptionState&); | 45 static PassRefPtrWillBeRawPtr<SharedWorker> create(ExecutionContext*, const
String& url, const String& name, ExceptionState&); |
| 45 virtual ~SharedWorker(); | 46 virtual ~SharedWorker(); |
| 46 | 47 |
| 47 MessagePort* port() const { return m_port.get(); } | 48 MessagePort* port() const { return m_port.get(); } |
| 48 | 49 |
| 49 virtual const AtomicString& interfaceName() const OVERRIDE; | 50 virtual const AtomicString& interfaceName() const OVERRIDE; |
| 50 | 51 |
| 51 // Prevents this SharedWorker + JS wrapper from being garbage collected. | 52 // Prevents this SharedWorker + JS wrapper from being garbage collected. |
| 52 void setPreventGC(); | 53 void setPreventGC(); |
| 53 // Allows this SharedWorker + JS wrapper to be garbage collected. | 54 // Allows this SharedWorker + JS wrapper to be garbage collected. |
| 54 void unsetPreventGC(); | 55 void unsetPreventGC(); |
| 55 | 56 |
| 57 virtual void trace(Visitor*) OVERRIDE; |
| 58 |
| 56 private: | 59 private: |
| 57 explicit SharedWorker(ExecutionContext*); | 60 explicit SharedWorker(ExecutionContext*); |
| 58 | 61 |
| 59 RefPtr<MessagePort> m_port; | 62 RefPtr<MessagePort> m_port; |
| 60 }; | 63 }; |
| 61 | 64 |
| 62 } // namespace WebCore | 65 } // namespace WebCore |
| 63 | 66 |
| 64 #endif // SharedWorker_h | 67 #endif // SharedWorker_h |
| OLD | NEW |