Граф коммитов

215 Коммитов

Автор SHA1 Сообщение Дата
Edward Lee 78a722ffd5 Revert svc/svc == null change from 87f9860d8e5a. 2010-03-02 11:22:20 -08:00
Paul O’Shannessy 25fc7e8e9e Refactor fake services so it's easier to add more [r=Mardak]
Created a FakeSvc object to put fake services into.
2010-03-02 11:07:30 -08:00
Paul O’Shannessy dbd9998e8a Bug 547827 - JavaScript strict warning: modules/util.js, line 617: reference to undefined property thisObj[name] [r=Mardak]
Check that name is a property of thisObj before trying to access it.
2010-02-23 13:10:32 -08:00
Edward Lee 5e3b42f790 Bug 535722 - Reduce the amount of logging for default log levels
Include the URI on success/fail requests and only trace log the onStartRequest. Switch various debug messages to trace and remove importing Log4Moz in fx-weave-overlay and generic-change. Drop the rootLogger to Debug to not log trace messages from unpreffed loggers.
2009-12-17 18:51:55 -08:00
Edward Lee 30a5a5e095 Bug 534944 - Avoid loading/importing weave files until necessary to speed up fennec startup
Have importing service.js trigger startup instead of only starting up from Weave.js, which now is used as a backup kickstarter. Only call import(service.js) when necessary from various Fennec files.
2009-12-15 14:21:12 -08:00
Edward Lee 9bd57f2170 Provide a fake service for platforms that don't have the service like Private Browsing (for Fennec/Seamonkey). 2009-11-30 14:36:03 -08:00
Edward Lee 54ac58d5e4 Remove unused prefs and imports. (Bug 524916)
--HG--
extra : rebase_source : 074e542f63ee840b61db7fe63a6c3540c13a31a5
2009-11-25 17:49:15 -08:00
Edward Lee 5b2d0e0fe2 Bug 530904 - tabs list style doesn't match fennec lists
Make headers larger, adjust text margins, add nokia sans font family.
2009-11-25 16:59:02 -08:00
Edward Lee c0765fefde Remove trailing whitespace from the codebase. 2009-11-20 14:34:20 -08:00
Edward Lee 691f609c50 Bug 527790 - Allow client names to be different from the default "Firefox"
Generate a client name based on the logged in username, appname, hostname, and profile name.
2009-11-19 23:31:04 -08:00
Edward Lee 43a1a96614 Bug 526661 - Use Firefox content to display the activity log
Just open the file as a tab to show the activity log. Remove related xul/js/strings. Saving can be done through normal Save Page As... No manual cleaning of the log, but the size is much smaller.
2009-11-04 17:01:49 -08:00
Edward Lee 727e615361 Remove unused openStatus util call for status.xul. 2009-11-03 14:39:35 -08:00
Mike Connor c803c9f499 bug 485108 - drop status dialog, show status including engines on statusbar, remove dead status bits 2009-10-28 03:42:35 -04:00
Mike Connor a74475172a merge backout 2009-10-23 01:11:07 -04:00
Mike Connor d15a690d44 Backed out changeset 4e518b3ae5d2
overzealous pruning ftl ;)
2009-10-23 01:10:36 -04:00
Edward Lee c63aad855c Bug 483089 - Weave Preferences button in Add-ons manager should be enabled
Show the new pref pane (bug 521357) by having the options.xul file for Fennec (bug 523384) close iteself and open the real prefs window.
2009-10-22 16:15:34 -07:00
Edward Lee 2fd35215ca Bug 523384 - Update Fennec UI for 0.8 release
Provide an optionsURL to show settings on Fennec and update the options on various events like sync, login, options loaded.
2009-10-22 13:51:50 -07:00
Edward Lee 57cd173e1d Remove unused change password/passphrase/generic dialog. 2009-10-19 16:37:25 -07:00
Edward Lee 998e703ef1 Remove unused pick-sync dialog (<==, <==>, ==>). 2009-10-19 16:24:32 -07:00
Edward Lee 2df003c9b1 Bug 517598 - Put useful interestingness/index values for bookmark
Use places to figure out the frecency of a bookmark and give items (not just bookmarks) a bonus if it's sitting in the toolbar.
2009-10-16 16:19:28 -07:00
Edward Lee 964e049c2e Add a simpler-to-use nsITimer wrapper, Utils.delay, that can use a named property of an object to additionally delay or clear the timer. Get rid of Utils.EventListener and simplify/fix up users. 2009-09-24 22:51:38 -07:00
Edward Lee 13ec4c4921 Bug 518146 - Generate shorter GUIDs than nsIUUIDGenerator
Randomly generate 10 characters from a pool of 70 possible characters for an equivalent 61.29-bit GUID which should have around 1% chance of collision (within a collection) after ~100 million records.
2009-09-24 15:54:47 -07:00
Edward Lee 736efc571f Bug 518018 - Default to serverURL instead of userAPI on 404 cluster check
Rework server/user/misc prefs to allow relative paths and full urls for generating API paths. Cache string properties of generated URLs under the storageAPI instead of using dynamic getters.
2009-09-21 17:13:41 -07:00
Edward Lee 6be4412a84 Keep track of previously opened windows of pages that should only have one instance open and close the old one if it's still open. 2009-09-18 00:15:37 -07:00
Edward Lee 4d0bbd635e Use the lazyStrings object for error strings to avoid using the wrong file (locales vs locale). 2009-09-16 16:52:43 -07:00
Mike Connor cc109400c6 bug 511549 - make detailedStatus much smarter about errors and backoff, r=edilee
--HG--
extra : rebase_source : 42e3eb9c89d2567d18c02e7583202e284dd69b0e
2009-09-15 21:38:52 -04:00
Edward Lee 439d963fbf Bug 507429 - Partial sync download support
Only fetch a limited number of items on first/update syncs and if we get the same number, ask the server for the ids to fetch later. Also on every download, process some of the backlog and save the list of GUIDs to disk as json for cross-session support.
2009-09-10 23:11:33 -07:00
Edward Lee 461f6105f9 Bug 513191 - cloud -> client sync wipes auth cache, including weave credentials. r=thunder
Bug 506790 - Utils.setPassword unnecessarily removes logins and add them when the realm/user/pass are the same
Bug 506792 - Utils.setPassword gets called multiple times for both password and passphrase on login
Bug 514499 - Passphrase not verified with auto-login
Don't aggressively persist the password with smart (dumb?) setters that clear out the temp password; and provide a separate function to persist the login. This effectively makes setting password/passphrase always temporary until persisted, which will check if the value is different from the one already stored on disk. A number of verify/cluster functions are privitized to not need to take user/pass/passph as arguments so that the default authenticator will work, and verifyPassphrase will use the stored passphrase to correctly handle auto-login.
2009-09-03 21:11:32 -07:00
Edward Lee d439ae6ca8 Bug 512457 - Report errors before they get eaten up by runInBatchMode
Save the exception from inside runBatched and not have runInBatchMode return failure, so we can then expose the exception.
2009-08-31 16:28:00 -07:00
Dan Mills 5c1a1bedc6 remove 'GPrefs' from Svc, Preferences will do fine; don't make the username in the center status a link, since the whole area is a click target; open 'generic dialogs' for change password & passphrase 2009-08-26 21:20:08 -07:00
Edward Lee 3d8f8a2198 Remove Firefox Weave pref pane and point Preferences... to about:weave.
--HG--
extra : rebase_source : c8e47a770d342dc52aa49d8912be66cd2fa1bfa2
2009-08-26 19:50:39 -07:00
Dan Mills 3777541de2 about:weave polish: add localized help drawer & other small fixes
--HG--
extra : rebase_source : e82da40950dd20d6f418c90cb9b02ba896cd5693
2009-08-26 18:48:22 -07:00
Dan Mills 5e5d1b1243 Adds another pref for the "misc" api, makes base/misc url prefs default to auth.smc/{user,misc}/, fixes about:weave captcha path. r=Mardak 2009-08-26 15:01:28 -07:00
Mike Connor 8733edea53 bug 512393 - l10n cleanup for 0.6, includes fix for bug 511548 as well 2009-08-25 00:47:35 -04:00
Edward Lee 31daa66e01 Bug 512001 - Kill the Wizard! (and Account Pane + Login)
Remove the Wizard Dialog, Account Pane, Login Dialog, Add-ons Pane, Advanced Dialog and their related xul/js/css/strings/images. Clean up some unused functions, xul:preferences, css, strings. Orphaned functionality: autoconnect preference, reset/forgot password/passphrase.
2009-08-21 17:32:41 -07:00
Edward Lee b306cc77ab Extend Utils.anno to handle pages and clean up GUID code for history engine. Also fix a bug where changeItemID would set annotations to expire on session. 2009-08-21 14:29:37 -07:00
Edward Lee 6f2547d008 Merge weave to about-weave. 2009-08-19 22:46:50 -07:00
Dan Mills 27305124c1 initial commit of new about:weave 2009-08-18 20:03:11 -07:00
Edward Lee b2bd7b5d10 Put Annotations in Svc and expose a get/set Utils.anno call to use from bookmarks. 2009-08-13 17:59:26 -07:00
Edward Lee a77e420a8a Bug 507296 - Sync bookmarks and history in batched mode. r=thunder
Wrap the original SyncEngine._sync function with a call to runInBatchMode, so SQL disk writes happen at the end of batch mode instead of on every change.
2009-07-30 11:52:26 -07:00
Anant Narayanan f3887dcd50 Re-structure window utils 2009-07-28 14:30:32 -07:00
Edward Lee 0658441e64 Bug 506302 - Shorten stack traces
Trim the full path from JS stacks and just show the file and convert nsIException traces to look like js stacks: func()@file:line. Only difference is js stacks show arguments while nsIException always shows just (). Fix up some places where we print the exception instead of the fixed up string.
2009-07-24 15:28:42 -07:00
Edward Lee c1fd17eceb Bug 505940 - Unnecessarily uploading records on first sync
Remove short-circuit logic of comparing number of keys for deepEquals and iterate through each key on both objects to make sure both have the same value.
2009-07-22 23:49:15 -07:00
Anant Narayanan 454a197d48 Add ability to change passphrase (and merge XUL files) bug #443696 2009-07-21 16:54:46 -07:00
Edward Lee 39f903ac1b Bug 504256 - sync should observe idle service and only sync when the user is idle
Detect if the user has been recently active, and if so, skip the sync. Arbitrarily picking 30 seconds for now.
2009-07-17 16:55:15 -07:00
Edward Lee 2c6d25d3a2 Log jsonLoad/Save as trace instead of debug. 2009-07-14 18:44:41 -07:00
Edward Lee baa6609a31 merge weave. resolve addition of kSpecialIds to bookmarks.js near removal of Async.sugar. 2009-06-23 22:34:57 -07:00
Edward Lee 9be03ab0ef Bug 498924 - Refactor bookmark special ids out of BookmarksStore
Lazily load places ids for a given weave id/place name pair into kSpecialIds and update all consumers. Expose a Svc.Bookmark in utils.
2009-06-17 09:28:15 -07:00
Edward Lee 4ac23d2cab Remove async.js and wrap.js and remove remaining references to Async.sugar, etc. 2009-06-06 18:24:30 -05:00
Edward Lee c6ef99ffc0 Add a Utils.lock as a sync. version of Wrap.localLock. 2009-06-06 11:52:49 -07:00
Edward Lee d774dfb76b Add a Utils.catch as a sync. version of Wrap.catchAll. 2009-06-05 22:21:14 -07:00
Edward Lee e5c7999e86 Temporarily convert _notify to _notifyAsync and add a Utils.notify. 2009-06-05 15:34:23 -07:00
Edward Lee d611c2b661 Bug 493363 - Several issues in Utils.deepEquals()
Use triple-equals to determine if two things are the same; otherwise, check if both are objects with the same keys and same values for the keys.
2009-05-19 10:53:30 -05:00
Edward Lee aff1f185c3 Bug 488142 - Make it easier to add simple deferred cleartext/payload values
Add a couple Utils helper to create a pair of simple [gs]etters that use a hash property instead. Apply this to various records: WBORecord, {Priv,Pub}Key, Crypto{Meta,Wrapper}, and every engine's type records. Migrate by making sure key data exists (name change).
2009-04-13 16:39:29 -05:00
Edward Lee a5332e83ca Bug 487378 - Use the app name as the default client name
Use nsIXULAppInfo to get the name and remove Fennec specific bits.
2009-04-08 02:12:57 -05:00
Edward Lee 9a4da9c571 Add a Utils.isArray and use it 2009-04-07 16:45:29 -05:00
Edward Lee e9647a3977 Bug 486230 - Share json disk caching with Utils.json{Load,Save} 2009-03-31 19:52:16 -05:00
Edward Lee 3cead7f04b Bug 481741 - Switch to JSON from nsIJSON 2009-03-31 14:09:38 -05:00
Dan Mills a3416e7e05 make dialogs non-resizable, split lazy callbacks out 2009-03-25 19:28:46 -07:00
Edward Lee 1bb424e037 Bug 482900 - Provide a friendlier UI to choose which ways to sync data. r=thunder 2009-03-20 02:35:46 -07:00
Edward Lee 2e7546aa96 Bug 484144 - Make sync status dialog not modal. r=thunder 2009-03-20 00:11:04 -07:00
Edward Lee 44040f2ce9 More window/dialog cleanup for commonly used dialogs 2009-03-19 14:21:23 -07:00
Edward Lee 08bcb777cd :( trailing whitespace 2009-03-19 14:02:41 -07:00
Edward Lee 76a417ebc3 More services cleanup; Expose a Utils.openWindow/openDialog 2009-03-19 14:00:57 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local f014c6bb51 Was failing on Fennec because private browsing doesn't exist there -- now more gracefully handles missing components. 2009-03-10 17:12:59 -07:00
Edward Lee d8fef43b78 Bug 481345 - Weave should be disabled while offline or private browsing mode is active. r=thunder 2009-03-10 06:30:36 -05:00
Edward Lee e7a623aaec Bug 482178 - Clean up services -> lazy services. r=thunder 2009-03-10 06:30:30 -05:00
Dan Mills 85834524e0 Switch away from __defineGetter__ due to bug 481104; explicitly cache logins in password engine; whitespace fixes 2009-03-02 18:55:26 -08:00
Anant Narayanan 33a1012482 Password sync for 0.3 (bug #468697) 2009-03-03 00:42:57 +01:00
Dan Mills 09f5120a3a use Gecko's version comparison API, don't clobber the server if the remote version > local client version 2009-02-23 12:36:55 -08:00
Dan Mills 5a2bbe124d add makeURL function (returns an nsIURL), and add Svc.Memory (for memory service) 2009-02-11 19:19:04 -08:00
Dan Mills cf68f2b71f put prefs branch into Svc.Prefs 2009-02-10 00:52:05 -08:00
Dan Mills 3cedb09d82 Make records not extend Resource, instead they have a serialize() method that can be used to create a Resource for uploading if necessary.
Use global service instances under Svc.*
Consolidate various record managers (caches/convenience factories) to extend the same base object
Log exceptions caught by notify wrapper
2009-01-27 13:35:10 -08:00
Dan Mills df6f18b5ca catch undefined URIs in makeURI; use Svc global to cache IO service 2009-01-07 14:22:02 -08:00
Dan Mills 3079faacf5 add clients sync (list of clients with names and types); make it simpler to create Engine subclasses; remove the 2nd 'authenticator' parameter for Resources; resetServer is now wipeServer; consider 0 an invalid place ID (fixes bug when calculating item depths); add a Svc global exported from utils.js where commonly used services can live 2009-01-06 13:54:18 -08:00
Dan Mills 4e03472ec3 add debug for when setting password 2008-12-01 20:01:12 -08:00
Dan Mills c61ef38151 change chrome url for weave passwords in login manager to chrome://weave 2008-12-01 19:04:49 -08:00
Dan Mills 4417f60124 print exception in async stack traces, skip async frames in async stack traces 2008-11-06 17:34:34 -08:00
Dan Mills db796cabb8 makeUri: don't throw on invalid uris, return null instead 2008-11-03 14:56:56 -08:00
Dan Mills ccaa17d552 Bug 450526: fix tag sync bug created by a typo in deepCopy. Fix by Mishail <mishail.mishail@gmail.com> 2008-08-14 17:23:11 -07:00
Dan Mills ac61d5ab82 fix typo in utils deepCopy 2008-07-30 23:37:21 -07:00
Dan Mills 39b90d3639 when making deep copies of an object, default to alphabetically sorting the properties for adding 2008-07-23 15:46:48 -07:00
Dan Mills d01bd7d888 allow deep copies of objects to optionally copy object properties in alphabetical order. This is useful to guarantee the order in which they would be serialized as json (which may depend on the order in which properties are added) 2008-07-16 19:36:06 -07:00
Dan Mills 115e70bcba move formatAsyncFrame to utils, don't print 'regular' stack trace when we have an async exception (it's not useful) 2008-07-11 13:40:06 -07:00
Atul Varma 324ad97fb0 Refactored the exception-handling code a bit and made traces produced by async look more like they used to. 2008-07-01 12:03:05 -07:00
Anant Narayanan b580a586dc Prevent multiple lock requests from being executed (bug 441922, r=thunder) 2008-06-26 11:15:02 -07:00
Anant Narayanan 19b2afb2b9 Remove runCmd and other openssl related stuff we no longer need. (bug 441898, r=thunder) 2008-06-25 17:10:24 -07:00
Atul Varma 2e2db69479 Changed AsyncException so that it dynamically subclasses the exception it's wrapping, and adds an 'asyncStack' property to allow access to the asynchronous call stack. This, along with my previous few commits, makes the processing of stack traces in our code much more streamlined, and also allows our debugging output to be more informative, as stack information is now logged from the point at which an exception was thrown, rather than the point at which it was caught.
Also renamed some things in async.js to be more descriptive and easier-to-understand, albeit a bit more verbose.
2008-06-25 04:43:07 -07:00
Atul Varma 323d7df694 Made exception logging routines more informative and added logtests for them. 2008-06-25 00:13:36 -07:00
Atul Varma 15d84c6df5 Refactoring: consolidated duplicate code creating GUIDs via XPCOM gunk into a new function, Utils.makeGUID().
Note that there are some strange things re: whitespace in engines/bookmarks.js in this changeset; I literally only changed one line, though, and I'm not sure where they came from.  Maybe it was js2-mode?
2008-06-20 12:34:29 -07:00
Atul Varma 7809c95d7d Refactored some file operations into a new function in Utils and out of engines.js. 2008-06-18 14:12:24 -07:00
Atul Varma b48aab609f Moved XPCOM-specific stuff from engines/passwords.js to util.js so they could be easily stubbed-out by unit tests. 2008-06-18 11:54:24 -07:00
Atul Varma 8181559fa4 Refactored test_service and module code so that the weave service constructor is called, and auth is done more accurately. 2008-06-17 19:54:09 -07:00
Atul Varma 89886c8e2e Fixed a minor typo, though there's a better way to do the unary getter which Myk told me about; will probably substitute that soon. 2008-06-17 11:11:56 -07:00
Atul Varma 6826c19d20 Fixed a strict warning in util.js. 2008-06-16 18:11:41 -07:00
Atul Varma c040b0cc2f Refactoring: made a new function, Utils.makeTimerForCall(), which is used by test suites and async.js. 2008-06-09 19:30:11 -07:00
Dan Mills 9316037c2c remove some debugging output, fix some remaining array detection code 2008-05-24 17:30:22 -07:00
Dan Mills 38997acef8 continue sync of other engines even after one of them throws an exception; use constructor name instead of instanceof to check for array object in modules 2008-05-23 23:58:53 -07:00
Atul Varma 2802dad13d Fixed a variety of style issues and minor warnings raised by js2-mode. 2008-05-23 11:05:42 -07:00
Dan Mills 017524a4d0 Various improvements:
* async generators: much better stack traces
* dav: use global identity system rather than login/logout to manage
  usernames and passwords.
* dav: there is a checkLogin() instead of login() which can be used to
  verify auth at any time.
* dav: make it so that we can (only internally atm) hold multiple
  locks for different URLs.
* identity: add an identity manager singleton service to keep
  identities globally, referenced by a name, with aliasing support (so
  e.g., dav can ask for the 'dav' identity, while something else can
  alias 'dav' to another identity).
* service: keep track of logged in status here, rather than in the dav
  service.  Use the global id manager.
2008-04-10 21:38:15 -07:00
Dan Mills 4bbd3af126 add sharing ui+backend code (not working yet); make engines less chatty when applying commands 2008-03-25 23:01:34 -07:00
Dan Mills 89a59249b4 make service.js the main entry point from chrome/content; make the service be lazy-loaded; make crypto be lazy-loaded 2008-03-25 15:14:00 -07:00
Dan Mills 1908175a9c split up/simplify login functions; add a global (server-wide) storage version; wipe server for storage version upgrades 2008-03-19 18:42:12 -07:00
Dan Mills 384d06b7c6 Various improvements:
* Logging improvements / default log levels tweaked.  Less chatty now.
  Ability to tweak log levels of individual loggers via prefs.
* Various crypto module fixes, specially for RSA.
* 'service' lock removed, reuses server lock now.  dav module supports
  temporarily blocking locks to simulate the 'service' lock (login()
  needs this, since dav is not configured at that time).
* PKI support: data encryption uses randomly-generated symmetric keys,
  which are then encrypted with RSA public keys and stored on the
  server.
2008-03-19 15:17:04 -07:00
Dan Mills 056dc3d2eb add a dav method for getting a list of server files/directories; delete all server data when private key isn't found (this will cause everyone's server data to get wiped, since no one has a key yet); fix a bug in checkStatus with specific status codes (as opposed to ranges) 2008-03-07 04:20:55 -08:00
Dan Mills 99333d3c98 Asynchronous generator helpers rework + PKI work
* Async helpers are in a module of their own now
* Async routines have simpler semantics now.  onComplete handlers are taken care of by the helpers.  Exceptions are bubbled up across nested asynchronous generators
* Stack traces are automatically logged for unhandled exceptions
* Async generators are now allowed to 'bottom out' (StopIteration is ignored) - this is configurable.
* RSA key generation fixes
* On login we now create an RSA keypair, encrypt the private one with PBE, and upload them to the server
* Log files are now limited to 2MB (down from 5)
2008-03-07 01:56:36 -08:00
Dan Mills 019a0c8e6c switch to nsIJSON for JSON parsing and output. add a deepCopy function instead of using eval(uneval()). make *sure* to read and write UTF-8 to files. bump version 2008-03-05 00:00:56 -08:00
Dan Mills 597fef2a0e use a scriptableinputstream to correctly read openssl output 2008-02-19 20:53:01 -08:00
Dan Mills e5769661ad flesh out openssl code; still needs more work 2008-02-19 11:39:39 -08:00
Dan Mills 907f537607 put utility functions in an object to avoid namespace pollution 2008-02-13 14:30:44 -08:00
Dan Mills e81f3184d4 create user directories when they don't exist - good for personal webdav servers 2008-02-08 01:03:45 -08:00
Dan Mills 58454da1d0 add openssl support 2008-02-05 14:15:53 -08:00
Dan Mills dee6b23c4d some more cleanup/refactoring; add history engine/core/store (history sync\!) 2007-12-14 18:07:25 -08:00
Dan Mills 8c9defe994 assume in loaded modules that the resource:// alias has already been added - remove all the templatey code to do that 2007-12-11 11:57:13 -08:00
Dan Mills 085f383f57 more and more refactoring: split weave module into multiple files (finally!) 2007-12-10 21:38:53 -08:00