

Simply Making Simple Fixes Simple for Chromium – text/plain
source link: https://textslashplain.com/2020/10/27/simply-making-simple-fixes-simple-for-chromium/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Simply Making Simple Fixes Simple for Chromium
Google recently introduced a cool web-based editing tool for Chromium source code, a very stripped down version of the Willy Wonka tooling Googlers get to use for non-Chromium projects.
I’ve used this tool to submit two trivial change lists (CLs, aka PRs) to Chromium, but I was curious about whether this new feature would work for something not completely trivial, and while remaining simpler than the full Checklist for contributing to Chromium.
Let’s try it.
First, find an Available GoodFirstBug. Say, this one to remove an expired flag. Let’s search for the flag. Not too many hits:
Let’s click into the first hit to open it. Click Edit Code at the top right:
A web-based code editor opens:
Remove the &kOverlayNewLayout
line and the function that references it later in the file. Use the navigation panel on the left to open the .h
file corresponding and remove the declaration of the feature.
Open about_flags.cc
and remove the lines referencing the flag:
Note that this will create orphan variables for the flag_descriptions
that we need to go delete too. Go delete those from the flag_descriptions.cc
and flag_descriptions.h
files.
At this point, your Pending Changes pane contains all of the files with all of the hits that came up in the search.
If we think we’re done, we can go hit the Create Change button to actually create the change for review.
However, suspiciously, we haven’t actually found anything that respects the Feature we removed. If we instead search for OverlayNewLayout
we see an additional hit appears:
Having worked on stuff like this before, I know that there’s some magical marshalling of feature values from C++ into Java-land (Android’s UI layer). So we need to go eliminate the use of the Java-side feature. Search for OVERLAY_NEW_LAYOUT
.
Oof. There are 8 more files: 7 are Java and one is a similarly-named variable in a CC file. (It’s a variable in C++ code that set based on the feature’s state from the Java-side based on a resource ID. Sneaky sneaky).
Worse, one of the early hits is this one:
… So we also need to remove this function entirely and update all of its callers to not check it. Fortunately, only two more files have references, but clearing up some of those implies that we might have resources that will become unused:
When we’re done pulling all the threads, the change has grown pretty big. Click Create change to put all of our changes together into a change list:
In the dialog that appears, enter a description of the changelist and click Create:
After a minute or so, a notice will appear:
Sadly, it’s not a hyperlink, but if you look down at the bottom of the editor, you’ll find a direct link to the Chromium Code Review site, where you can find the created change. After the CL is prepared, you can add reviewers for a code review, ask anyone with Try Permissions to run your change through the bots, and otherwise follow the process for contributing to Chromium.
If you need to modify a change after you’ve created a CL, you can do so using the Edit link on the Code Review Site. Push the button:
… then use the new commands down near the file list to modify (or add) files in the CL:
A few observations from this process:
1. A lot of Chromium GoodFirstBug
‘s are much more complicated than they appear. This one required a followup CL to remove 400 more lines!
2. This new web-editing workflow is great for trivial fixes, but very limited. Most importantly, if you need to use any advanced tools (e.g. source formatting, manual code generators, presubmit checks, etc), you’ll need to download your CL from the code review site to use the tools on it.
3. Multi-file changes are challenging. It would be awesome to be able to just click “Edit Code” from the Chrome Source Viewer on multiple files and have them all open in the same “in-progress” change set, but it doesn’t seem to work like that (yet?). You must manually find all files after the first one in the editor’s sidebar.
I’m excited to see how Chromium’s Edit Code feature evolves.
-Eric
Posted byericlaw2020-10-272021-05-20Posted inbrowsers, devTags:Chromium, dev
Published by ericlaw
Impatient optimist. Dad. Author/speaker. Created Fiddler & SlickRun. PM @ MSFT '01-'12, and '18-, presently working on Microsoft Edge. My words are my own. View more posts
Recommend
-
109
Transity - The Future of Plain Text Accounting :date: 2018-06-05 :man: Adrian Sieber TLDR:We found
-
40
Plain Text Reigns Supreme 14 September 2015 Now and then, I stumble over people lamenting that our programs are still restricted by plain text when other means would be better. As a reference for future d...
-
15
Encrypt plain text in EXE / RAM :: HxD editor advertisements HxD (hex editor) allows to search/view/edit RAM. How can I protect a EXE a...
-
10
The Art of Plain Text April 20th, 2015 As noted in RFC2223[1], many users read documents online and use various text oriented tools (e.g., emacs, grep) to search them. Often, brief excerpts [......
-
5
Is there a way to add a simple highlighting code to eclipse by simply giving a list of different keywords, bulk boot, etc.? advertisements I w...
-
9
Spooky: Enhancing Dark Mode in Chromium I am not really a fan of Dark Mode — I like my screens bright and shiny. But it’s October, and it’s sometimes fun to make things dark and spooky. Some users of my
-
3
til (58 Part Series) Since GitHub started supporting mermaid in their markdown I wanted to take another look at...
-
3
Chromium Internals: PAK Files Web browsers are made up of much more than the native code (mostly compiled C++) that makes up their .exe and .dll files. A significant porti...
-
11
-
5
Stop saying how simple things are in our docs If someone’s having to read your docs, it’s not “simple” JustSimply.dev by
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK