Changes

Jump to: navigation, search

CloudServices/Sync/FxSync/Developer/ClientAPI

77 bytes removed, 08:56, 29 October 2010
Writing an Engine class: SyncEngine should be imported via main.js rather than directly. And exporting your engine is unnecessary.
function FooEngine() {
Weave.SyncEngine.call(this, "Foo");
}
FooEngine.prototype = {
__proto__: Weave.SyncEngine.prototype,
_recordObj: FooRecord,
_storeObj: FooStore,
As you can see, there isn't actually any new code here at all; the prototype simply defines some metadata such as the Store and Tracker classes to use, and the human-readable name that will be used in the log files to identify errors and status messages coming from this engine.
(Don't forget that you'll need to import SyncEngine and export FooEngineWeave. So the top of your file should include:)
const EXPORTED_SYMBOLS = ["FooEngine", /* ... etc... */ ];
const Cu = Components.utils;
// etc...
Cu.import("resource://services-sync/enginesmain.js");
== Installing your classes into Sync ==

Navigation menu