SlideShare ist ein Scribd-Unternehmen logo
1 von 36
Downloaden Sie, um offline zu lesen
STEALING CHROMIUM: EMBEDDING HTML5 
WITH THE SERVO BROWSER ENGINE 
Lars Bergstrom 
Mozilla Research 
Mike Blumenkrantz 
Samsung R&D America
Why a new web engine? 
• Support new types of applications and new 
devices 
• All modern browser engines (Safari, Firefox, 
Chrome) originally designed pre-2000 
• Coarse parallelism 
• Tightly coupled components 
• Vast majority of security issues are related to the 
C++ memory model
Servo 
•Written in a memory-safe 
systems language, Rust 
• Architected for 
parallelism 
• Coarse (per-tab), as in 
Chrome 
• Lightweight (intra-page), 
too 
• Designed for embedding
Rust - safe systems programming 
• C++ syntax and idioms 
• C++-like performance 
•Memory safety 
• Concurrency 
• Parallelism 
http://www.rust-lang.org
Familiar syntax and performance
Memory safety without overhead 
• Lifetimes and ownership ensure memory safety 
•No garbage collection 
•No reference counting 
•No C++ “smart” pointer classes
Example of code you can’t write
How a browser works 
HTML 
CSS 
JS 
Script & 
Interactions 
DOM Flow 
Tree 
Display 
Lists 
Script 
Layout Render 
Parsing 
More details: http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/
How a browser works 
HTML 
CSS 
JS 
Script & 
Interactions 
DOM Flow 
Tree 
Display 
Lists 
Script 
Layout Render 
Parsing 
This works: 
<html> 
<script> 
document.write 
(“</script> 
<li>foo</li> 
</html> 
More details: http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/
Timing breakdown 
Task Percentage 
Runtime libraries 25% 
Layout 22% 
Windowing 17% 
Script 16% 
Painting to screen 10% 
CSS styling 4% 
Other 6% 
Data from A Case for Parallelizing Web Pages. Mai, Tang, et. al. HOTPAR ‘12
Websites already partitioned
Servo’s architecture 
Constellation 
Pipeline 1 (iframe 1) 
Renderer 
Script Layout 
Tab 1
Servo’s architecture 
Tab 1 
Constellation 
Pipeline 1 (iframe 1) 
Renderer 
Script Layout 
Pipeline 2 (iframe 2) 
Renderer 
Script Layout
Servo’s architecture 
Tab 1 
Constellation 
Pipeline 1 (iframe 1) 
Renderer 
Script Layout 
Pipeline 2 (iframe 2) 
Renderer 
Script Layout 
Pipeline 3 (iframe 3) 
Renderer 
Script Layout
Demo: parallelism and sandboxing
Parallel layout 
•Matters hugely on mobile platforms 
• Processors run at lower frequencies, but many 
cores 
•Would enable more complicated pages on all 
platforms 
• Implemented by work-stealing algorithm 
See: Fast and Parallel Webpage Layout. Meyerovich and Bodik. WWW 2010.
Parallel layout 
body 
div div div 
text bold text text
Parallel layout 
body 
div div div 
text bold text text 
Queue 
div 
div 
div
Parallel layout challenges 
•HTML layout has complex dependencies 
• Inline element positioning 
• Floating elements 
• Vertical text 
• Pagination 
• Considering adding speculation
Layout: parallel speedups 
Time (ms) 
700 
525 
350 
175 
0 
High CPU Frequency Low CPU Frequency 
1 2 3 4 5 6 7 8 
Number of Threads
Total time with parallel layout 
Time (s) 
3.6 
2.7 
1.8 
0.9 
0 
High CPU Frequency Low CPU Frequency 
1 2 3 4 5 6 7 8 
Number of Threads
Total power with parallel layout 
Power (J) 
120 
90 
60 
30 
0 
High CPU Frequency Low CPU Frequency 
1 2 3 4 5 6 7 8 
Number of Threads 
Measurements by Laleh Beni, intern from University of California Irvine
Punchline: parallelism for power, too 
• Force low-frequency CPU setting 
• Above four cores, same end-to-end performance 
as single core at high-frequency 
• BUT, 40% of the power usage 
• Could also parallelize more 
• Rendering, CSS selector matching, etc.
From engine to browser 
• Servo just renders pages 
• Similar to the Blink and Gecko engines 
• Designed to work in many browser shells 
• Firefox OS, over interprocess communication 
(IPC) 
• Android, by implementing a Java wrapper 
•On the desktop with…
What is embedding? 
•Hosting web engine in native application
Why embed? 
• Reduced development 
time 
•HTML5 popularity
How not to embed 
•WebKit 
• Blink 
• Both suffer from an unstable API 
• Application developer choices: 
• Ship full browser engine with application 
• Continually update to match breakages
How to embed? 
• CEF: Chromium Embedded Framework 
• Isolates application developers from core API 
• C API with C++ extensions
Servo embedding strategy 
• Stable API/ABI 
• Extensive API testing is a plus 
• C-based 
• Flexible 
• Already designed
How to embed with Servo? 
• Use CEF API+ABI 
• Removes need for YA embedding API 
• Less competition, more coding 
• Allows easy testing between engines 
• Servo: the pragmatic embedding engine
Servo embedding methodology 
• Full symbol/ABI coverage 
• Every CEF function call resolves to a Servo function 
• Struct allocation sizes are identical 
typedef struct _cef_string_utf8_t { 
char* str; 
size_t length; 
void (*dtor)(char* str); 
} cef_string_utf8_t; 
!!!!! 
C 
pub struct cef_string_utf8 { 
pub str: *mut u8, 
pub length: size_t, 
pub dtor: extern “C” fn(str: *mut u8), 
} 
!!!!! 
Rust
Servo embedding development 
• Start with base set of symbols 
• `nm -u` on CEF applications 
• Track function execution 
• CEF <-> Blink <-> Application <-> CEF … 
•Mimic CEF behavior using Servo equivalents 
• Use preload hacks to test 
• LD_PRELOAD on Linux
Servo status 
• Pass some tests 
• ACID1, ACID2 
• Render basic web pages 
•Wikipedia, etc. 
• Focus on design + 
challenges 
• Parallelism, latency, 
power, memory
Servo roadmap 
• https://github.com/servo/servo/wiki/Roadmap 
• Q3 2014 
•Writing modes (vertical text) 
•DOM memory usage, perf, and features 
•Web Platform Tests & CSS Ref Tests 
• Q4 2014 
• Very basic dogfooding
Getting involved with Servo 
•www.github.com/servo/ 
servo/issues 
• Filter for “E-Easy” 
• irc.mozilla.org, #servo 
channel 
•Worldwide community 
• Looking for more 
partners and contributors 
• larsberg@mozilla.com

Weitere ähnliche Inhalte

Was ist angesagt?

Azure Templates for Consistent Deployment
Azure Templates for Consistent DeploymentAzure Templates for Consistent Deployment
Azure Templates for Consistent DeploymentJosé Maia
 
.NET no Browser - Webassembly com Blazor!
.NET no Browser - Webassembly com Blazor!.NET no Browser - Webassembly com Blazor!
.NET no Browser - Webassembly com Blazor!Rodrigo Kono
 
The Need For Speed - NxtGen Cambridge
The Need For Speed - NxtGen CambridgeThe Need For Speed - NxtGen Cambridge
The Need For Speed - NxtGen CambridgePhil Pursglove
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Henry S
 
CBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusionCBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusionOrtus Solutions, Corp
 
Phoenix and the Plug-life
Phoenix and the Plug-lifePhoenix and the Plug-life
Phoenix and the Plug-lifedevmyndmichael
 
The Python in the Apple
The Python in the AppleThe Python in the Apple
The Python in the ApplezeroSteiner
 
Merging two big Symfony based applications - SymfonyCon 2017
Merging two big Symfony based applications - SymfonyCon 2017Merging two big Symfony based applications - SymfonyCon 2017
Merging two big Symfony based applications - SymfonyCon 2017Ivo Lukac
 
RESTFul Tools For Lazy Experts - CFSummit 2016
RESTFul Tools For Lazy Experts - CFSummit 2016RESTFul Tools For Lazy Experts - CFSummit 2016
RESTFul Tools For Lazy Experts - CFSummit 2016Ortus Solutions, Corp
 
Advanced Server Integration with Data and Direct
Advanced Server Integration with Data and DirectAdvanced Server Integration with Data and Direct
Advanced Server Integration with Data and DirectSencha
 
Introdcution to Adobe CQ
Introdcution to Adobe CQIntrodcution to Adobe CQ
Introdcution to Adobe CQRest West
 
PHP7.1 New Features & Performance
PHP7.1 New Features & PerformancePHP7.1 New Features & Performance
PHP7.1 New Features & PerformanceXinchen Hui
 
The WordPress Way: Accessibility and Backwards Compatibility
The WordPress Way: Accessibility and Backwards CompatibilityThe WordPress Way: Accessibility and Backwards Compatibility
The WordPress Way: Accessibility and Backwards CompatibilityJoseph Dolson
 
Velocity - NxtGen Oxford
Velocity - NxtGen OxfordVelocity - NxtGen Oxford
Velocity - NxtGen OxfordPhil Pursglove
 
Implementing portlets using Web Scripts
Implementing portlets using Web ScriptsImplementing portlets using Web Scripts
Implementing portlets using Web ScriptsPiergiorgio Lucidi
 

Was ist angesagt? (20)

Azure Templates for Consistent Deployment
Azure Templates for Consistent DeploymentAzure Templates for Consistent Deployment
Azure Templates for Consistent Deployment
 
.NET no Browser - Webassembly com Blazor!
.NET no Browser - Webassembly com Blazor!.NET no Browser - Webassembly com Blazor!
.NET no Browser - Webassembly com Blazor!
 
The Need For Speed - NxtGen Cambridge
The Need For Speed - NxtGen CambridgeThe Need For Speed - NxtGen Cambridge
The Need For Speed - NxtGen Cambridge
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
 
CBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusionCBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusion
 
Node.js
Node.jsNode.js
Node.js
 
From Web to Mobile with Stage 3D
From Web to Mobile with Stage 3DFrom Web to Mobile with Stage 3D
From Web to Mobile with Stage 3D
 
Phoenix and the Plug-life
Phoenix and the Plug-lifePhoenix and the Plug-life
Phoenix and the Plug-life
 
The Python in the Apple
The Python in the AppleThe Python in the Apple
The Python in the Apple
 
Ruby Setup
Ruby SetupRuby Setup
Ruby Setup
 
Merging two big Symfony based applications - SymfonyCon 2017
Merging two big Symfony based applications - SymfonyCon 2017Merging two big Symfony based applications - SymfonyCon 2017
Merging two big Symfony based applications - SymfonyCon 2017
 
RESTFul Tools For Lazy Experts - CFSummit 2016
RESTFul Tools For Lazy Experts - CFSummit 2016RESTFul Tools For Lazy Experts - CFSummit 2016
RESTFul Tools For Lazy Experts - CFSummit 2016
 
Advanced Server Integration with Data and Direct
Advanced Server Integration with Data and DirectAdvanced Server Integration with Data and Direct
Advanced Server Integration with Data and Direct
 
Introdcution to Adobe CQ
Introdcution to Adobe CQIntrodcution to Adobe CQ
Introdcution to Adobe CQ
 
PHP7.1 New Features & Performance
PHP7.1 New Features & PerformancePHP7.1 New Features & Performance
PHP7.1 New Features & Performance
 
Velocity - Edge UG
Velocity - Edge UGVelocity - Edge UG
Velocity - Edge UG
 
The WordPress Way: Accessibility and Backwards Compatibility
The WordPress Way: Accessibility and Backwards CompatibilityThe WordPress Way: Accessibility and Backwards Compatibility
The WordPress Way: Accessibility and Backwards Compatibility
 
Selenium
SeleniumSelenium
Selenium
 
Velocity - NxtGen Oxford
Velocity - NxtGen OxfordVelocity - NxtGen Oxford
Velocity - NxtGen Oxford
 
Implementing portlets using Web Scripts
Implementing portlets using Web ScriptsImplementing portlets using Web Scripts
Implementing portlets using Web Scripts
 

Ähnlich wie Stealing Chromium: Embedding HTML5 with the Servo Browser Engine (LinuxCon NA 2014)

Web Assembly Big Picture
Web Assembly Big PictureWeb Assembly Big Picture
Web Assembly Big PictureYousif Shalaby
 
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5David Voyles
 
What's New in .Net 4.5
What's New in .Net 4.5What's New in .Net 4.5
What's New in .Net 4.5Malam Team
 
Asp.net and .Net Framework ppt presentation
Asp.net and .Net Framework ppt presentationAsp.net and .Net Framework ppt presentation
Asp.net and .Net Framework ppt presentationabhishek singh
 
Meanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore ChandraMeanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore ChandraKishore Chandra
 
.Net overviewrajnish
.Net overviewrajnish.Net overviewrajnish
.Net overviewrajnishRajnish Kalla
 
T4T Training day - NodeJS
T4T Training day - NodeJST4T Training day - NodeJS
T4T Training day - NodeJSTim Sommer
 
AMF Flash and .NET
AMF Flash and .NETAMF Flash and .NET
AMF Flash and .NETYaniv Uriel
 
Ci of js and apex using jasmine, phantom js and drone io df14
Ci of js and apex using jasmine, phantom js and drone io   df14Ci of js and apex using jasmine, phantom js and drone io   df14
Ci of js and apex using jasmine, phantom js and drone io df14Kevin Poorman
 
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularEscaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularMark Leusink
 
MICROSOFT BLAZOR - NEXT GENERATION WEB UI OR SILVERLIGHT ALL OVER AGAIN?
MICROSOFT BLAZOR - NEXT GENERATION WEB UI OR SILVERLIGHT ALL OVER AGAIN?MICROSOFT BLAZOR - NEXT GENERATION WEB UI OR SILVERLIGHT ALL OVER AGAIN?
MICROSOFT BLAZOR - NEXT GENERATION WEB UI OR SILVERLIGHT ALL OVER AGAIN?Clint Edmonson
 
What is Mean Stack Development ?
What is Mean Stack Development ?What is Mean Stack Development ?
What is Mean Stack Development ?Balajihope
 

Ähnlich wie Stealing Chromium: Embedding HTML5 with the Servo Browser Engine (LinuxCon NA 2014) (20)

Web Assembly Big Picture
Web Assembly Big PictureWeb Assembly Big Picture
Web Assembly Big Picture
 
Beginners Node.js
Beginners Node.jsBeginners Node.js
Beginners Node.js
 
Top 10 web application development frameworks 2016
Top 10 web application development frameworks 2016Top 10 web application development frameworks 2016
Top 10 web application development frameworks 2016
 
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
 
What's New in .Net 4.5
What's New in .Net 4.5What's New in .Net 4.5
What's New in .Net 4.5
 
Asp.net and .Net Framework ppt presentation
Asp.net and .Net Framework ppt presentationAsp.net and .Net Framework ppt presentation
Asp.net and .Net Framework ppt presentation
 
MEAN Stack
MEAN StackMEAN Stack
MEAN Stack
 
MEAN Stack
MEAN StackMEAN Stack
MEAN Stack
 
Meanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore ChandraMeanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore Chandra
 
.Net overviewrajnish
.Net overviewrajnish.Net overviewrajnish
.Net overviewrajnish
 
T4T Training day - NodeJS
T4T Training day - NodeJST4T Training day - NodeJS
T4T Training day - NodeJS
 
AMF Flash and .NET
AMF Flash and .NETAMF Flash and .NET
AMF Flash and .NET
 
Ci of js and apex using jasmine, phantom js and drone io df14
Ci of js and apex using jasmine, phantom js and drone io   df14Ci of js and apex using jasmine, phantom js and drone io   df14
Ci of js and apex using jasmine, phantom js and drone io df14
 
Apache Drill (ver. 0.2)
Apache Drill (ver. 0.2)Apache Drill (ver. 0.2)
Apache Drill (ver. 0.2)
 
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularEscaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
 
MICROSOFT BLAZOR - NEXT GENERATION WEB UI OR SILVERLIGHT ALL OVER AGAIN?
MICROSOFT BLAZOR - NEXT GENERATION WEB UI OR SILVERLIGHT ALL OVER AGAIN?MICROSOFT BLAZOR - NEXT GENERATION WEB UI OR SILVERLIGHT ALL OVER AGAIN?
MICROSOFT BLAZOR - NEXT GENERATION WEB UI OR SILVERLIGHT ALL OVER AGAIN?
 
Blazor.pptx
Blazor.pptxBlazor.pptx
Blazor.pptx
 
What is Mean Stack Development ?
What is Mean Stack Development ?What is Mean Stack Development ?
What is Mean Stack Development ?
 
ASP.NET
ASP.NETASP.NET
ASP.NET
 
Net framework
Net frameworkNet framework
Net framework
 

Mehr von Samsung Open Source Group

The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)Samsung Open Source Group
 
Rapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USBRapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USBSamsung Open Source Group
 
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesTizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesSamsung Open Source Group
 
IoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and BeyondIoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and BeyondSamsung Open Source Group
 
IoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialIoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialSamsung Open Source Group
 
Open Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate StrategyOpen Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate StrategySamsung Open Source Group
 
IoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilityIoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilitySamsung Open Source Group
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...Samsung Open Source Group
 
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux DeviceAdding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux DeviceSamsung Open Source Group
 
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivityIoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivitySamsung Open Source Group
 
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under LinuxPractical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under LinuxSamsung Open Source Group
 
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxIoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxSamsung Open Source Group
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of ThingsJerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of ThingsSamsung Open Source Group
 

Mehr von Samsung Open Source Group (20)

The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)
 
Easy IoT with JavaScript
Easy IoT with JavaScriptEasy IoT with JavaScript
Easy IoT with JavaScript
 
Spawny: A New Approach to Logins
Spawny: A New Approach to LoginsSpawny: A New Approach to Logins
Spawny: A New Approach to Logins
 
Rapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USBRapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USB
 
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesTizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
 
IoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and BeyondIoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and Beyond
 
IoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialIoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorial
 
GENIVI + OCF Cooperation
GENIVI + OCF CooperationGENIVI + OCF Cooperation
GENIVI + OCF Cooperation
 
Framework for IoT Interoperability
Framework for IoT InteroperabilityFramework for IoT Interoperability
Framework for IoT Interoperability
 
Open Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate StrategyOpen Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate Strategy
 
IoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilityIoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT Interoperability
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
 
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux DeviceAdding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
 
IoTivity: From Devices to the Cloud
IoTivity: From Devices to the CloudIoTivity: From Devices to the Cloud
IoTivity: From Devices to the Cloud
 
SOSCON 2016 JerryScript
SOSCON 2016 JerryScriptSOSCON 2016 JerryScript
SOSCON 2016 JerryScript
 
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivityIoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
 
Run Your Own 6LoWPAN Based IoT Network
Run Your Own 6LoWPAN Based IoT NetworkRun Your Own 6LoWPAN Based IoT Network
Run Your Own 6LoWPAN Based IoT Network
 
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under LinuxPractical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
 
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxIoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of ThingsJerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
 

Kürzlich hochgeladen

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Kürzlich hochgeladen (20)

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Stealing Chromium: Embedding HTML5 with the Servo Browser Engine (LinuxCon NA 2014)

  • 1. STEALING CHROMIUM: EMBEDDING HTML5 WITH THE SERVO BROWSER ENGINE Lars Bergstrom Mozilla Research Mike Blumenkrantz Samsung R&D America
  • 2. Why a new web engine? • Support new types of applications and new devices • All modern browser engines (Safari, Firefox, Chrome) originally designed pre-2000 • Coarse parallelism • Tightly coupled components • Vast majority of security issues are related to the C++ memory model
  • 3. Servo •Written in a memory-safe systems language, Rust • Architected for parallelism • Coarse (per-tab), as in Chrome • Lightweight (intra-page), too • Designed for embedding
  • 4. Rust - safe systems programming • C++ syntax and idioms • C++-like performance •Memory safety • Concurrency • Parallelism http://www.rust-lang.org
  • 5. Familiar syntax and performance
  • 6. Memory safety without overhead • Lifetimes and ownership ensure memory safety •No garbage collection •No reference counting •No C++ “smart” pointer classes
  • 7. Example of code you can’t write
  • 8. How a browser works HTML CSS JS Script & Interactions DOM Flow Tree Display Lists Script Layout Render Parsing More details: http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/
  • 9. How a browser works HTML CSS JS Script & Interactions DOM Flow Tree Display Lists Script Layout Render Parsing This works: <html> <script> document.write (“</script> <li>foo</li> </html> More details: http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/
  • 10. Timing breakdown Task Percentage Runtime libraries 25% Layout 22% Windowing 17% Script 16% Painting to screen 10% CSS styling 4% Other 6% Data from A Case for Parallelizing Web Pages. Mai, Tang, et. al. HOTPAR ‘12
  • 11.
  • 13. Servo’s architecture Constellation Pipeline 1 (iframe 1) Renderer Script Layout Tab 1
  • 14. Servo’s architecture Tab 1 Constellation Pipeline 1 (iframe 1) Renderer Script Layout Pipeline 2 (iframe 2) Renderer Script Layout
  • 15. Servo’s architecture Tab 1 Constellation Pipeline 1 (iframe 1) Renderer Script Layout Pipeline 2 (iframe 2) Renderer Script Layout Pipeline 3 (iframe 3) Renderer Script Layout
  • 16. Demo: parallelism and sandboxing
  • 17. Parallel layout •Matters hugely on mobile platforms • Processors run at lower frequencies, but many cores •Would enable more complicated pages on all platforms • Implemented by work-stealing algorithm See: Fast and Parallel Webpage Layout. Meyerovich and Bodik. WWW 2010.
  • 18. Parallel layout body div div div text bold text text
  • 19. Parallel layout body div div div text bold text text Queue div div div
  • 20. Parallel layout challenges •HTML layout has complex dependencies • Inline element positioning • Floating elements • Vertical text • Pagination • Considering adding speculation
  • 21. Layout: parallel speedups Time (ms) 700 525 350 175 0 High CPU Frequency Low CPU Frequency 1 2 3 4 5 6 7 8 Number of Threads
  • 22. Total time with parallel layout Time (s) 3.6 2.7 1.8 0.9 0 High CPU Frequency Low CPU Frequency 1 2 3 4 5 6 7 8 Number of Threads
  • 23. Total power with parallel layout Power (J) 120 90 60 30 0 High CPU Frequency Low CPU Frequency 1 2 3 4 5 6 7 8 Number of Threads Measurements by Laleh Beni, intern from University of California Irvine
  • 24. Punchline: parallelism for power, too • Force low-frequency CPU setting • Above four cores, same end-to-end performance as single core at high-frequency • BUT, 40% of the power usage • Could also parallelize more • Rendering, CSS selector matching, etc.
  • 25. From engine to browser • Servo just renders pages • Similar to the Blink and Gecko engines • Designed to work in many browser shells • Firefox OS, over interprocess communication (IPC) • Android, by implementing a Java wrapper •On the desktop with…
  • 26. What is embedding? •Hosting web engine in native application
  • 27. Why embed? • Reduced development time •HTML5 popularity
  • 28. How not to embed •WebKit • Blink • Both suffer from an unstable API • Application developer choices: • Ship full browser engine with application • Continually update to match breakages
  • 29. How to embed? • CEF: Chromium Embedded Framework • Isolates application developers from core API • C API with C++ extensions
  • 30. Servo embedding strategy • Stable API/ABI • Extensive API testing is a plus • C-based • Flexible • Already designed
  • 31. How to embed with Servo? • Use CEF API+ABI • Removes need for YA embedding API • Less competition, more coding • Allows easy testing between engines • Servo: the pragmatic embedding engine
  • 32. Servo embedding methodology • Full symbol/ABI coverage • Every CEF function call resolves to a Servo function • Struct allocation sizes are identical typedef struct _cef_string_utf8_t { char* str; size_t length; void (*dtor)(char* str); } cef_string_utf8_t; !!!!! C pub struct cef_string_utf8 { pub str: *mut u8, pub length: size_t, pub dtor: extern “C” fn(str: *mut u8), } !!!!! Rust
  • 33. Servo embedding development • Start with base set of symbols • `nm -u` on CEF applications • Track function execution • CEF <-> Blink <-> Application <-> CEF … •Mimic CEF behavior using Servo equivalents • Use preload hacks to test • LD_PRELOAD on Linux
  • 34. Servo status • Pass some tests • ACID1, ACID2 • Render basic web pages •Wikipedia, etc. • Focus on design + challenges • Parallelism, latency, power, memory
  • 35. Servo roadmap • https://github.com/servo/servo/wiki/Roadmap • Q3 2014 •Writing modes (vertical text) •DOM memory usage, perf, and features •Web Platform Tests & CSS Ref Tests • Q4 2014 • Very basic dogfooding
  • 36. Getting involved with Servo •www.github.com/servo/ servo/issues • Filter for “E-Easy” • irc.mozilla.org, #servo channel •Worldwide community • Looking for more partners and contributors • larsberg@mozilla.com