2. What’s the Onion Soup?
● Started from Nov. 2015
● Motivation
○ After Blink was forked from WebKit, many of the old layers of abstraction didn’t make sense
and unnecessary in Blink
● Goal
○ “Simplify the codebase, empower developers to implement features that run faster, and
remove hurdles for developers interfacing with the rest of the Chromium codebase”
● Plan
○ Replace legacy IPC
○ Move features from //content/renderer to Blink
○ Remove public/web in Blink
2
[1]
3. Simple example of Onion Soup (1/2)
● DateTimeChooser OnionSoup
Browser Process
ExternalDateTimeChooser
RendererDateTimePicker
WebContentsImpl
DateTimeChooserAndroid
Java_DateTimeChooserAndroid
ChromeClientImpl
ChooserOnlyTemporalInputTypeView
DateTimeChooserAndroid
Renderer Process
ExternalDateTimeChooser
Onion
Souping
Java_DateTimeChooserAndroid
ChromeClientImplRenderViewImpl
IPC Mojo
: blink
: content/browser
: android java
ChooserOnlyTemporalInputTypeView
: content/renderer
3
4. Simple example of Onion Soup (2/2)
IPC_STRUCT_TRAITS_BEGIN(content::DateTimeSuggestion)
IPC_STRUCT_TRAITS_MEMBER(value)
IPC_STRUCT_TRAITS_MEMBER(localized_value)
IPC_STRUCT_TRAITS_MEMBER(label)
IPC_STRUCT_TRAITS_END()
IPC_STRUCT_BEGIN(ViewHostMsg_DateTimeDialogValue_Params)
IPC_STRUCT_MEMBER(ui::TextInputType, dialog_type)
IPC_STRUCT_MEMBER(double, dialog_value)
IPC_STRUCT_MEMBER(double, minimum)
IPC_STRUCT_MEMBER(double, maximum)
IPC_STRUCT_MEMBER(double, step)
IPC_STRUCT_MEMBER(std::vector<content::DateTimeSuggestion>, suggestions)
IPC_STRUCT_END()
IPC_MESSAGE_ROUTED1(ViewHostMsg_OpenDateTimeDialog,
ViewHostMsg_DateTimeDialogValue_Params /* value */)
struct DateTimeSuggestion {
// The date/time value represented as a double.
double value;
// The localized value to be shown to the user.
mojo_base.mojom.String16 localized_value;
// The label for the suggestion.
mojo_base.mojom.String16 label;
};
struct DateTimeDialogValue {
ui.mojom.TextInputType dialog_type;
double dialog_value;
double minimum;
double maximum;
double step;
array<DateTimeSuggestion> suggestions;
};
interface DateTimePicker {
OpenDateTimeDialog(DateTimeDialogValue value) =>
(bool success, double dialog_value);
};
● DateTimeChooser OnionSoup
IPC for DateTimeChooser
Mojo for DateTimeChooser
4
5. Progress
● Igalia started to participate in the Onion Soup since February 2019
● Progress (13th August 2019)[2]
○ Deprecating Blink Public API
■ Remove when Blink public API is unused or it’s only used by Blink
■ Onion Soup when it’s used only by a couple of call sites in //content
● MediaStream, MediaRecorder, Autofill, ImageDownloader, InstalledApp,
DateTimeChooser, PushMessaging, WebRTC, P2P, PeerConnection, and so on.
■ Progress tracker
● https://docs.google.com/spreadsheets/d/1TBzERV4BAd9peJJrxvrVn1tZb-WrPb7iMFiRUqJ6crE/edit#gid=
0
○ Replace legacy IPCs with Mojo: 93% Done
○ Migrate the features to Blink: 87% Done
○ The initial vision of Onion Soup was done mostly!
5
6. Onion Soup 2.0 [3]
● Goal
○ Massively simplify the interactions between Chromium layer and Blink layer and
reduce the technical debt further
● Plan
○ Finish Onion Soup 1.0
○ Switch Mojo to new syntax
○ Convert legacy IPC in //content/ to Mojo
○ Slim down Blink public APIs
○ Remove the {platform,core,modules}/exported layers
○ Remove Blink mojom types (mojom::blink::X)
● Igalia will keep working on Onion Soup 2.0!
6
8. Reference
1. Onion Soup 1.0
a. https://docs.google.com/document/d/13XsbaBz7A2H0PZIdFcytHf5-fVOlAfkLlIUKhxKzs44/edit#heading=h.ubda816cpe2
m
2. Onion Soup status (87% done!)
a. https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/okYy3y9q-6Q/JW022t7CDwAJ
3. Onion Soup 2.0
a. https://docs.google.com/document/d/1lzGeXN4nwnANdFSpVxmJ1TUgb3QBPFCjVxLsFVBlKdE/edit#heading=h.hwvk7r
wdbn2y
8