Flutter Engine
The Flutter Engine
task_observers.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter 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 "flutter/fml/platform/fuchsia/task_observers.h"
6
7#include <map>
8
9namespace fml {
10
11thread_local std::map<intptr_t, fit::closure> tTaskObservers;
12
14 for (const auto& callback : tTaskObservers) {
15 callback.second();
16 }
17}
18
20 fit::closure observer) {
21 if (observer) {
22 tTaskObservers[key] = std::move(observer);
23 }
24}
25
27 tTaskObservers.erase(key);
28}
29
30} // namespace fml
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
Definition: ascii_trie.cc:9
void CurrentMessageLoopAddAfterTaskObserver(intptr_t key, fit::closure observer)
thread_local std::map< intptr_t, fit::closure > tTaskObservers
void CurrentMessageLoopRemoveAfterTaskObserver(intptr_t key)
std::function< void()> closure
Definition: closure.h:14
void ExecuteAfterTaskObservers()