Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: mojo/edk/base_edk/platform_message_loop_impl.h

Issue 1469193002: EDK: Add a mojo::platform::MessageLoop abstraction. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/edk/base_edk/BUILD.gn ('k') | mojo/edk/base_edk/platform_message_loop_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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 // This file provides an implementation of |mojo::platform::MessageLoop| that
6 // wraps a |base::MessageLoop|.
7
8 #ifndef MOJO_EDK_BASE_EDK_PLATFORM_MESSAGE_LOOP_IMPL_H_
9 #define MOJO_EDK_BASE_EDK_PLATFORM_MESSAGE_LOOP_IMPL_H_
10
11 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/message_loop/message_loop.h"
14 #include "mojo/edk/platform/message_loop.h"
15 #include "mojo/edk/platform/task_runner.h"
16
17 namespace base_edk {
18
19 class PlatformMessageLoopImpl : public mojo::platform::MessageLoop {
20 public:
21 explicit PlatformMessageLoopImpl(
22 base::MessageLoop::Type type = base::MessageLoop::TYPE_DEFAULT);
23 explicit PlatformMessageLoopImpl(scoped_ptr<base::MessagePump> pump);
24 ~PlatformMessageLoopImpl() override;
25
26 const base::MessageLoop& base_message_loop() const {
27 return base_message_loop_;
28 }
29 base::MessageLoop& base_message_loop() { return base_message_loop_; }
30
31 // |mojo::platform::MessageLoop| implementation:
32 void Run() override;
33 void RunUntilIdle() override;
34 void QuitWhenIdle() override;
35 const mojo::util::RefPtr<mojo::platform::TaskRunner>& GetTaskRunner()
36 const override;
37 bool IsRunningOnCurrentThread() const override;
38
39 private:
40 base::MessageLoop base_message_loop_;
41 mojo::util::RefPtr<mojo::platform::TaskRunner> task_runner_;
42
43 DISALLOW_COPY_AND_ASSIGN(PlatformMessageLoopImpl);
44 };
45
46 } // namespace base_edk
47
48 #endif // MOJO_EDK_BASE_EDK_PLATFORM_MESSAGE_LOOP_IMPL_H_
OLDNEW
« no previous file with comments | « mojo/edk/base_edk/BUILD.gn ('k') | mojo/edk/base_edk/platform_message_loop_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698