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 22 matching lines...) Expand all Loading... |
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 "heap/Handle.h" |
37 #include "platform/Supplementable.h" | 37 #include "platform/Supplementable.h" |
38 | 38 |
39 namespace WebCore { | 39 namespace WebCore { |
40 | 40 |
41 class ExceptionState; | 41 class ExceptionState; |
42 | 42 |
43 class SharedWorker FINAL : public AbstractWorker, public ScriptWrappable, public
Supplementable<SharedWorker> { | 43 class SharedWorker FINAL : public AbstractWorker, public ScriptWrappable, public
WillBeHeapSupplementable<SharedWorker> { |
| 44 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SharedWorker); |
44 public: | 45 public: |
45 static PassRefPtrWillBeRawPtr<SharedWorker> create(ExecutionContext*, const
String& url, const String& name, ExceptionState&); | 46 static PassRefPtrWillBeRawPtr<SharedWorker> create(ExecutionContext*, const
String& url, const String& name, ExceptionState&); |
46 virtual ~SharedWorker(); | 47 virtual ~SharedWorker(); |
47 | 48 |
48 MessagePort* port() const { return m_port.get(); } | 49 MessagePort* port() const { return m_port.get(); } |
49 | 50 |
50 virtual const AtomicString& interfaceName() const OVERRIDE; | 51 virtual const AtomicString& interfaceName() const OVERRIDE; |
51 | 52 |
52 // Prevents this SharedWorker + JS wrapper from being garbage collected. | 53 // Prevents this SharedWorker + JS wrapper from being garbage collected. |
53 void setPreventGC(); | 54 void setPreventGC(); |
54 // Allows this SharedWorker + JS wrapper to be garbage collected. | 55 // Allows this SharedWorker + JS wrapper to be garbage collected. |
55 void unsetPreventGC(); | 56 void unsetPreventGC(); |
56 | 57 |
57 virtual void trace(Visitor*) OVERRIDE; | 58 virtual void trace(Visitor*) OVERRIDE; |
58 | 59 |
59 private: | 60 private: |
60 explicit SharedWorker(ExecutionContext*); | 61 explicit SharedWorker(ExecutionContext*); |
61 | 62 |
62 RefPtr<MessagePort> m_port; | 63 RefPtr<MessagePort> m_port; |
63 }; | 64 }; |
64 | 65 |
65 } // namespace WebCore | 66 } // namespace WebCore |
66 | 67 |
67 #endif // SharedWorker_h | 68 #endif // SharedWorker_h |
OLD | NEW |