Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / testing / NullExecutionContext.cpp
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "core/testing/NullExecutionContext.h"
7
8 #include "core/events/Event.h"
9
10 namespace blink {
11
12 namespace {
13
14 class NullEventQueue FINAL : public EventQueue {
15 public:
16     NullEventQueue() { }
17     virtual ~NullEventQueue() { }
18     virtual bool enqueueEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE { return true; }
19     virtual bool cancelEvent(Event*) OVERRIDE { return true; }
20     virtual void close() OVERRIDE { }
21 };
22
23 } // namespace
24
25 NullExecutionContext::NullExecutionContext()
26     : m_tasksNeedSuspension(false)
27     , m_queue(adoptPtrWillBeNoop(new NullEventQueue()))
28 {
29 }
30
31 } // namespace blink