/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use std::{cell::RefCell, fmt::Write, mem, sync::Arc};
use atomic_refcell::AtomicRefCell; use dogear::Store; use moz_task::{Task, TaskRunnable, ThreadPtrHandle, ThreadPtrHolder}; use nserror::{nsresult, NS_ERROR_NOT_AVAILABLE, NS_OK}; use nsstring::nsString; use storage::Conn; use xpcom::{
interfaces::{
mozIPlacesPendingOperation, mozIStorageConnection, mozISyncedBookmarksMirrorCallback,
mozISyncedBookmarksMirrorProgressListener,
},
RefPtr, XpCom,
};
fn merge(&self) -> error::Result<store::ApplyStatus> { letmut db = self.db.clone(); if db.transaction_in_progress()? { // If a transaction is already open, we can avoid an unnecessary // merge, since we won't be able to apply the merged tree back to // Places. This is common, especially if the user makes lots of // changes at once. In that case, our merge task might run in the // middle of a `Sqlite.sys.mjs` transaction, and fail when we try to // open our own transaction in `Store::apply`. Since the local // tree might be in an inconsistent state, we can't safely update // Places. return Err(error::Error::StorageBusy);
} let driver = Driver::new(self.progress.clone()); letmut store = store::Store::new(
&mut db,
&driver,
&self.controller, self.local_time_millis, self.remote_time_millis,
);
store.validate()?;
store.prepare()?; let status = store.merge_with_driver(&driver, &*self.controller)?;
Ok(status)
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.