Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File name index #3

Open
adryd325 opened this issue Jun 4, 2019 · 3 comments
Open

File name index #3

adryd325 opened this issue Jun 4, 2019 · 3 comments
Labels

Comments

@adryd325
Copy link

adryd325 commented Jun 4, 2019

Is there an index or a map that contains the file locations or file names within a built version of chromium? If so where would it be located and how would it be encoded?

I'm not nearly smart enough to sift through chromium's source, but, from what I found in i18n-grit, no such index is contained within the pak file itself. Right now I'm assuming the index is kept within an executable file or some other binary.

@myfreeer
Copy link
Owner

With a quick look into chrome/browser/browser_resources.grd#L4, it seems that the ID of each resource is generated on build-time, when headers defining the resource name, like IDR_FIRST_RUN_HTML, to whose generated ID, are also generated.
In sources like chrome/browser/ui/webui/conflicts/conflicts_ui.cc, generated headers are included, and resourced are used by name, compiled to numeric ID.

@adryd325
Copy link
Author

There has to be some sort of mappings, as within the compiled version of chrome, you're able to access chrome://resources/.

After some looking at grit-i18n there's a "resource_ids" file which references many "grd" files, I haven't looked much at the code, but I'm assuming these "grd" files contain some form of mappings from resource id to resource path, though I am unsure where these files are stored (I'm assuming they are somewhere within the "pak" file or compiled into an executable)

If I find anything else I'll add it to this issue.

@myfreeer
Copy link
Owner

As mentioned in docs/webui_in_components.md, web-ui accessible resources are handled specially by classes extending content::WebUIController.

Probably related: tools/grit/grit/format/resource_map.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants