-
Notifications
You must be signed in to change notification settings - Fork 6k
Fix crash about 'SkiaUnrefQueue::Drain' is called after 'IOManager' reset #32106
Changes from all commits
f2c763b
50e7cb0
4dcd599
4a2ea80
44be8cd
ace9be6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,7 +27,9 @@ class ShellIOManager final : public IOManager { | |
| ShellIOManager( | ||
| sk_sp<GrDirectContext> resource_context, | ||
| std::shared_ptr<const fml::SyncSwitch> is_gpu_disabled_sync_switch, | ||
| fml::RefPtr<fml::TaskRunner> unref_queue_task_runner); | ||
| fml::RefPtr<fml::TaskRunner> unref_queue_task_runner, | ||
| fml::TimeDelta unref_queue_drain_delay = | ||
| fml::TimeDelta::FromMilliseconds(8)); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ColdPaleLight I'm wondering whether number
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I guess you can find the answer in the PR #9486. My commit did not change the value of delay, it just moved it to another place. |
||
|
|
||
| ~ShellIOManager() override; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove these back to their own implementation file?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a test
TEST_F(SkiaGpuObjectTest, UnrefResourceContextInTaskRunnerThread)in this commit 44be8cd to make sure the context is released in the io thread, but in order to write this test , I had to changeUnrefQueueto a template class. So need to move all the code into the header file. I have no idea how to change my new test if the code is removed back.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe my lack of C++ knowledge is showing, but shouldn't we be able to define the template methods in the cpp file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the template is defined in the implementation file, the test file cannot included it, so the compiler cannot help us generate the class
UnrefQueue<TestResourceContext>, so the test code cannot be compiled.If we really need to hide the implementation, we can consider introducing a
skia_gpu_object_impl.hand put the implementation code in that file. WDYT?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can leave this as is in that case