Skip to content

Cameo Prototype Based on Content API

huningxin edited this page Apr 19, 2013 · 10 revisions

Propose

This is a Cameo prototype launcher cameo.exe which is based on Chromium's Content API.

This prototype is use content_shell as base. The content_shell is the canonical sample embedder.It only uses content's public API. So content_shell could be the perfect base of Cameo project. The idea is to fork the Chromium's content_shell, import it into cameo, then build the cameo's stuffs, say embedding API, JS API infrastructure, runtime model, security model and package/installer tools from that.

Usage

  • Development mode (mini-browser): cameo.exe <URL>
  • App mode (chromeless): cameo.exe --headless <URL>

For example, to launch Brackets as app by: cameo.exe --headless --allow-file-access-from-files <path-to-brackets>/src/index.html

Get the code

Cameo is based on Content API, so it needs to build with Chromium/Blink code. And since we might need to keep some downstream patches, so a cameo-chromium and cameo-blink repositories might be needed.

Cameo uses gclient to sync the code. Please make sure you are familiar with Get the Code. You should install depot_tools.

Create a .gclient with following content. Please note we use upstream blink repository in this prototype since there are no downstream patches in blink yet.

Content of .gclient:

solutions = [
   { "name"        : "src",
	 "url"         : "ssh://[email protected]/huningxin/Chromium.git@origin/cameo-dev",
	 "deps_file"   : ".DEPS.git",
	 "managed"     : True,
	 "custom_deps" : {
	   "src/cameo": "ssh://[email protected]/huningxin/cameo.git",
	   "src/third_party/WebKit/LayoutTests": None,
	   "src/chrome_frame/tools/test/reference_build/chrome": None,
	   "src/chrome_frame/tools/test/reference_build/chrome_win": None,
	   "src/chrome/tools/test/reference_build/chrome": None,
	   "src/chrome/tools/test/reference_build/chrome_linux": None,
	   "src/chrome/tools/test/reference_build/chrome_mac": None,
	   "src/chrome/tools/test/reference_build/chrome_win": None,
	 },
	 "safesync_url": "",
   },
]

At the same level of .gclient file, execute

gclient sync

to fetch all codes.

Build Instructions

Please setup the build environment as Build Instructions for Windows. Please note currently only the Windows build of this prototype is verified.

We prefer to use ninja as build tool. Please refer to Ninja Build to setup the environment.

We use gyp to generate projects. To generate cameo projects, go to src directory, execute

python cameo/gyp_cameo

to generate the projects.

Then fire the build off:

ninja -C out\Release cameo.exe

The build takes an hour also on an i7+16GB+SSD machine.

Next steps

  • API infrastructure prototype.
  • API implementation prototype for Brackets.
  • Analyze the HTML5 feature gaps.
  • Build infrastructure.
  • Tooling and packaging prototype.

Introduction

Clone this wiki locally