B2G/gecko/browser/components/places/content/bookmarkProperties.js
/**
   * Returns a transaction for creating a new bookmark item representing the
   * various fields and opening arguments of the dialog.
   */
Returns a transaction for creating a new bookmark item representing the
various fields and opening arguments of the dialog.
Returns a transaction for creating a new bookmark item representing the various fields and opening arguments of the dialog .
function BPP__getCreateNewBookmarkTransaction(aContainer, aIndex) {
    var annotations = [];
    var childTransactions = [];
    if (this._description) {
      let annoObj = { name   : PlacesUIUtils.DESCRIPTION_ANNO,
                      type   : Ci.nsIAnnotationService.TYPE_STRING,
                      flags  : 0,
                      value  : this._description,
                      expires: Ci.nsIAnnotationService.EXPIRE_NEVER };
      let editItemTxn = new PlacesSetItemAnnotationTransaction(-1, annoObj);
      childTransactions.push(editItemTxn);
    }
    if (this._loadInSidebar) {
      let annoObj = { name   : PlacesUIUtils.LOAD_IN_SIDEBAR_ANNO,
                      type   : Ci.nsIAnnotationService.TYPE_INT32,
                      flags  : 0,
                      value  : this._loadInSidebar,
                      expires: Ci.nsIAnnotationService.EXPIRE_NEVER };
      let setLoadTxn = new PlacesSetItemAnnotationTransaction(-1, annoObj);
      childTransactions.push(setLoadTxn);
    }
    if (this._postData) {
      let postDataTxn = new PlacesEditBookmarkPostDataTransaction(-1, this._postData);
      childTransactions.push(postDataTxn);
    }
    if (this._charSet)
      PlacesUtils.history.setCharsetForURI(this._uri, this._charSet);
    let createTxn = new PlacesCreateBookmarkTransaction(this._uri,
                                                        aContainer,
                                                        aIndex,
                                                        this._title,
                                                        this._keyword,
                                                        annotations,
                                                        childTransactions);
    return new PlacesAggregatedTransaction(this._getDialogTitle(),
                                           [createTxn]);
  }
function BPP__getCreateNewBookmarkTransaction ( aContainer , aIndex ) { var annotations = [ ] ; var childTransactions = [ ] ; if ( this . _description ) { let annoObj = { name : PlacesUIUtils . DESCRIPTION_ANNO , type : Ci . nsIAnnotationService . TYPE_STRING , flags : 0 , value : this . _description , expires : Ci . nsIAnnotationService . EXPIRE_NEVER } ; let editItemTxn = new PlacesSetItemAnnotationTransaction ( - 1 , annoObj ) ; childTransactions . push ( editItemTxn ) ; } if ( this . _loadInSidebar ) { let annoObj = { name : PlacesUIUtils . LOAD_IN_SIDEBAR_ANNO , type : Ci . nsIAnnotationService . TYPE_INT32 , flags : 0 , value : this . _loadInSidebar , expires : Ci . nsIAnnotationService . EXPIRE_NEVER } ; let setLoadTxn = new PlacesSetItemAnnotationTransaction ( - 1 , annoObj ) ; childTransactions . push ( setLoadTxn ) ; } if ( this . _postData ) { let postDataTxn = new PlacesEditBookmarkPostDataTransaction ( - 1 , this . _postData ) ; childTransactions . push ( postDataTxn ) ; } if ( this . _charSet ) PlacesUtils . history . setCharsetForURI ( this . _uri , this . _charSet ) ; let createTxn = new PlacesCreateBookmarkTransaction ( this . _uri , aContainer , aIndex , this . _title , this . _keyword , annotations , childTransactions ) ; return new PlacesAggregatedTransaction ( this . _getDialogTitle ( ) , [ createTxn ] ) ; }
Returns a transaction for creating a new bookmark item representing the
 various fields and opening arguments of the dialog.
Returns a transaction for creating a new bookmark item representing the various fields and opening arguments of the dialog .
//XXX TODO: this should be in a transaction!