Showing posts with label chromium. Show all posts
Showing posts with label chromium. Show all posts

Thursday, November 11, 2010

C++ version of JSON Schema

Way back when we were starting the extensions project, I mentioned that we were using JSON schema for API validation.

This worked out pretty well, but the downside is that it was implemented in JavaScript, so it couldn't really be used effectively in Chrome's browser process (for somewhat obscure technical reasons it's complicated to run JavaScript in Chrome's main process -- we usually only run it in child processes).

So for a really long time, I've been wanting to re-implement it in C++ so that I could use it for work in the browser process too. Finally got around to it:


This only relies on Chromium's "base" library (which is really quite nice, btw), so it could conceivably be re-used by other projects. For example, I'm hoping that we can use it on the server side, in Chrome's web store.

Figured it might be useful to someone else someday, too.

Sunday, April 5, 2009

Yo dawg...

So on the extensions project, I've been working on what I think is the somewhat novel idea of API non-design.

To be more specific, I'm using the CRUD pattern as a starting point for all the major sub-systems' APIs. My hope is that this will have a number of positive effects:
  • Minimize API design hand-wringing
  • Provide a large base of functionality quickly
  • Make it easy for Chromium developers to add new APIs
  • Make it easy for extension developers to learn new APIs
We decided to use JSON heavily in the implementation. For example, the createTab() API looks like this:
chromium.tabs.createTab({
"url": "http://www.google.com/",
"selected": true,
"tabIndex": 3
});
So I got this all working for a few methods, and then I got to writing the validation code. I could write the code by hand, but that's so much work. And why bother when somebody has gone and invented JSON Schema.

That's right, it's a schema language for JSON. And of course it has a schema, written in JSON schema. Whee!

So we should be able to just declare the expected structure for our API parameters and push the validate() button. Probably there will have to be extra stuff around the edges, but this should get rid of a majority of the grunt work.

Saturday, November 29, 2008

Extensions in Chromium

For the past few weeks, myself and a few others have been looking into how extensions might work in Chromium. Last Wednesday, we published a design doc with the beginning of our plan.

If you're an extension developer or user, we'd love to hear your feedback. You can reach us at #chromium on irc.freenode.org or chromium-dev@googlegroups.com.

Tuesday, November 11, 2008

Gmail in Chromium "Test Shell" on Linux

The other three guys in my office all work on Chromium for Linux. Right now, they are working on bringing up the "test shell". The test shell is a very simple browser that the Chromium development team uses for testing our integration with WebKit. It is the first step of porting Chromium to a new platform.

Today, one of the linux guys sent a message from Gmail in the linux test shell for the first time:

From: "Dan Kegel" 
To: chromium-dev@googlegroups.com
Subject: sent from test shell on Linux!

Dude, gmail works in the test shell on Linux!

The team is still a long ways from even getting the web to render correctly, let alone building the real browser UI. But it's exciting to see things falling a little more into place each day.

Saturday, November 1, 2008

Greasemonkey in Chromium

Evan and I have been hacking on Greasemonkey support for Chromium in our 20% time. It's been fun. Actually, it was Evan who started the work... after months of pestering me, he got frustrated and started hacking.

Implementation is more interesting than in Firefox because of Chromium's sandbox. The renderer processes are where scripts must be executed, but the renderers are not allowed to read the scripts from disk. So we set it up so that the privileged "browser" process reads the scripts into shared memory and broadcasts them to the renderers. It also watches for changes on disk and rebroadcasts when changes occur.

Note that like everything else in Chromium nightlies, Greasemonkey support is considered experimental and may change, break, or disappear from build to build. That said, this is something a lot of us on Chromium are excited about, and look forward to continuing to improve.