| Bug 1623971 - P16: Add a method to set image to SMTC thumbnail
Authored by chunmin on Jun 2 2020, 7:12 PM. Referenced Files | Unknown Object (File) | | Tue, May 26, 4:55 AM2026-05-26 04:55:48 (UTC+0) |
| Unknown Object (File) | | May 16 2026, 6:21 PM2026-05-16 18:21:37 (UTC+0) |
| Unknown Object (File) | | Apr 26 2026, 12:26 AM2026-04-26 00:26:08 (UTC+0) |
| Unknown Object (File) | | Apr 3 2026, 11:21 AM2026-04-03 11:21:13 (UTC+0) |
| Unknown Object (File) | | Mar 29 2026, 10:19 AM2026-03-29 10:19:22 (UTC+0) |
| Unknown Object (File) | | Mar 20 2026, 12:22 AM2026-03-20 00:22:07 (UTC+0) |
| Unknown Object (File) | | Mar 19 2026, 11:30 PM2026-03-19 23:30:18 (UTC+0) |
| Unknown Object (File) | | Mar 19 2026, 11:24 PM2026-03-19 23:24:44 (UTC+0) |
Summary Add a method to set an image to SMTC's thumbmail asynchronously Event Timelinealwu added inline comments. | widget/windows/WindowsSMTCProvider.cpp |
| 18 | I don't think test-only code should exist in this patch, especially considering they would all be removed in next patch. |
| 33 | We have done , so we are already able to access and other classes inside , right? |
| 39 | nit : Would we consider to use only instead? |
| 39 | nit : reorder those by alphabet order. |
| 65 | No need to do that, you can capture into the lambda which would allow you to use directly inside the lambda. |
| 200 | Why we load the thumbnail after calling ? And would you consider move into ? Because that seems a part of setting metadata. |
| 458 | |
| 471–472 | nit : we have done so we can use directly without having a scope name. |
| 475–476 | I wonder if we need to assert both and are not null, because they are not set in this function. Adding that assertion can ensure we always call in the expected situation. |
| 480 | capture then you are able to use . |
| 482 | |
| 502 | Don't mess the test-only code with the production code. If this method would only be complete when applying the change in next patch, then they should be merged together. Otherwise, you should consider using another way to separate them. |
| 510 | Would we modify ? If not, use . |
| 512 | Use following format in order to follow other checks in this function.
if (FAILED(hr)) {
LOG("XXXX");
return;
} |
| 515 | nit : would you consider to separate those comments and put them just above the line where the operation is going to be executed? |
| widget/windows/WindowsSMTCProvider.h |
| 96 | nit : to reduce redundant scope description, because this type has been used mutiple times. |
| widget/windows/WindowsSMTCProvider.cpp |
| 18 | The purpose of embedding the test-only stuff is to demonstrate that the needs the raw binary data of an image file, including its file header.
The test-only part in this patch could definitely be removed in this patch once the usage of is illustrated explicitly. |
| 33 | |
| 39 | |
| 200 |
- I guess one of the reason for having is to set . Thumbnail is not a property within so it shouldn't be there.
- will load the image asynchronously. The display interface will updated when upon image is loaded.
|
| 475–476 | would be created/reset in . I'll add an assertion to make sure would only be called after is executed.
On the other hand, would be created from inside so it would always be non-null. |
| 502 | The intention of whole test stuff is to make this clear: The needs the raw binary data of an image file, including its file header. |
| 512 | I'll add a log if it fails. |
| widget/windows/WindowsSMTCProvider.h |
| 96 | I'll move from .cpp to .h |
chunmin marked 15 inline comments as done. alwu added inline comments. | widget/windows/WindowsSMTCProvider.cpp |
| 501 | Because it would be done asynchrously, at the time this function run, is it possible that we've closed the ?
If so, we could add a check to abort following steps if is already closed.
Or, is it possible to tell that we want to cancel the callback? |
| widget/windows/WindowsSMTCProvider.h |
| 96 | nit : I would prefer only use in the file, which can prevent from polluting other files which include this file. So that is why I proposed to use , not to use namespace directly. |
Comment Actionshopefully straightforward issues to resolve.
please feel free to ping me when you update so that i can sign off
thanks! | widget/windows/WindowsSMTCProvider.cpp |
| 522 | it's unclear to me through code inspection that these two calls are threadsafe. but, just want to call out that these may end up being called on another thread and want to confirm that you thought about it. |
| widget/windows/WindowsSMTCProvider.h |
| 43 | same concern here-- it might be possible to addref/release in multiple threads. is this refcounting threadsafe? |
| widget/windows/WindowsSMTCProvider.cpp |
| 501 | |
| 522 | |
| widget/windows/WindowsSMTCProvider.h |
| 43 | I'll see if I can make it . |
Comment Actionsplease make sure alwu knows about changing the refcounting to be threadsafe | widget/windows/WindowsSMTCProvider.cpp |
| 501 | Ah, the image won't need to be cached. We need to disconnect the image fetching process if we have one.
If chrome's implementation is right, I guess it's ok to call in . |
chunmin marked 2 inline comments as done. This revision was automatically updated to reflect the committed changes. | Path | Size |
|---|
| | 28 lines | | 153 lines |
| Commit | Parents | Author | Summary | Date |
|---|
| 2b7c4c1293c8 | Chun-Min Chang | Bug 1623971 - P16: Add a method to set image to SMTC thumbnail r=alwu,thomasmo (Show More…) |
widget/windows/WindowsSMTCProvider.hwidget/windows/WindowsSMTCProvider.cpp |