Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 110d157

Browse files
author
George Wright
committed
review updates
1 parent ca4e448 commit 110d157

File tree

7 files changed

+7
-28
lines changed

7 files changed

+7
-28
lines changed

fml/message_loop.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,5 @@ TaskQueueId MessageLoop::GetCurrentTaskQueueId() {
8080
"this thread prior to message loop use.";
8181
return loop->GetLoopImpl()->GetTaskQueueId();
8282
}
83+
8384
} // namespace fml

fml/message_loop_impl.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,4 @@ TaskQueueId MessageLoopImpl::GetTaskQueueId() const {
145145
return queue_id_;
146146
}
147147

148-
fml::RefPtr<MessageLoopImpl> MessageLoopImpl::GetLoopImpl(MessageLoop& message_loop) {
149-
return message_loop.GetLoopImpl();
150-
}
151-
152148
} // namespace fml

fml/message_loop_impl.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ class MessageLoopImpl : public Wakeable,
5858
protected:
5959
MessageLoopImpl();
6060

61-
static fml::RefPtr<MessageLoopImpl> GetLoopImpl(MessageLoop& loop);
62-
6361
private:
6462
fml::RefPtr<MessageLoopTaskQueues> task_queue_;
6563
TaskQueueId queue_id_;

fml/platform/fuchsia/message_loop_fuchsia.cc

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,4 @@ void MessageLoopFuchsia::WakeUp(fml::TimePoint time_point) {
3535
FML_DCHECK(status == ZX_OK);
3636
}
3737

38-
// TODO(gw280): This is needed in order to get the underlying async::Loop object to pass to other Fuchsia components,
39-
// such as the Trace component.
40-
async::Loop* MessageLoopFuchsia::FuchsiaLoopForMessageLoop(MessageLoop& message_loop) {
41-
MessageLoopFuchsia* loop_impl = (MessageLoopFuchsia*)MessageLoopImpl::GetLoopImpl(message_loop).get();
42-
return loop_impl->GetAsyncLoop();
43-
}
44-
45-
async::Loop* MessageLoopFuchsia::GetAsyncLoop() {
46-
return &loop_;
47-
}
48-
4938
} // namespace fml

fml/platform/fuchsia/message_loop_fuchsia.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
namespace fml {
1414

1515
class MessageLoopFuchsia : public MessageLoopImpl {
16-
public:
17-
static async::Loop* FuchsiaLoopForMessageLoop(MessageLoop& message_loop);
18-
1916
private:
2017
MessageLoopFuchsia();
2118

@@ -27,8 +24,6 @@ class MessageLoopFuchsia : public MessageLoopImpl {
2724

2825
void WakeUp(fml::TimePoint time_point) override;
2926

30-
async::Loop* GetAsyncLoop();
31-
3227
async::Loop loop_;
3328

3429
FML_FRIEND_MAKE_REF_COUNTED(MessageLoopFuchsia);

shell/platform/fuchsia/flutter/main.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
#define FML_USED_ON_EMBEDDER
66

77
#include <lib/async-loop/cpp/loop.h>
8+
#include <lib/async-loop/default.h>
89
#include <lib/trace-provider/provider.h>
910
#include <lib/trace/event.h>
1011

1112
#include <cstdlib>
1213

13-
#include "flutter/fml/platform/fuchsia/message_loop_fuchsia.h"
14-
1514
#include "runner.h"
1615
#include "runtime/dart/utils/tempfs.h"
1716

@@ -23,9 +22,10 @@ int main(int argc, char const* argv[]) {
2322
{
2423
TRACE_DURATION("flutter", "CreateTraceProvider");
2524
bool already_started;
25+
async::Loop loop(&kAsyncLoopConfigAttachToCurrentThread);
2626
// Use CreateSynchronously to prevent loss of early events.
2727
trace::TraceProviderWithFdio::CreateSynchronously(
28-
fml::MessageLoopFuchsia::FuchsiaLoopForMessageLoop(message_loop)->dispatcher(), "flutter_runner", &provider, &already_started);
28+
loop.dispatcher(), "flutter_runner", &provider, &already_started);
2929
}
3030

3131
// Set up the process-wide /tmp memfs.

shell/platform/fuchsia/flutter/runner.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include <utility>
1919

2020
#include "flutter/fml/make_copyable.h"
21-
#include "flutter/fml/platform/fuchsia/message_loop_fuchsia.h"
2221
#include "flutter/lib/ui/text/font_collection.h"
2322
#include "flutter/runtime/dart_vm.h"
2423
#include "lib/sys/cpp/component_context.h"
@@ -284,8 +283,9 @@ bool Runner::SetupTZDataInternal() {
284283
#if !defined(DART_PRODUCT)
285284
void Runner::SetupTraceObserver() {
286285
trace_observer_ = std::make_unique<trace::TraceObserver>();
287-
auto loop = fml::MessageLoopFuchsia::FuchsiaLoopForMessageLoop(message_loop_);
288-
trace_observer_->Start(loop->dispatcher(), [runner = this]() {
286+
ASSERT_TRUE(message_loop_.GetTaskRunner()->RunsTasksOnCurrentThread());
287+
async::Loop loop(&kAsyncLoopConfigAttachToCurrentThread);
288+
trace_observer_->Start(loop.dispatcher(), [runner = this]() {
289289
if (!trace_is_category_enabled("dart:profiler")) {
290290
return;
291291
}

0 commit comments

Comments
 (0)