What's new? | Help | Directory | Sign in
Google
gears
Improving Your Web Browser
  
  
  
    
Search
for
Updated Jul 18 (2 days ago) by gears.team.zork
GearsCodingGuidelines  
Conventions & Caveats for the Gears codebase

Introduction

This page documents some guidelines you should follow when writing Gears code.

HTML UI Files

All strings used in .html files are stored in their associated .js.stab file. Strings should be given an id matching the id of the div or span they will appear in.

The TRANS_BLOCK tag is used inside the .stab files to mark strings for translation.

Reference Counted Classes

Gears code utilizes intrusive reference counting on some objects via Ref() and Unref(). An external reference-counting mechanism like shared_ptr is not feasible because we must occasionally pass raw pointers via COM or other API boundaries. To keep things consistent and minimize the number of bugs, the following guidelines should be used:

Since this is so ugly, consider using the as_out_parameter idiom:
   void GetFoo(Foo** f);
   scoped_refptr<Foo> local;
   GetFoo(as_out_parameter(local));

Mac coding guidelines

Notable Departures from common Objective-C coding style


Sign in to add a comment