flutter_flutter/shell/common/thread_host.h
Chinmay Garde 58e84c8bf0
Re-land "Support multiple shells in a single process. (#4932)" (#4998)
* Re-land "Support multiple shells in a single process. (#4932)"

This reverts commit 723c7d01439da4261bc836075fb55651ce9e7f03.
2018-04-13 13:48:15 -07:00

44 lines
918 B
C++

// Copyright 2017 The Flutter 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_SHELL_COMMON_THREAD_HOST_H_
#define FLUTTER_SHELL_COMMON_THREAD_HOST_H_
#include <memory>
#include "flutter/fml/thread.h"
#include "lib/fxl/macros.h"
namespace shell {
struct ThreadHost {
enum Type {
Platform = 1 << 0,
UI = 1 << 1,
GPU = 1 << 2,
IO = 1 << 3,
};
std::unique_ptr<fml::Thread> platform_thread;
std::unique_ptr<fml::Thread> ui_thread;
std::unique_ptr<fml::Thread> gpu_thread;
std::unique_ptr<fml::Thread> io_thread;
ThreadHost();
ThreadHost(ThreadHost&&) = default;
ThreadHost& operator=(ThreadHost&&) = default;
ThreadHost(std::string name_prefix, uint64_t type_mask);
~ThreadHost();
void Reset();
};
} // namespace shell
#endif // FLUTTER_SHELL_COMMON_THREAD_HOST_H_