2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-08-25 15:49:44 -07:00
|
|
|
|
|
|
|
const EXPORTED_SYMBOLS = ['Weave'];
|
|
|
|
|
|
|
|
let Weave = {};
|
|
|
|
Components.utils.import("resource://services-sync/constants.js", Weave);
|
|
|
|
let lazies = {
|
2012-03-22 15:49:50 -07:00
|
|
|
"record.js": ["CollectionKeys"],
|
2011-01-18 16:23:25 -08:00
|
|
|
"engines.js": ['Engines', 'Engine', 'SyncEngine', 'Store'],
|
2011-12-14 17:10:34 -08:00
|
|
|
"engines/addons.js": ["AddonsEngine"],
|
2010-08-25 15:49:44 -07:00
|
|
|
"engines/bookmarks.js": ['BookmarksEngine', 'BookmarksSharingManager'],
|
|
|
|
"engines/clients.js": ["Clients"],
|
|
|
|
"engines/forms.js": ["FormEngine"],
|
|
|
|
"engines/history.js": ["HistoryEngine"],
|
|
|
|
"engines/prefs.js": ["PrefsEngine"],
|
|
|
|
"engines/passwords.js": ["PasswordEngine"],
|
|
|
|
"engines/tabs.js": ["TabEngine"],
|
2011-12-08 05:33:23 -08:00
|
|
|
"engines/apps.js": ["AppsEngine"],
|
2012-03-22 15:49:50 -07:00
|
|
|
"identity.js": ["Identity"],
|
2010-12-09 18:12:09 -08:00
|
|
|
"jpakeclient.js": ["JPAKEClient"],
|
2012-03-22 15:49:50 -07:00
|
|
|
"keys.js": ["BulkKeyBundle", "SyncKeyBundle"],
|
2010-08-25 15:49:44 -07:00
|
|
|
"notifications.js": ["Notifications", "Notification", "NotificationButton"],
|
2011-10-02 01:16:22 -07:00
|
|
|
"policies.js": ["SyncScheduler", "ErrorHandler",
|
|
|
|
"SendCredentialsController"],
|
2012-03-22 15:49:50 -07:00
|
|
|
"resource.js": ["Resource", "AsyncResource"],
|
2010-08-25 15:49:44 -07:00
|
|
|
"service.js": ["Service"],
|
|
|
|
"status.js": ["Status"],
|
|
|
|
"util.js": ['Utils', 'Svc', 'Str']
|
|
|
|
};
|
|
|
|
|
|
|
|
function lazyImport(module, dest, props) {
|
|
|
|
function getter(prop) function() {
|
|
|
|
let ns = {};
|
|
|
|
Components.utils.import(module, ns);
|
|
|
|
delete dest[prop];
|
|
|
|
return dest[prop] = ns[prop];
|
|
|
|
};
|
|
|
|
props.forEach(function(prop) dest.__defineGetter__(prop, getter(prop)));
|
|
|
|
}
|
|
|
|
|
|
|
|
for (let mod in lazies) {
|
|
|
|
lazyImport("resource://services-sync/" + mod, Weave, lazies[mod]);
|
|
|
|
}
|