| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2013 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2013 Google 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 | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 virtual bool enqueueEvent(PassRefPtr<Event>) OVERRIDE { return true; } | 45 virtual bool enqueueEvent(PassRefPtr<Event>) OVERRIDE { return true; } |
| 46 virtual bool cancelEvent(Event*) OVERRIDE { return true; } | 46 virtual bool cancelEvent(Event*) OVERRIDE { return true; } |
| 47 virtual void close() OVERRIDE { } | 47 virtual void close() OVERRIDE { } |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 class NullExecutionContext : public ExecutionContext, public RefCounted<NullExec
utionContext> { | 50 class NullExecutionContext : public ExecutionContext, public RefCounted<NullExec
utionContext> { |
| 51 public: | 51 public: |
| 52 using RefCounted<NullExecutionContext>::ref; | 52 using RefCounted<NullExecutionContext>::ref; |
| 53 using RefCounted<NullExecutionContext>::deref; | 53 using RefCounted<NullExecutionContext>::deref; |
| 54 | 54 |
| 55 virtual void refExecutionContext() OVERRIDE { ref(); } | |
| 56 virtual void derefExecutionContext() OVERRIDE { deref(); } | |
| 57 virtual EventQueue* eventQueue() const OVERRIDE { return m_queue.get(); } | 55 virtual EventQueue* eventQueue() const OVERRIDE { return m_queue.get(); } |
| 58 virtual bool tasksNeedSuspension() { return m_tasksNeedSuspension; } | 56 virtual bool tasksNeedSuspension() { return m_tasksNeedSuspension; } |
| 59 | 57 |
| 60 void setTasksNeedSuspention(bool flag) { m_tasksNeedSuspension = flag; } | 58 void setTasksNeedSuspention(bool flag) { m_tasksNeedSuspension = flag; } |
| 61 | 59 |
| 62 NullExecutionContext(); | 60 NullExecutionContext(); |
| 63 | 61 |
| 64 private: | 62 private: |
| 65 bool m_tasksNeedSuspension; | 63 bool m_tasksNeedSuspension; |
| 66 OwnPtr<EventQueue> m_queue; | 64 OwnPtr<EventQueue> m_queue; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 bool isMarked = false; | 128 bool isMarked = false; |
| 131 | 129 |
| 132 context->setTasksNeedSuspention(true); | 130 context->setTasksNeedSuspention(true); |
| 133 runner->postTask(MarkingBooleanTask::create(&isMarked)); | 131 runner->postTask(MarkingBooleanTask::create(&isMarked)); |
| 134 runner.clear(); | 132 runner.clear(); |
| 135 WebCore::testing::runPendingTasks(); | 133 WebCore::testing::runPendingTasks(); |
| 136 EXPECT_FALSE(isMarked); | 134 EXPECT_FALSE(isMarked); |
| 137 } | 135 } |
| 138 | 136 |
| 139 } | 137 } |
| OLD | NEW |