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 "task_observers.h"
6 
7 #include <map>
8 
9 namespace flutter_runner {
10 
11 thread_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 flutter_runner
void CurrentMessageLoopRemoveAfterTaskObserver(intptr_t key)
void CurrentMessageLoopAddAfterTaskObserver(intptr_t key, fit::closure observer)
thread_local std::map< intptr_t, fit::closure > tTaskObservers
std::function< void()> closure
Definition: closure.h:14
void ExecuteAfterTaskObservers()