It's always been confusing that:
- GURL treats large data: URLs as valid
- but they can't be sent over IPC
Chrome security had a discussion if there was any value to keeping the 2MB limit. The conclusion was that despite the inefficiencies of large data URLs, it would be better to have no limit (in most places). The limit was originally introduced to prevent pages from OOMing the browser process [1], but we could still keep that by enforcing a max URL size for navigations.
Another alternative is to ensure that data: URLs are only handled inside the same process and don't need to be sent across IPC, but I'm not sure how feasible implementing that would be: CCing kinuko@ who had previously mentioned this.
Note: previously, I also explored making data: URLs larger than 2 MB canonicalize as invalid URLs. This broke a lot of random things [2], so unfortunately, this is not a direction we can pursue.
Daniel