зеркало из https://github.com/mozilla/gecko-dev.git
Bug 964186 - Rename MozNdefRecord to MozNDEFRecord. r=smaug, sr=sicking
--HG-- rename : dom/nfc/MozNdefRecord.cpp => dom/nfc/MozNDEFRecord.cpp rename : dom/nfc/MozNdefRecord.h => dom/nfc/MozNDEFRecord.h rename : dom/webidl/MozNdefRecord.webidl => dom/webidl/MozNDEFRecord.webidl
This commit is contained in:
Родитель
3b46536f58
Коммит
625122c983
|
@ -6,8 +6,8 @@
|
|||
|
||||
/* Copyright © 2013 Deutsche Telekom, Inc. */
|
||||
|
||||
#include "MozNdefRecord.h"
|
||||
#include "mozilla/dom/MozNdefRecordBinding.h"
|
||||
#include "MozNDEFRecord.h"
|
||||
#include "mozilla/dom/MozNDEFRecordBinding.h"
|
||||
#include "mozilla/HoldDropJSObjects.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
|
@ -16,40 +16,40 @@ namespace mozilla {
|
|||
namespace dom {
|
||||
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(MozNdefRecord)
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(MozNDEFRecord)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(MozNdefRecord)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(MozNDEFRecord)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mWindow)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(MozNdefRecord)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(MozNDEFRecord)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindow)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(MozNdefRecord)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(MozNDEFRecord)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mType)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mId)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mPayload)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(MozNdefRecord)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(MozNdefRecord)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(MozNdefRecord)
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(MozNDEFRecord)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(MozNDEFRecord)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(MozNDEFRecord)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
void
|
||||
MozNdefRecord::HoldData()
|
||||
MozNDEFRecord::HoldData()
|
||||
{
|
||||
mozilla::HoldJSObjects(this);
|
||||
}
|
||||
|
||||
void
|
||||
MozNdefRecord::DropData()
|
||||
MozNDEFRecord::DropData()
|
||||
{
|
||||
if (mType) {
|
||||
mType = nullptr;
|
||||
|
@ -64,8 +64,8 @@ MozNdefRecord::DropData()
|
|||
}
|
||||
|
||||
/* static */
|
||||
already_AddRefed<MozNdefRecord>
|
||||
MozNdefRecord::Constructor(const GlobalObject& aGlobal,
|
||||
already_AddRefed<MozNDEFRecord>
|
||||
MozNDEFRecord::Constructor(const GlobalObject& aGlobal,
|
||||
uint8_t aTnf, const Uint8Array& aType,
|
||||
const Uint8Array& aId, const Uint8Array& aPayload,
|
||||
ErrorResult& aRv)
|
||||
|
@ -76,7 +76,7 @@ MozNdefRecord::Constructor(const GlobalObject& aGlobal,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
nsRefPtr<MozNdefRecord> ndefrecord = new MozNdefRecord(aGlobal.GetContext(),
|
||||
nsRefPtr<MozNDEFRecord> ndefrecord = new MozNDEFRecord(aGlobal.GetContext(),
|
||||
win, aTnf, aType, aId,
|
||||
aPayload);
|
||||
if (!ndefrecord) {
|
||||
|
@ -86,7 +86,7 @@ MozNdefRecord::Constructor(const GlobalObject& aGlobal,
|
|||
return ndefrecord.forget();
|
||||
}
|
||||
|
||||
MozNdefRecord::MozNdefRecord(JSContext* aCx, nsPIDOMWindow* aWindow,
|
||||
MozNDEFRecord::MozNDEFRecord(JSContext* aCx, nsPIDOMWindow* aWindow,
|
||||
uint8_t aTnf, const Uint8Array& aType,
|
||||
const Uint8Array& aId, const Uint8Array& aPayload)
|
||||
: mTnf(aTnf)
|
||||
|
@ -101,15 +101,15 @@ MozNdefRecord::MozNdefRecord(JSContext* aCx, nsPIDOMWindow* aWindow,
|
|||
HoldData();
|
||||
}
|
||||
|
||||
MozNdefRecord::~MozNdefRecord()
|
||||
MozNDEFRecord::~MozNDEFRecord()
|
||||
{
|
||||
DropData();
|
||||
}
|
||||
|
||||
JSObject*
|
||||
MozNdefRecord::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
|
||||
MozNDEFRecord::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
|
||||
{
|
||||
return MozNdefRecordBinding::Wrap(aCx, aScope, this);
|
||||
return MozNDEFRecordBinding::Wrap(aCx, aScope, this);
|
||||
}
|
||||
|
||||
} // namespace dom
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
/* Copyright © 2013 Deutsche Telekom, Inc. */
|
||||
|
||||
#ifndef mozilla_dom_MozNdefRecord_h__
|
||||
#define mozilla_dom_MozNdefRecord_h__
|
||||
#ifndef mozilla_dom_MozNDEFRecord_h__
|
||||
#define mozilla_dom_MozNDEFRecord_h__
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
|
@ -26,20 +26,20 @@ struct JSContext;
|
|||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class MozNdefRecord MOZ_FINAL : public nsISupports,
|
||||
class MozNDEFRecord MOZ_FINAL : public nsISupports,
|
||||
public nsWrapperCache
|
||||
{
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MozNdefRecord)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MozNDEFRecord)
|
||||
|
||||
public:
|
||||
|
||||
MozNdefRecord(JSContext* aCx, nsPIDOMWindow* aWindow, uint8_t aTnf,
|
||||
MozNDEFRecord(JSContext* aCx, nsPIDOMWindow* aWindow, uint8_t aTnf,
|
||||
const Uint8Array& aType, const Uint8Array& aId,
|
||||
const Uint8Array& aPlayload);
|
||||
|
||||
~MozNdefRecord();
|
||||
~MozNDEFRecord();
|
||||
|
||||
nsIDOMWindow* GetParentObject() const
|
||||
{
|
||||
|
@ -49,7 +49,7 @@ public:
|
|||
virtual JSObject* WrapObject(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
|
||||
|
||||
static already_AddRefed<MozNdefRecord>
|
||||
static already_AddRefed<MozNDEFRecord>
|
||||
Constructor(const GlobalObject& aGlobal, uint8_t aTnf,
|
||||
const Uint8Array& aType, const Uint8Array& aId,
|
||||
const Uint8Array& aPayload, ErrorResult& aRv);
|
||||
|
@ -90,7 +90,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
MozNdefRecord() MOZ_DELETE;
|
||||
MozNDEFRecord() MOZ_DELETE;
|
||||
nsRefPtr<nsPIDOMWindow> mWindow;
|
||||
void HoldData();
|
||||
void DropData();
|
||||
|
@ -104,4 +104,4 @@ private:
|
|||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_dom_MozNdefRecord_h__
|
||||
#endif // mozilla_dom_MozNDEFRecord_h__
|
|
@ -7,10 +7,10 @@
|
|||
|
||||
if CONFIG['MOZ_NFC']:
|
||||
EXPORTS.mozilla.dom += [
|
||||
'MozNdefRecord.h',
|
||||
'MozNDEFRecord.h',
|
||||
]
|
||||
SOURCES += [
|
||||
'MozNdefRecord.cpp',
|
||||
'MozNDEFRecord.cpp',
|
||||
]
|
||||
EXTRA_COMPONENTS += [
|
||||
'nsNfc.js',
|
||||
|
|
|
@ -92,7 +92,7 @@ NfcContentHelper.prototype = {
|
|||
* Strings such as 'type', 'id' 'payload' will not be acccessible to NfcWorker.
|
||||
* Therefore this function exists till the bug is addressed.
|
||||
*/
|
||||
encodeNdefRecords: function encodeNdefRecords(records) {
|
||||
encodeNDEFRecords: function encodeNDEFRecords(records) {
|
||||
let encodedRecords = [];
|
||||
for (let i = 0; i < records.length; i++) {
|
||||
let record = records[i];
|
||||
|
@ -161,7 +161,7 @@ NfcContentHelper.prototype = {
|
|||
let requestId = btoa(this.getRequestId(request));
|
||||
this._requestMap[requestId] = window;
|
||||
|
||||
let encodedRecords = this.encodeNdefRecords(records);
|
||||
let encodedRecords = this.encodeNDEFRecords(records);
|
||||
cpmm.sendAsyncMessage("NFC:WriteNDEF", {
|
||||
requestId: requestId,
|
||||
sessionToken: sessionToken,
|
||||
|
@ -390,7 +390,7 @@ NfcContentHelper.prototype = {
|
|||
let ndefMsg = [];
|
||||
for (let i = 0; i < records.length; i++) {
|
||||
let record = records[i];
|
||||
ndefMsg.push(new requester.MozNdefRecord(record.tnf,
|
||||
ndefMsg.push(new requester.MozNDEFRecord(record.tnf,
|
||||
record.type,
|
||||
record.id,
|
||||
record.payload));
|
||||
|
|
|
@ -643,7 +643,7 @@ var interfaceNamesInGlobalScope =
|
|||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
"MozNamedAttrMap",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "MozNdefRecord", b2g: true},
|
||||
{name: "MozNDEFRecord", b2g: true},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "MozNFCPeer", b2g: true},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* Copyright © 2013 Deutsche Telekom, Inc. */
|
||||
|
||||
[Constructor(octet tnf, Uint8Array type, Uint8Array id, Uint8Array payload)]
|
||||
interface MozNdefRecord
|
||||
interface MozNDEFRecord
|
||||
{
|
||||
/**
|
||||
* Type Name Field (3-bits) - Specifies the NDEF record type in general.
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
[JSImplementation="@mozilla.org/nfc/NFCPeer;1"]
|
||||
interface MozNFCPeer {
|
||||
DOMRequest sendNDEF(sequence<MozNdefRecord> records);
|
||||
DOMRequest sendNDEF(sequence<MozNDEFRecord> records);
|
||||
DOMRequest sendFile(Blob blob);
|
||||
};
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ enum NFCTechType {
|
|||
interface MozNFCTag {
|
||||
DOMRequest getDetailsNDEF();
|
||||
DOMRequest readNDEF();
|
||||
DOMRequest writeNDEF(sequence<MozNdefRecord> records);
|
||||
DOMRequest writeNDEF(sequence<MozNDEFRecord> records);
|
||||
DOMRequest makeReadOnlyNDEF();
|
||||
|
||||
DOMRequest connect(NFCTechType techType);
|
||||
|
|
|
@ -529,7 +529,7 @@ if CONFIG['MOZ_B2G_RIL']:
|
|||
|
||||
if CONFIG['MOZ_NFC']:
|
||||
WEBIDL_FILES += [
|
||||
'MozNdefRecord.webidl',
|
||||
'MozNDEFRecord.webidl',
|
||||
'MozNfc.webidl',
|
||||
'MozNFCPeer.webidl',
|
||||
'MozNFCTag.webidl',
|
||||
|
|
Загрузка…
Ссылка в новой задаче