SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Downloaden Sie, um offline zu lesen
Chromium Plugin 
Pepper API & Native Client
Chang W. Doh 
<hi> </hi> 
GDG Korea WebTech Organizer 
HTML5Rocks/KO Contributor/Coordinator
What’s NaCl? 
● Open-source technology for running native 
compiled code in the browser 
○ With the goal of 
■ Maintaining the portability and safety 
○ Final goal 
■ Enabling developers to enhance their web 
applications using their preferred language.
What’s NaCl? 
● Currently available on 
○ Chrome for Windows, Mac, Linux, and Chrome OS 
■ x86 and ARM architectures
Why NaCl? 
● Native functionalities 
○ 2D/3D graphics, audio, input events, multi-threads, 
and access memory directly, ... 
● Portability 
PNaCl only! 
○ OS and CPU independent 
● Security 
○ Double sandbox model 
● Performance 
○ Run at speeds comparable to desktop applications 
(within 5-15% of native speed).
Why NaCl? 
● DEMO: Bastion
NaCl in a web app
NaCl 
● Toolchains 
○ Collections of development tools 
■ Compilers, linkers, etc. 
■ Transform C/C++ code to (P)NaCl modules. 
■ There’re 2 types of toolchain for each NaCl Type 
● Runtime components: 
○ Embedded in the browser or other host platforms 
○ Allow execution of NaCl modules
PNaCl & its Toolchain 
● Portable Native Client - a.k.a PNaCl 
○ With using the PNaCl toolchain to produce a single, 
portable (pexe) module. 
■ Translator built into the browser translates pexe into native code for the relevant client 
architecture at runtime
NaCl & its Toolchain 
● Native Client - a.k.a NaCl 
○ With using a nacl-gcc based toolchain to produce 
multiple architecture-dependent (nexe) modules 
○ nexe modules are packaged into an application. 
○ Browser decides which nexe to load based on architecture of the client machine at runtime from . 
nmf file 
● Only be used as part of app/extensions that 
are installed from the Chrome Web Store.
Sandbox model 
● Security measures have to be implemented: 
○ The NaCl sandbox ensures 
Pepper API 
■ Accessing system resources only through safe, 
whitelisted APIs 
■ Operates within its limits without attempting to 
interfere with other code running either within the 
browser or outside it. 
○ The NaCl validator 
■ Statically analyzes code prior to running it to 
make sure it only uses code and data patterns 
that are permitted and safe.
Sandbox model 
● Double sandbox design 
○ NaCl sandbox and Chrome sandbox 
■ Security measures are in addition to the existing 
sandbox in the Chrome browser 
○ the NaCl module always executes in a process with 
restricted permissions. 
■ The only interaction between this process and 
the outside world is through sanctioned 
browser interfaces.
Constraints of PNaCl 
● Not support architecture-specific instructions 
○ i.e., inline assembly. 
Currently trying alternatives such as 
PNaCl’s Portable SIMD Vectors. 
● Only supports static linking with the newlib C 
standard library 
○ Native Client SDK provides a PNaCl port of newlib 
○ Dynamic linking and glibc are not yet supported.
How NaCls work?: 
PNaCl & NaCl workflow 
LLVM 
Bitcode
How PNaCl works? 
Build time 
● pnacl- tools produce LLVM bc files 
○ The pnacl-ld linker tool produces a statically linked 
LLVM pexe. 
○ The pnacl-finalize tool converts an LLVM pexe to a 
frozen PNaCl bitcode pexe. 
○ Chrome only runs the frozen PNaCl bitcode format, 
not the standard LLVM bitcode pexe.
How PNaCl works? 
Build time 
● Compilation occurs in 2 steps 
(1) Intermediate product, an LLVM bitcode (Toolchain) 
(2) "Traditional" NaCl compilation workflow (Browser)
How PNaCl works? 
● While chrome can load, 
○ Translate a frozen pexe directly 
Runtime 
■ An additional tool pnacl-translate for generating 
native code from either LLVM or PNaCl bitcode. 
■ Useful for debugging
How PNaCl works? 
Runtime
Pepper API
Pepper API 
● Pepper Plugin API (PPAPI) 
○ Cross-platform API for Web Browser Plugin 
○ Allows C/C++ module in a safe and portable way to 
■ communicate with the hosting browser 
■ get access to system-level functions 
○ Simply, a host interface for NaCl module 
■ e.g. NaCl can’t make any OS-level calls directly 
● Instead, PPAPI provides analogous APIs that modules 
can target.
Misc. 
● About Pepper APIs 
○ PPAPI doesn’t support any feature that are out scope within JavaScript APIs, and will not support in 
the furture. 
● About (P)NaCl 
○ (P)NaCl doesn’t support creating JS API directly 
■ Use ‘postMessage()’ for communicating 
○ (P)NaCl is working in progress to support it on 
Mobile, maybe Android.
Process Diagram
How process interacts
Sample Code: 
hello_tutorial_module.cc 
#include <cstdio> 
#include <string> 
#include "ppapi/cpp/instance.h" 
#include "ppapi/cpp/module.h" 
#include "ppapi/cpp/var.h" 
class hello_tutorialInstance : public pp::Instance { 
public: 
explicit hello_tutorialInstance(PP_Instance instance) : pp::Instance(instance) 
{} 
virtual ~hello_tutorialInstance() {} 
virtual void HandleMessage(const pp::Var& var_message) { 
} 
};
Sample Code: 
hello_tutorial_module.cc 
class hello_tutorialModule : public pp::Module { 
public: 
hello_tutorialModule() : pp::Module() {} 
virtual ~hello_tutorialModule() {} 
virtual pp::Instance* CreateInstance(PP_Instance instance) { 
return new hello_tutorialInstance(instance); 
} 
}; 
namespace pp { 
Module* CreateModule() { 
return new hello_tutorialModule(); 
} 
}
Sample Code: 
hello_tutorial_module.nmf 
{ 
"program": { 
"x86-64": {"url": "hello_tutorial_x86_64.nexe"}, 
"x86-32": {"url": "hello_tutorial_x86_32.nexe"} 
} 
}
Sample Code: 
<h1>Native Client Module hello_tutorial</h1> 
<p> 
<div id="listener"> 
<script type="text/javascript"> 
var listener = document.getElementById('listener'); 
listener.addEventListener('load', moduleDidLoad, true); 
listener.addEventListener('message', handleMessage, true); 
</script> 
<embed name="nacl_module" 
id="hello_tutorial" 
width=0 height=0 
src="hello_tutorial.nmf" 
type="application/x-nacl" /> 
</div> 
</p> 
<h2>Status</h2> 
<div id="status_field">NO-STATUS</div> 
</body> 
</html> 
index.html
Appendix. 
Projects using NaCl 
● Mono (http://www.mono-project.com) 
○ Cross-platform .NET development framework. 
● naclports (http://code.google. 
com/p/naclports): 
○ A repository of example programs and library 
patches such as libSDL, Mesa, OpenSceneGraph, 
ImageMagick, cairo, boost, libvorbis and others. 
● NaTcl (http://wiki.tcl.tk/28211): 
○ A native client port of the TCL PL.
Appendix. 
● OCaml: 
○ http://code.google.com/p/nacl-ocaml/ 
○ A compiler that converts Objective Caml source 
code in to Native Client compliant machine code. 
● Sugar/GTK on Native Cilent: 
○ http://cananian.livejournal.com/tag/nativeclient 
● Qt 
○ http://developer.qt.nokia. 
com/wiki/Qt_for_Google_Native_Client 
○ A port of the popular application infrastructure to 
Native Client. 
Projects using NaCl
Appendix. 
Some games using NaCl 
● Wesnoth on Native Client: 
○ https://github.com/eugenis/wesnoth-nacl-build 
● Quake NaCl 
○ http://nacl-quake.appspot.com

Weitere ähnliche Inhalte

Was ist angesagt?

Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...
 Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ... Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...
Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...HighSolutions Sp. z o.o.
 
Opensource pnp container based waf
Opensource pnp container based wafOpensource pnp container based waf
Opensource pnp container based wafVarun konadagadapa
 
Life of a Chromium Developer
Life of a Chromium DeveloperLife of a Chromium Developer
Life of a Chromium Developermpaproductions
 
Import golang; struct microservice
Import golang; struct microserviceImport golang; struct microservice
Import golang; struct microserviceGiulio De Donato
 
Extensible web
Extensible webExtensible web
Extensible webJxck Jxck
 
Complete WPF Overview Tutorial with Example - iFour Technolab
Complete WPF Overview Tutorial with Example - iFour TechnolabComplete WPF Overview Tutorial with Example - iFour Technolab
Complete WPF Overview Tutorial with Example - iFour TechnolabiFour Technolab Pvt. Ltd.
 
Extensible web #html5j
Extensible web #html5jExtensible web #html5j
Extensible web #html5jJxck Jxck
 
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With ContainersHanoi MagentoMeetup
 
An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)iFour Technolab Pvt. Ltd.
 
Pragmatic Monolith-First, easy to decompose, clean architecture
Pragmatic Monolith-First, easy to decompose, clean architecturePragmatic Monolith-First, easy to decompose, clean architecture
Pragmatic Monolith-First, easy to decompose, clean architecturePiotr Pelczar
 
Drupal + composer = new love !?
Drupal + composer = new love !?Drupal + composer = new love !?
Drupal + composer = new love !?nuppla
 
Writing native Linux desktop apps with JavaScript
Writing native Linux desktop apps with JavaScriptWriting native Linux desktop apps with JavaScript
Writing native Linux desktop apps with JavaScriptIgalia
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composernuppla
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composernuppla
 
CubeJS: eBay’s Node.js Adoption Journey
CubeJS: eBay’s Node.js Adoption JourneyCubeJS: eBay’s Node.js Adoption Journey
CubeJS: eBay’s Node.js Adoption JourneyPatrick Steele-Idem
 

Was ist angesagt? (20)

Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...
 Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ... Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...
Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...
 
Composer
ComposerComposer
Composer
 
Opensource pnp container based waf
Opensource pnp container based wafOpensource pnp container based waf
Opensource pnp container based waf
 
Life of a Chromium Developer
Life of a Chromium DeveloperLife of a Chromium Developer
Life of a Chromium Developer
 
Import golang; struct microservice
Import golang; struct microserviceImport golang; struct microservice
Import golang; struct microservice
 
Extensible web
Extensible webExtensible web
Extensible web
 
Net core
Net coreNet core
Net core
 
Complete WPF Overview Tutorial with Example - iFour Technolab
Complete WPF Overview Tutorial with Example - iFour TechnolabComplete WPF Overview Tutorial with Example - iFour Technolab
Complete WPF Overview Tutorial with Example - iFour Technolab
 
Statyczna analiza kodu PHP
Statyczna analiza kodu PHPStatyczna analiza kodu PHP
Statyczna analiza kodu PHP
 
Extensible web #html5j
Extensible web #html5jExtensible web #html5j
Extensible web #html5j
 
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
 
An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)
 
Pragmatic Monolith-First, easy to decompose, clean architecture
Pragmatic Monolith-First, easy to decompose, clean architecturePragmatic Monolith-First, easy to decompose, clean architecture
Pragmatic Monolith-First, easy to decompose, clean architecture
 
Drupal + composer = new love !?
Drupal + composer = new love !?Drupal + composer = new love !?
Drupal + composer = new love !?
 
Writing native Linux desktop apps with JavaScript
Writing native Linux desktop apps with JavaScriptWriting native Linux desktop apps with JavaScript
Writing native Linux desktop apps with JavaScript
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composer
 
Groovy and noteworthy
Groovy and noteworthyGroovy and noteworthy
Groovy and noteworthy
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composer
 
Workshop - Golang language
Workshop - Golang languageWorkshop - Golang language
Workshop - Golang language
 
CubeJS: eBay’s Node.js Adoption Journey
CubeJS: eBay’s Node.js Adoption JourneyCubeJS: eBay’s Node.js Adoption Journey
CubeJS: eBay’s Node.js Adoption Journey
 

Ähnlich wie Chromium: NaCl and Pepper API

Electron JS | Build cross-platform desktop applications with web technologies
Electron JS | Build cross-platform desktop applications with web technologiesElectron JS | Build cross-platform desktop applications with web technologies
Electron JS | Build cross-platform desktop applications with web technologiesBethmi Gunasekara
 
Continuous Integration Step-by-step
Continuous Integration Step-by-stepContinuous Integration Step-by-step
Continuous Integration Step-by-stepMichelangelo van Dam
 
Voxxed days Vilnius 2015 - Android Reverse Engineering Lab
Voxxed days Vilnius 2015 - Android Reverse Engineering LabVoxxed days Vilnius 2015 - Android Reverse Engineering Lab
Voxxed days Vilnius 2015 - Android Reverse Engineering LabRon Munitz
 
Modules and artifacts in NPM by Anton Cherednikov
Modules and artifacts in NPM by Anton CherednikovModules and artifacts in NPM by Anton Cherednikov
Modules and artifacts in NPM by Anton CherednikovOdessaJS Conf
 
Opensourceman ( url for slides with animations https://goo.gl/R638tW )
Opensourceman ( url for slides with animations https://goo.gl/R638tW )Opensourceman ( url for slides with animations https://goo.gl/R638tW )
Opensourceman ( url for slides with animations https://goo.gl/R638tW )Андрей Вандакуров
 
Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)Giovanni Toraldo
 
Build your apps everywhere with Lightning Web Components Open Source, Fabien ...
Build your apps everywhere with Lightning Web Components Open Source, Fabien ...Build your apps everywhere with Lightning Web Components Open Source, Fabien ...
Build your apps everywhere with Lightning Web Components Open Source, Fabien ...CzechDreamin
 
Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD Annie Huang
 
Who needs containers in a serverless world
Who needs containers in a serverless worldWho needs containers in a serverless world
Who needs containers in a serverless worldMatthias Luebken
 
Installable web applications
Installable web applicationsInstallable web applications
Installable web applicationsLiveChat
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'acorehard_by
 
Joomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation TestingJoomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation TestingShyam Sunder Verma
 
Magento Docker Setup.pdf
Magento Docker Setup.pdfMagento Docker Setup.pdf
Magento Docker Setup.pdfAbid Malik
 
Making your app soar without a container manifest
Making your app soar without a container manifestMaking your app soar without a container manifest
Making your app soar without a container manifestLibbySchulze
 
Red Hat Container Development Kit
Red Hat Container Development KitRed Hat Container Development Kit
Red Hat Container Development KitLalatendu Mohanty
 
Avoid the Vendor Lock-in Trap (with App Deployment)
Avoid the Vendor Lock-in Trap (with App Deployment)Avoid the Vendor Lock-in Trap (with App Deployment)
Avoid the Vendor Lock-in Trap (with App Deployment)Peter Bittner
 
1 session installation
1 session installation1 session installation
1 session installationRahul Hada
 

Ähnlich wie Chromium: NaCl and Pepper API (20)

Electron JS | Build cross-platform desktop applications with web technologies
Electron JS | Build cross-platform desktop applications with web technologiesElectron JS | Build cross-platform desktop applications with web technologies
Electron JS | Build cross-platform desktop applications with web technologies
 
Continuous Integration Step-by-step
Continuous Integration Step-by-stepContinuous Integration Step-by-step
Continuous Integration Step-by-step
 
Nodejs
NodejsNodejs
Nodejs
 
Voxxed days Vilnius 2015 - Android Reverse Engineering Lab
Voxxed days Vilnius 2015 - Android Reverse Engineering LabVoxxed days Vilnius 2015 - Android Reverse Engineering Lab
Voxxed days Vilnius 2015 - Android Reverse Engineering Lab
 
Modules and artifacts in NPM by Anton Cherednikov
Modules and artifacts in NPM by Anton CherednikovModules and artifacts in NPM by Anton Cherednikov
Modules and artifacts in NPM by Anton Cherednikov
 
Opensourceman ( url for slides with animations https://goo.gl/R638tW )
Opensourceman ( url for slides with animations https://goo.gl/R638tW )Opensourceman ( url for slides with animations https://goo.gl/R638tW )
Opensourceman ( url for slides with animations https://goo.gl/R638tW )
 
Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)
 
Build your apps everywhere with Lightning Web Components Open Source, Fabien ...
Build your apps everywhere with Lightning Web Components Open Source, Fabien ...Build your apps everywhere with Lightning Web Components Open Source, Fabien ...
Build your apps everywhere with Lightning Web Components Open Source, Fabien ...
 
Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD
 
Who needs containers in a serverless world
Who needs containers in a serverless worldWho needs containers in a serverless world
Who needs containers in a serverless world
 
OpenCV Workshop
OpenCV WorkshopOpenCV Workshop
OpenCV Workshop
 
Installable web applications
Installable web applicationsInstallable web applications
Installable web applications
 
Node js first look - 2016
Node js first look - 2016Node js first look - 2016
Node js first look - 2016
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'a
 
Joomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation TestingJoomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation Testing
 
Magento Docker Setup.pdf
Magento Docker Setup.pdfMagento Docker Setup.pdf
Magento Docker Setup.pdf
 
Making your app soar without a container manifest
Making your app soar without a container manifestMaking your app soar without a container manifest
Making your app soar without a container manifest
 
Red Hat Container Development Kit
Red Hat Container Development KitRed Hat Container Development Kit
Red Hat Container Development Kit
 
Avoid the Vendor Lock-in Trap (with App Deployment)
Avoid the Vendor Lock-in Trap (with App Deployment)Avoid the Vendor Lock-in Trap (with App Deployment)
Avoid the Vendor Lock-in Trap (with App Deployment)
 
1 session installation
1 session installation1 session installation
1 session installation
 

Mehr von Chang W. Doh

Exploring what're new in Web for the Natively app
Exploring what're new in Web for the Natively appExploring what're new in Web for the Natively app
Exploring what're new in Web for the Natively appChang W. Doh
 
Kotlin의 코루틴은 어떻게 동작하는가
Kotlin의 코루틴은 어떻게 동작하는가Kotlin의 코루틴은 어떻게 동작하는가
Kotlin의 코루틴은 어떻게 동작하는가Chang W. Doh
 
Hey Kotlin, How it works?
Hey Kotlin, How it works?Hey Kotlin, How it works?
Hey Kotlin, How it works?Chang W. Doh
 
Kotlin, 어떻게 동작하나요
Kotlin, 어떻게 동작하나요Kotlin, 어떻게 동작하나요
Kotlin, 어떻게 동작하나요Chang W. Doh
 
introduction to Web Assembly
introduction to Web Assembly introduction to Web Assembly
introduction to Web Assembly Chang W. Doh
 
PWA Roadshow Seoul - Keynote
PWA Roadshow Seoul - KeynotePWA Roadshow Seoul - Keynote
PWA Roadshow Seoul - KeynoteChang W. Doh
 
PWA Roadshow Seoul - HTTPS
PWA Roadshow Seoul - HTTPSPWA Roadshow Seoul - HTTPS
PWA Roadshow Seoul - HTTPSChang W. Doh
 
CSS 다시 파서 어디에 쓰나
CSS 다시 파서 어디에 쓰나CSS 다시 파서 어디에 쓰나
CSS 다시 파서 어디에 쓰나Chang W. Doh
 
Natively Web App & Service Worker
Natively Web App & Service WorkerNatively Web App & Service Worker
Natively Web App & Service WorkerChang W. Doh
 
초보 개발자를 위한 웹 프론트엔드 개발 101
초보 개발자를 위한 웹 프론트엔드 개발 101초보 개발자를 위한 웹 프론트엔드 개발 101
초보 개발자를 위한 웹 프론트엔드 개발 101Chang W. Doh
 
Service Worker 201 (한국어)
Service Worker 201 (한국어)Service Worker 201 (한국어)
Service Worker 201 (한국어)Chang W. Doh
 
Service Worker 201 (en)
Service Worker 201 (en)Service Worker 201 (en)
Service Worker 201 (en)Chang W. Doh
 
Service Worker 101 (en)
Service Worker 101 (en)Service Worker 101 (en)
Service Worker 101 (en)Chang W. Doh
 
Service Worker 101 (한국어)
Service Worker 101 (한국어)Service Worker 101 (한국어)
Service Worker 101 (한국어)Chang W. Doh
 
What is next for the web
What is next for the webWhat is next for the web
What is next for the webChang W. Doh
 
Instant and offline apps with Service Worker
Instant and offline apps with Service WorkerInstant and offline apps with Service Worker
Instant and offline apps with Service WorkerChang W. Doh
 
Chrome enchanted 2015
Chrome enchanted 2015Chrome enchanted 2015
Chrome enchanted 2015Chang W. Doh
 
프론트엔드 개발자를 위한 크롬 렌더링 성능인자 이해하기
프론트엔드 개발자를 위한 크롬 렌더링 성능인자 이해하기프론트엔드 개발자를 위한 크롬 렌더링 성능인자 이해하기
프론트엔드 개발자를 위한 크롬 렌더링 성능인자 이해하기Chang W. Doh
 
Polymer Codelab: Before diving into polymer
Polymer Codelab: Before diving into polymerPolymer Codelab: Before diving into polymer
Polymer Codelab: Before diving into polymerChang W. Doh
 
알아봅시다, Polymer: Web Components & Web Animations
알아봅시다, Polymer: Web Components & Web Animations알아봅시다, Polymer: Web Components & Web Animations
알아봅시다, Polymer: Web Components & Web AnimationsChang W. Doh
 

Mehr von Chang W. Doh (20)

Exploring what're new in Web for the Natively app
Exploring what're new in Web for the Natively appExploring what're new in Web for the Natively app
Exploring what're new in Web for the Natively app
 
Kotlin의 코루틴은 어떻게 동작하는가
Kotlin의 코루틴은 어떻게 동작하는가Kotlin의 코루틴은 어떻게 동작하는가
Kotlin의 코루틴은 어떻게 동작하는가
 
Hey Kotlin, How it works?
Hey Kotlin, How it works?Hey Kotlin, How it works?
Hey Kotlin, How it works?
 
Kotlin, 어떻게 동작하나요
Kotlin, 어떻게 동작하나요Kotlin, 어떻게 동작하나요
Kotlin, 어떻게 동작하나요
 
introduction to Web Assembly
introduction to Web Assembly introduction to Web Assembly
introduction to Web Assembly
 
PWA Roadshow Seoul - Keynote
PWA Roadshow Seoul - KeynotePWA Roadshow Seoul - Keynote
PWA Roadshow Seoul - Keynote
 
PWA Roadshow Seoul - HTTPS
PWA Roadshow Seoul - HTTPSPWA Roadshow Seoul - HTTPS
PWA Roadshow Seoul - HTTPS
 
CSS 다시 파서 어디에 쓰나
CSS 다시 파서 어디에 쓰나CSS 다시 파서 어디에 쓰나
CSS 다시 파서 어디에 쓰나
 
Natively Web App & Service Worker
Natively Web App & Service WorkerNatively Web App & Service Worker
Natively Web App & Service Worker
 
초보 개발자를 위한 웹 프론트엔드 개발 101
초보 개발자를 위한 웹 프론트엔드 개발 101초보 개발자를 위한 웹 프론트엔드 개발 101
초보 개발자를 위한 웹 프론트엔드 개발 101
 
Service Worker 201 (한국어)
Service Worker 201 (한국어)Service Worker 201 (한국어)
Service Worker 201 (한국어)
 
Service Worker 201 (en)
Service Worker 201 (en)Service Worker 201 (en)
Service Worker 201 (en)
 
Service Worker 101 (en)
Service Worker 101 (en)Service Worker 101 (en)
Service Worker 101 (en)
 
Service Worker 101 (한국어)
Service Worker 101 (한국어)Service Worker 101 (한국어)
Service Worker 101 (한국어)
 
What is next for the web
What is next for the webWhat is next for the web
What is next for the web
 
Instant and offline apps with Service Worker
Instant and offline apps with Service WorkerInstant and offline apps with Service Worker
Instant and offline apps with Service Worker
 
Chrome enchanted 2015
Chrome enchanted 2015Chrome enchanted 2015
Chrome enchanted 2015
 
프론트엔드 개발자를 위한 크롬 렌더링 성능인자 이해하기
프론트엔드 개발자를 위한 크롬 렌더링 성능인자 이해하기프론트엔드 개발자를 위한 크롬 렌더링 성능인자 이해하기
프론트엔드 개발자를 위한 크롬 렌더링 성능인자 이해하기
 
Polymer Codelab: Before diving into polymer
Polymer Codelab: Before diving into polymerPolymer Codelab: Before diving into polymer
Polymer Codelab: Before diving into polymer
 
알아봅시다, Polymer: Web Components & Web Animations
알아봅시다, Polymer: Web Components & Web Animations알아봅시다, Polymer: Web Components & Web Animations
알아봅시다, Polymer: Web Components & Web Animations
 

Kürzlich hochgeladen

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 

Kürzlich hochgeladen (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

Chromium: NaCl and Pepper API

  • 1. Chromium Plugin Pepper API & Native Client
  • 2. Chang W. Doh <hi> </hi> GDG Korea WebTech Organizer HTML5Rocks/KO Contributor/Coordinator
  • 3. What’s NaCl? ● Open-source technology for running native compiled code in the browser ○ With the goal of ■ Maintaining the portability and safety ○ Final goal ■ Enabling developers to enhance their web applications using their preferred language.
  • 4. What’s NaCl? ● Currently available on ○ Chrome for Windows, Mac, Linux, and Chrome OS ■ x86 and ARM architectures
  • 5. Why NaCl? ● Native functionalities ○ 2D/3D graphics, audio, input events, multi-threads, and access memory directly, ... ● Portability PNaCl only! ○ OS and CPU independent ● Security ○ Double sandbox model ● Performance ○ Run at speeds comparable to desktop applications (within 5-15% of native speed).
  • 6. Why NaCl? ● DEMO: Bastion
  • 7. NaCl in a web app
  • 8. NaCl ● Toolchains ○ Collections of development tools ■ Compilers, linkers, etc. ■ Transform C/C++ code to (P)NaCl modules. ■ There’re 2 types of toolchain for each NaCl Type ● Runtime components: ○ Embedded in the browser or other host platforms ○ Allow execution of NaCl modules
  • 9. PNaCl & its Toolchain ● Portable Native Client - a.k.a PNaCl ○ With using the PNaCl toolchain to produce a single, portable (pexe) module. ■ Translator built into the browser translates pexe into native code for the relevant client architecture at runtime
  • 10. NaCl & its Toolchain ● Native Client - a.k.a NaCl ○ With using a nacl-gcc based toolchain to produce multiple architecture-dependent (nexe) modules ○ nexe modules are packaged into an application. ○ Browser decides which nexe to load based on architecture of the client machine at runtime from . nmf file ● Only be used as part of app/extensions that are installed from the Chrome Web Store.
  • 11. Sandbox model ● Security measures have to be implemented: ○ The NaCl sandbox ensures Pepper API ■ Accessing system resources only through safe, whitelisted APIs ■ Operates within its limits without attempting to interfere with other code running either within the browser or outside it. ○ The NaCl validator ■ Statically analyzes code prior to running it to make sure it only uses code and data patterns that are permitted and safe.
  • 12. Sandbox model ● Double sandbox design ○ NaCl sandbox and Chrome sandbox ■ Security measures are in addition to the existing sandbox in the Chrome browser ○ the NaCl module always executes in a process with restricted permissions. ■ The only interaction between this process and the outside world is through sanctioned browser interfaces.
  • 13. Constraints of PNaCl ● Not support architecture-specific instructions ○ i.e., inline assembly. Currently trying alternatives such as PNaCl’s Portable SIMD Vectors. ● Only supports static linking with the newlib C standard library ○ Native Client SDK provides a PNaCl port of newlib ○ Dynamic linking and glibc are not yet supported.
  • 14. How NaCls work?: PNaCl & NaCl workflow LLVM Bitcode
  • 15. How PNaCl works? Build time ● pnacl- tools produce LLVM bc files ○ The pnacl-ld linker tool produces a statically linked LLVM pexe. ○ The pnacl-finalize tool converts an LLVM pexe to a frozen PNaCl bitcode pexe. ○ Chrome only runs the frozen PNaCl bitcode format, not the standard LLVM bitcode pexe.
  • 16. How PNaCl works? Build time ● Compilation occurs in 2 steps (1) Intermediate product, an LLVM bitcode (Toolchain) (2) "Traditional" NaCl compilation workflow (Browser)
  • 17. How PNaCl works? ● While chrome can load, ○ Translate a frozen pexe directly Runtime ■ An additional tool pnacl-translate for generating native code from either LLVM or PNaCl bitcode. ■ Useful for debugging
  • 18. How PNaCl works? Runtime
  • 20. Pepper API ● Pepper Plugin API (PPAPI) ○ Cross-platform API for Web Browser Plugin ○ Allows C/C++ module in a safe and portable way to ■ communicate with the hosting browser ■ get access to system-level functions ○ Simply, a host interface for NaCl module ■ e.g. NaCl can’t make any OS-level calls directly ● Instead, PPAPI provides analogous APIs that modules can target.
  • 21. Misc. ● About Pepper APIs ○ PPAPI doesn’t support any feature that are out scope within JavaScript APIs, and will not support in the furture. ● About (P)NaCl ○ (P)NaCl doesn’t support creating JS API directly ■ Use ‘postMessage()’ for communicating ○ (P)NaCl is working in progress to support it on Mobile, maybe Android.
  • 24. Sample Code: hello_tutorial_module.cc #include <cstdio> #include <string> #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" #include "ppapi/cpp/var.h" class hello_tutorialInstance : public pp::Instance { public: explicit hello_tutorialInstance(PP_Instance instance) : pp::Instance(instance) {} virtual ~hello_tutorialInstance() {} virtual void HandleMessage(const pp::Var& var_message) { } };
  • 25. Sample Code: hello_tutorial_module.cc class hello_tutorialModule : public pp::Module { public: hello_tutorialModule() : pp::Module() {} virtual ~hello_tutorialModule() {} virtual pp::Instance* CreateInstance(PP_Instance instance) { return new hello_tutorialInstance(instance); } }; namespace pp { Module* CreateModule() { return new hello_tutorialModule(); } }
  • 26. Sample Code: hello_tutorial_module.nmf { "program": { "x86-64": {"url": "hello_tutorial_x86_64.nexe"}, "x86-32": {"url": "hello_tutorial_x86_32.nexe"} } }
  • 27. Sample Code: <h1>Native Client Module hello_tutorial</h1> <p> <div id="listener"> <script type="text/javascript"> var listener = document.getElementById('listener'); listener.addEventListener('load', moduleDidLoad, true); listener.addEventListener('message', handleMessage, true); </script> <embed name="nacl_module" id="hello_tutorial" width=0 height=0 src="hello_tutorial.nmf" type="application/x-nacl" /> </div> </p> <h2>Status</h2> <div id="status_field">NO-STATUS</div> </body> </html> index.html
  • 28. Appendix. Projects using NaCl ● Mono (http://www.mono-project.com) ○ Cross-platform .NET development framework. ● naclports (http://code.google. com/p/naclports): ○ A repository of example programs and library patches such as libSDL, Mesa, OpenSceneGraph, ImageMagick, cairo, boost, libvorbis and others. ● NaTcl (http://wiki.tcl.tk/28211): ○ A native client port of the TCL PL.
  • 29. Appendix. ● OCaml: ○ http://code.google.com/p/nacl-ocaml/ ○ A compiler that converts Objective Caml source code in to Native Client compliant machine code. ● Sugar/GTK on Native Cilent: ○ http://cananian.livejournal.com/tag/nativeclient ● Qt ○ http://developer.qt.nokia. com/wiki/Qt_for_Google_Native_Client ○ A port of the popular application infrastructure to Native Client. Projects using NaCl
  • 30. Appendix. Some games using NaCl ● Wesnoth on Native Client: ○ https://github.com/eugenis/wesnoth-nacl-build ● Quake NaCl ○ http://nacl-quake.appspot.com