mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 957086 - patch 1 - nsIDataStore instead DataStore.jsm, r=ehsan
--HG-- rename : dom/datastore/DataStoreImpl.jsm => dom/datastore/DataStoreImpl.js
This commit is contained in:
parent
a75e202c68
commit
1900e87270
@ -814,6 +814,7 @@ bin/components/@DLL_PREFIX@nkgnomevfs@DLL_SUFFIX@
|
||||
|
||||
@BINPATH@/components/DataStore.manifest
|
||||
@BINPATH@/components/DataStoreService.js
|
||||
@BINPATH@/components/DataStoreImpl.js
|
||||
@BINPATH@/components/dom_datastore.xpt
|
||||
|
||||
#ifdef MOZ_WEBSPEECH
|
||||
|
@ -858,6 +858,7 @@ bin/libfreebl_32int64_3.so
|
||||
|
||||
@BINPATH@/components/DataStore.manifest
|
||||
@BINPATH@/components/DataStoreService.js
|
||||
@BINPATH@/components/DataStoreImpl.js
|
||||
@BINPATH@/components/dom_datastore.xpt
|
||||
|
||||
|
||||
|
@ -1,2 +1,4 @@
|
||||
component {db5c9602-030f-4bff-a3de-881a8de370f2} DataStoreImpl.js
|
||||
contract @mozilla.org/dom/datastore;1 {db5c9602-030f-4bff-a3de-881a8de370f2}
|
||||
component {d193d0e2-c677-4a7b-bb0a-19155b470f2e} DataStoreService.js
|
||||
contract @mozilla.org/datastore-service;1 {d193d0e2-c677-4a7b-bb0a-19155b470f2e}
|
||||
|
@ -6,8 +6,6 @@
|
||||
|
||||
'use strict'
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["DataStore"];
|
||||
|
||||
function debug(s) {
|
||||
//dump('DEBUG DataStore: ' + s + '\n');
|
||||
}
|
||||
@ -59,17 +57,17 @@ function validateId(aId) {
|
||||
}
|
||||
|
||||
/* DataStore object */
|
||||
this.DataStore = function(aWindow, aName, aOwner, aReadOnly) {
|
||||
function DataStore() {
|
||||
debug("DataStore created");
|
||||
this.init(aWindow, aName, aOwner, aReadOnly);
|
||||
this.wrappedJSObject = this;
|
||||
}
|
||||
|
||||
this.DataStore.prototype = {
|
||||
DataStore.prototype = {
|
||||
classDescription: "DataStore XPCOM Component",
|
||||
classID: Components.ID("{db5c9602-030f-4bff-a3de-881a8de370f2}"),
|
||||
contractID: "@mozilla.org/dom/datastore-impl;1",
|
||||
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsISupports,
|
||||
Components.interfaces.nsIObserver]),
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIDataStore, Ci.nsISupports,
|
||||
Ci.nsIObserver]),
|
||||
|
||||
callbacks: [],
|
||||
|
||||
@ -536,3 +534,5 @@ this.DataStore.prototype = {
|
||||
return exposedCursor;
|
||||
}
|
||||
};
|
||||
|
||||
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DataStore]);
|
@ -16,7 +16,6 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
|
||||
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
|
||||
Cu.import('resource://gre/modules/Services.jsm');
|
||||
Cu.import('resource://gre/modules/DataStoreImpl.jsm');
|
||||
Cu.import("resource://gre/modules/DataStoreDB.jsm");
|
||||
Cu.import("resource://gre/modules/DOMRequestHelper.jsm");
|
||||
|
||||
@ -350,10 +349,16 @@ DataStoreService.prototype = {
|
||||
}
|
||||
|
||||
for (let i = 0; i < aStores.length; ++i) {
|
||||
let obj = new DataStore(aWindow, aStores[i].name,
|
||||
aStores[i].owner, aStores[i].readOnly);
|
||||
let obj = Cc["@mozilla.org/dom/datastore;1"]
|
||||
.createInstance(Ci.nsIDataStore);
|
||||
if (!obj || !obj.wrappedJSObject) {
|
||||
dump("Failed to create a DataStore object.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
let storeImpl = aWindow.DataStoreImpl._create(aWindow, obj);
|
||||
obj.init(aWindow, aStores[i].name, aStores[i].owner, aStores[i].readOnly);
|
||||
|
||||
let storeImpl = aWindow.DataStoreImpl._create(aWindow, obj.wrappedJSObject);
|
||||
|
||||
let exposedStore = new aWindow.DataStore();
|
||||
exposedStore.setDataStoreImpl(storeImpl);
|
||||
|
@ -5,6 +5,7 @@
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'nsIDataStore.idl',
|
||||
'nsIDataStoreService.idl',
|
||||
]
|
||||
|
||||
@ -26,6 +27,7 @@ LOCAL_INCLUDES += [
|
||||
|
||||
EXTRA_COMPONENTS += [
|
||||
'DataStore.manifest',
|
||||
'DataStoreImpl.js',
|
||||
'DataStoreService.js',
|
||||
]
|
||||
|
||||
@ -33,7 +35,6 @@ EXTRA_JS_MODULES += [
|
||||
'DataStoreChangeNotifier.jsm',
|
||||
'DataStoreCursorImpl.jsm',
|
||||
'DataStoreDB.jsm',
|
||||
'DataStoreImpl.jsm',
|
||||
'DataStoreServiceInternal.jsm',
|
||||
]
|
||||
|
||||
|
23
dom/datastore/nsIDataStore.idl
Normal file
23
dom/datastore/nsIDataStore.idl
Normal file
@ -0,0 +1,23 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMWindow;
|
||||
|
||||
// NOTE: This is a temporary interface.
|
||||
// It will be removed in the next patches for rewriting DataStore in C++.
|
||||
[scriptable, uuid(0b41fef5-14ba-48b0-923c-3d8fb64692ae)]
|
||||
interface nsIDataStore : nsISupports
|
||||
{
|
||||
void init(in nsIDOMWindow window,
|
||||
in DOMString name,
|
||||
in DOMString manifestURL,
|
||||
in boolean readOnly);
|
||||
|
||||
attribute jsval exposedObject;
|
||||
|
||||
void retrieveRevisionId(in jsval cb);
|
||||
};
|
@ -625,4 +625,5 @@ bin/components/@DLL_PREFIX@nkgnomevfs@DLL_SUFFIX@
|
||||
|
||||
@BINPATH@/components/DataStore.manifest
|
||||
@BINPATH@/components/DataStoreService.js
|
||||
@BINPATH@/components/DataStoreImpl.js
|
||||
@BINPATH@/components/dom_datastore.xpt
|
||||
|
Loading…
Reference in New Issue
Block a user