Intro to FXOS

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

GECKO
Gecko
This is the Firefox OS application runtime; that is, the layer that provides all of the support for the trifecta of open standards: HTML, CSS, and JavaScript. It makes sure those APIs work well on every operating system Gecko supports. This means that Gecko includes, among other things, a networking stack, graphics stack, layout engine, a JavaScript virtual machine, and porting layers.


Browser Tab 1 Browser Tab 2
Launching an App
1. Homescreen app gets app reference from mozApps API, and calls app.launch() 2. Gecko receives the request, fires mozChromeEvent to the System app with details of the app 3. System app handles the event by inserting the app iframe into it’s DOM 4. App loads within the iframe
• • •



component management object message passing memory management …
XPCOM

nsISupports

CID/UUID v.s. Contract ID

A CID is a 128-bit number that uniquely identifies a class or component in much the same way that an IID uniquely identifies an interface. The CID for nsISupports looks like this: A contract ID is a human readable string used to access a component. A CID or a contract ID may be used to get a component from the component manager. This is the contract ID for the LDAP Operation component:
gonk/hal
XPCOM (Cross platform Component Object Model)

A framework which allows developers to break up monolithic software projects into smaller modularised pieces. XPCOM is the means of accessing Gecko library functionality and embedding or extending Gecko Allow different pieces of software(components) to be developed and built independently of one another It provides
Template App
File Structure
manifest.webapp
App Communication
Individual apps are run synchronously in a single thread - the same way a browser works. Apps are run “OOP” (Out-of-process), and have no standard communication with each other. There are a few ways to talk to apps indirectly through gecko
gaia/apps/gallery
Settings
Write: APP -> mozSettings -> DB Read: API -> read DB -> initial status
IAC
App Manager
Q&A
• • •
JavaScript文文件是如何编译成代码的 APP开机是如何加载的 资源文文件是如何管理的
Environments
• • • • •
Firefox Browser (Nightly) FxOS simulator (a plugin in browser) B2G desktop FxOS emulator(Android like) FxOS Devices(Flame, Alcatel Fire E ..)
Components
Document parser (handles HTML and XML)
Layout engine with content model
Style system (handles CSS, etc.)
JavaScript runtime (SpiderMonkey)
Image library
Architecture
System APP
The system app as a wrapping app, which managers, starts and stops webs. The system app controls several apps, each with an iframe. For example: • Keyboard • Homescreen • Browser APP
https://developer.mozilla.org/en-US/docs/Mozilla_Source_Code_Directory_Structure
b2g/
• b2g/chrome/content/shell.html
• b2g/chrome/content/shell.js
• b2g/app/b2g.js
dom/{API}
• New API implementations (post-b2g) will be located in dom/. Older APIs will be located in dom/base, for example Navigator.cpp. • dom/apps
.jsm will be loaded — .js API implementations such as webapp.js install, getSelf, etc.

Codebase structure
http://dxr.mozilla.org/mozilla-central/source/
Folders
! Db, 数据库模块,⺫目目前包括sqlite3 ! Dom, dom 标准IDL 接口口定义,mozilla 扩展接口口定义,实现dom对象 和javascript的连接。实现了一一些dom 0 级对象, (window, window.navigator, window.loca>on, etc) ! Extension, 外包实现的功能模块, Auth 权限管理,cookie 功能、GIO 通 用用的读写模块、gnome 的虚拟文文件系统、Permission 内容访问许可控 制、Preferences 模块、语法检查模块. Irq, finger ... ! Gfx, 图形引擎接口口的抽象,包含了多种实现,cario, skia … ! Image, 图像渲染库,包括图片片的编解码 ! Intl, 国际化和本地话的支支持 ! Ipc, 进程间通信的实现 ! Js, javascript 引擎的实现 ! Nsprpub, 线程,文文件, socket 等的抽象层 ! Xpcom, 组件机制的实现
Introduction to FXOS
Technical Walkthrough
GAIA
GECKO
GONK
GAIA
Gaia
The user interface of the Firefox OS platform. Anything drawn to the screen once Firefox OS is started up is a product of the Gaia layer. Gaia implements the lock screen, home screen, and all the standard applications you expect on a modern smartphone. Gaia is implemented entirely using HTML, CSS, and JavaScript. Its only interfaces to the underlying operating system are through open Web APIs, which are implemented by the Gecko layer. Third party applications can be installed alongside the Gaia layer.
App Communication

MozActivity https://wiki.mozilla.org/WebAPI/WebActivities
• •
Settings IAC
https://wiki.mozilla.org/WebAPI/Inter_App_Communication
ห้องสมุดไป่ตู้
MozActivity
• dom/apps/PermissionsTable.jsm
All permissions are defined in PermissionsTable.jsm
dom/webidl
WebIDL is the language used to define web APIs. For supported attributes, read WebIDL_bindings.
Codebase structure
https://github.com/mozilla-b2g/gaia
Gaia Folders
apps - open web apps build - build scripts triggered by the makefile customization - boot animation, wallpapers, ringtones and etc dev-apps - apps under development and test apps shared - shared components (building blocks, localisation) test_media - test video/music files, make install-test-media tests - unit/integration test support tools - XULRunner SDK Folders
Networking library (Necko)
Platform-specific graphics rendering and widget sets for Win32, X, and Mac
User preferences library
Mozilla Plug-in API (NPAPI) to support the Navigator plug-in interface
相关文档
最新文档