Bug 1055560 - Part 1: DOM Change. r=smaug

This commit is contained in:
Yoshi Huang 2014-08-20 17:35:18 +08:00
parent 448b6aebba
commit 7bf102aa79
2 changed files with 16 additions and 13 deletions

View File

@ -15,6 +15,7 @@
#include "nsWrapperCache.h"
#include "jsapi.h"
#include "mozilla/dom/MozNDEFRecordBinding.h"
#include "mozilla/dom/TypedArray.h"
#include "jsfriendapi.h"
#include "js/GCAPI.h"
@ -53,7 +54,7 @@ public:
const MozNDEFRecordOptions& aOptions,
ErrorResult& aRv);
uint8_t Tnf() const
TNF Tnf() const
{
return mTnf;
}
@ -88,7 +89,7 @@ private:
void HoldData();
void DropData();
uint8_t mTnf;
TNF mTnf;
JS::Heap<JSObject*> mType;
JS::Heap<JSObject*> mId;
JS::Heap<JSObject*> mPayload;

View File

@ -5,22 +5,24 @@
/* Copyright © 2013 Deutsche Telekom, Inc. */
enum TNF {
"empty",
"well-known",
"media-type",
"absolute-uri",
"external",
"unknown",
"unchanged"
};
[Constructor(optional MozNDEFRecordOptions options)]
interface MozNDEFRecord
{
/**
* Type Name Field (3-bits) - Specifies the NDEF record type in general.
* tnf_empty: 0x00
* tnf_well_known: 0x01
* tnf_mime_media: 0x02
* tnf_absolute_uri: 0x03
* tnf_external type: 0x04
* tnf_unknown: 0x05
* tnf_unchanged: 0x06
* tnf_reserved: 0x07
* Type Name Field - Specifies the NDEF record type in general.
*/
[Constant]
readonly attribute octet tnf;
readonly attribute TNF tnf;
/**
* type - Describes the content of the payload. This can be a mime type.
@ -43,7 +45,7 @@ interface MozNDEFRecord
};
dictionary MozNDEFRecordOptions {
octet tnf = 0; // default to tnf_empty.
TNF tnf = "empty";
Uint8Array type;
Uint8Array id;
Uint8Array payload;