提交 b03f0e43 编写于 作者: C Chinmay Garde 提交者: GitHub

Setup SKP tracing base path for the Mac desktop platform. (#2984)

Replicates iOS behavior of placing trace files in the documents directory.
上级 0f87eabd
......@@ -77,20 +77,11 @@ void FlutterInit(int argc, const char* argv[]) {
reinterpret_cast<CAEAGLLayer*>(self.view.layer));
_platformView->SetupResourceContextOnIOThread();
[self setupTracing];
[self setupNotificationCenterObservers];
[self connectToEngineAndLoad];
}
- (void)setupTracing {
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
sky::shell::Shell::Shared().tracing_controller().set_traces_base_path(
[paths.firstObject UTF8String]);
}
- (void)setupNotificationCenterObservers {
NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
[center addObserver:self
......
......@@ -275,7 +275,12 @@ class IOSGLContext {
PlatformViewIOS::PlatformViewIOS(CAEAGLLayer* layer)
: context_(WTF::MakeUnique<IOSGLContext>(surface_config_, layer)),
dynamic_service_loader_([[FlutterDynamicServiceLoader alloc] init]),
weak_factory_(this) {}
weak_factory_(this) {
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
sky::shell::Shell::Shared().tracing_controller().set_traces_base_path(
[paths.firstObject UTF8String]);
}
PlatformViewIOS::~PlatformViewIOS() = default;
......
......@@ -28,7 +28,12 @@ PlatformViewMac::PlatformViewMac(NSOpenGLView* gl_view)
resource_loading_context_([[NSOpenGLContext alloc]
initWithFormat:gl_view.pixelFormat
shareContext:gl_view.openGLContext]),
weak_factory_(this) {}
weak_factory_(this) {
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
sky::shell::Shell::Shared().tracing_controller().set_traces_base_path(
[paths.firstObject UTF8String]);
}
PlatformViewMac::~PlatformViewMac() = default;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册