| Index: mojo/edk/base_edk/platform_message_loop_impl.h
|
| diff --git a/mojo/edk/base_edk/platform_message_loop_impl.h b/mojo/edk/base_edk/platform_message_loop_impl.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a25b01369790b754e17e7f98aaf87ff6ca051225
|
| --- /dev/null
|
| +++ b/mojo/edk/base_edk/platform_message_loop_impl.h
|
| @@ -0,0 +1,48 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +// This file provides an implementation of |mojo::platform::MessageLoop| that
|
| +// wraps a |base::MessageLoop|.
|
| +
|
| +#ifndef MOJO_EDK_BASE_EDK_PLATFORM_MESSAGE_LOOP_IMPL_H_
|
| +#define MOJO_EDK_BASE_EDK_PLATFORM_MESSAGE_LOOP_IMPL_H_
|
| +
|
| +#include "base/macros.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| +#include "base/message_loop/message_loop.h"
|
| +#include "mojo/edk/platform/message_loop.h"
|
| +#include "mojo/edk/platform/task_runner.h"
|
| +
|
| +namespace base_edk {
|
| +
|
| +class PlatformMessageLoopImpl : public mojo::platform::MessageLoop {
|
| + public:
|
| + explicit PlatformMessageLoopImpl(
|
| + base::MessageLoop::Type type = base::MessageLoop::TYPE_DEFAULT);
|
| + explicit PlatformMessageLoopImpl(scoped_ptr<base::MessagePump> pump);
|
| + ~PlatformMessageLoopImpl() override;
|
| +
|
| + const base::MessageLoop& base_message_loop() const {
|
| + return base_message_loop_;
|
| + }
|
| + base::MessageLoop& base_message_loop() { return base_message_loop_; }
|
| +
|
| + // |mojo::platform::MessageLoop| implementation:
|
| + void Run() override;
|
| + void RunUntilIdle() override;
|
| + void QuitWhenIdle() override;
|
| + const mojo::util::RefPtr<mojo::platform::TaskRunner>& GetTaskRunner()
|
| + const override;
|
| + bool IsRunningOnCurrentThread() const override;
|
| +
|
| + private:
|
| + base::MessageLoop base_message_loop_;
|
| + mojo::util::RefPtr<mojo::platform::TaskRunner> task_runner_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(PlatformMessageLoopImpl);
|
| +};
|
| +
|
| +} // namespace base_edk
|
| +
|
| +#endif // MOJO_EDK_BASE_EDK_PLATFORM_MESSAGE_LOOP_IMPL_H_
|
|
|