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 public: | 37 public: |
38 ActiveDOMObject(ExecutionContext*); | 38 ActiveDOMObject(ExecutionContext*); |
39 | 39 |
40 // suspendIfNeeded() should be called exactly once after object construction
to synchronize | 40 // suspendIfNeeded() should be called exactly once after object construction
to synchronize |
41 // the suspend state with that in ExecutionContext. | 41 // the suspend state with that in ExecutionContext. |
42 void suspendIfNeeded(); | 42 void suspendIfNeeded(); |
43 #if ENABLE(ASSERT) | 43 #if ENABLE(ASSERT) |
44 bool suspendIfNeededCalled() const { return m_suspendIfNeededCalled; } | 44 bool suspendIfNeededCalled() const { return m_suspendIfNeededCalled; } |
45 #endif | 45 #endif |
46 | 46 |
47 // Should return true if there's any pending asynchronous activity, and so | |
48 // this object must not be garbage collected. | |
49 virtual bool hasPendingActivity() const; | |
50 | |
51 // These methods have an empty default implementation so that subclasses | 47 // These methods have an empty default implementation so that subclasses |
52 // which don't need special treatment can skip implementation. | 48 // which don't need special treatment can skip implementation. |
53 virtual void suspend(); | 49 virtual void suspend(); |
54 virtual void resume(); | 50 virtual void resume(); |
55 virtual void stop(); | 51 virtual void stop(); |
56 | 52 |
57 void didMoveToNewExecutionContext(ExecutionContext*); | 53 void didMoveToNewExecutionContext(ExecutionContext*); |
58 | 54 |
59 protected: | 55 protected: |
60 virtual ~ActiveDOMObject(); | 56 virtual ~ActiveDOMObject(); |
61 | 57 |
62 private: | 58 private: |
63 #if ENABLE(ASSERT) | 59 #if ENABLE(ASSERT) |
64 bool m_suspendIfNeededCalled; | 60 bool m_suspendIfNeededCalled; |
65 #endif | 61 #endif |
66 }; | 62 }; |
67 | 63 |
68 } // namespace blink | 64 } // namespace blink |
69 | 65 |
70 #endif // ActiveDOMObject_h | 66 #endif // ActiveDOMObject_h |
OLD | NEW |