forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
content_handler_thread.h
48 lines (32 loc) · 974 Bytes
/
content_handler_thread.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright 2017 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.
#ifndef FLUTTER_CONTENT_HANDLER_CONTENT_HANDLER_THREAD_H_
#define FLUTTER_CONTENT_HANDLER_CONTENT_HANDLER_THREAD_H_
#include <pthread.h>
#include <functional>
#include "lib/ftl/macros.h"
#include "lib/ftl/memory/ref_ptr.h"
#include "lib/ftl/tasks/task_runner.h"
namespace mtl {
namespace internal {
class IncomingTaskQueue;
} // namespace internal
} // namespace mtl
namespace flutter_runner {
class Thread {
public:
Thread();
~Thread();
ftl::RefPtr<ftl::TaskRunner> TaskRunner() const;
bool Join();
bool IsValid() const;
private:
bool valid_;
pthread_t thread_;
ftl::RefPtr<mtl::internal::IncomingTaskQueue> task_runner_;
void Main();
FTL_DISALLOW_COPY_AND_ASSIGN(Thread);
};
} // namespace flutter_runner
#endif // FLUTTER_CONTENT_HANDLER_CONTENT_HANDLER_THREAD_H_