Set Ready For Review
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
content::BackgroundColorChangeWaiter waiter(web_contents);John PowersWhile this works, ideally, we would do it by:
1. Creating a new `content::BackgroundColorChangeWaiter` overload that also takes in a `expected_color` parameter.
2. If the `expected_color` matches the current web contents' background color, the waiter exits early.
3. Else the waiter waits for the background color to match the expected color does its thing till the background color changes.Can we implement that instead? That seems like a more holistic fix instead of guarding it by conditionals here. Wdyt?
I think that's a great proposal! I went ahead and made the changes, please let me know if you have any edits! Thanks for the review!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
explicit BackgroundColorChangeWaiter(content::WebContents* web_contents);nit: We could have one ctor instead of 2 here, and have the input be an `optional` value that is default initialized, like:
```
BackgroundColorChangeWaiter(content::WebContents* web_contents, std::optional<SkColor> expected_background_color = std::nullopt);
```
The default initialization prevents having to update all the callsites. Imo this impl is a little bit simpler, but the current one is fine too. Will defer to you if you want to change or keep it this way 😊.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Dibyajyoti PalThanks for finding the race condition here, proposed an alternate solution.
LGTM, thanks for the quick fix!
| Auto-Submit | +1 |
| Commit-Queue | +2 |
explicit BackgroundColorChangeWaiter(content::WebContents* web_contents);nit: We could have one ctor instead of 2 here, and have the input be an `optional` value that is default initialized, like:
```
BackgroundColorChangeWaiter(content::WebContents* web_contents, std::optional<SkColor> expected_background_color = std::nullopt);
```The default initialization prevents having to update all the callsites. Imo this impl is a little bit simpler, but the current one is fine too. Will defer to you if you want to change or keep it this way 😊.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
LGTM, can we also assign to some of the content/ folks for review?
explicit BackgroundColorChangeWaiter(We probably also do not need the `explicit` keyword here, as per [1].
[1] https://google.github.io/styleguide/cppguide.html#Implicit_Conversions
explicit BackgroundColorChangeWaiter(content::WebContents* web_contents);John Powersnit: We could have one ctor instead of 2 here, and have the input be an `optional` value that is default initialized, like:
```
BackgroundColorChangeWaiter(content::WebContents* web_contents, std::optional<SkColor> expected_background_color = std::nullopt);
```The default initialization prevents having to update all the callsites. Imo this impl is a little bit simpler, but the current one is fine too. Will defer to you if you want to change or keep it this way 😊.
Fixed! Thanks for the feedback!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Hi there! Could I please get a review over the content/ area, if not can you please reassign to someone who could? Thanks!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
| Commit-Queue | +1 |
We probably also do not need the `explicit` keyword here, as per [1].
[1] https://google.github.io/styleguide/cppguide.html#Implicit_Conversions
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
explicit BackgroundColorChangeWaiter(John PowersWe probably also do not need the `explicit` keyword here, as per [1].
[1] https://google.github.io/styleguide/cppguide.html#Implicit_Conversions
fixed!
Why not? This is a constructor that can be called with a single argument, so per that linked style guide should have the explicit keyword?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
| Commit-Queue | +1 |
explicit BackgroundColorChangeWaiter(John PowersWe probably also do not need the `explicit` keyword here, as per [1].
[1] https://google.github.io/styleguide/cppguide.html#Implicit_Conversions
Marijn Kruisselbrinkfixed!
Why not? This is a constructor that can be called with a single argument, so per that linked style guide should have the explicit keyword?
Looking again, I actually agree that it should stay explicit based on what Marijn said- Dibya if you feel differently please feel free to reopen this 😊
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
explicit BackgroundColorChangeWaiter(John PowersWe probably also do not need the `explicit` keyword here, as per [1].
[1] https://google.github.io/styleguide/cppguide.html#Implicit_Conversions
Marijn Kruisselbrinkfixed!
John PowersWhy not? This is a constructor that can be called with a single argument, so per that linked style guide should have the explicit keyword?
Looking again, I actually agree that it should stay explicit based on what Marijn said- Dibya if you feel differently please feel free to reopen this 😊
Oh yes, missed that. This is fine!
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |