Bug 964186 - Rename MozNdefRecord to MozNDEFRecord. r=smaug, sr=sicking
authorGarner Lee <garner.lee@telekom.com>
Tue, 28 Jan 2014 16:20:17 -0800
changeset 167709 0cd65176a922a690f86c2386f133ad509152d1eb
parent 167708 d5e4d89832ed5e4e7710f1841dc8ca9298e124aa
child 167710 1b0bf5ddb795df7743702e3fd8c55e1fca8abbb1
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewerssmaug, sicking
bugs964186
milestone30.0a1
Bug 964186 - Rename MozNdefRecord to MozNDEFRecord. r=smaug, sr=sicking
dom/nfc/MozNDEFRecord.cpp
dom/nfc/MozNDEFRecord.h
dom/nfc/MozNdefRecord.cpp
dom/nfc/MozNdefRecord.h
dom/nfc/moz.build
dom/system/gonk/NfcContentHelper.js
dom/tests/mochitest/general/test_interfaces.html
dom/webidl/MozNDEFRecord.webidl
dom/webidl/MozNFCPeer.webidl
dom/webidl/MozNFCTag.webidl
dom/webidl/MozNdefRecord.webidl
dom/webidl/moz.build
rename from dom/nfc/MozNdefRecord.cpp
rename to dom/nfc/MozNDEFRecord.cpp
--- a/dom/nfc/MozNdefRecord.cpp
+++ b/dom/nfc/MozNDEFRecord.cpp
@@ -1,116 +1,116 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* 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/. */
 
 /* 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"
 
 
 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;
   }
   if (mId) {
     mId = nullptr;
   }
   if (mPayload) {
     mPayload = nullptr;
   }
   mozilla::DropJSObjects(this);
 }
 
 /* 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)
 {
   nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(aGlobal.GetAsSupports());
   if (!win) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
-  nsRefPtr<MozNdefRecord> ndefrecord = new MozNdefRecord(aGlobal.GetContext(),
+  nsRefPtr<MozNDEFRecord> ndefrecord = new MozNDEFRecord(aGlobal.GetContext(),
                                                          win, aTnf, aType, aId,
                                                          aPayload);
   if (!ndefrecord) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
   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)
 {
   mWindow = aWindow; // For GetParentObject()
 
   mType = Uint8Array::Create(aCx, this, aType.Length(), aType.Data());
   mId = Uint8Array::Create(aCx, this, aId.Length(), aId.Data());
   mPayload = Uint8Array::Create(aCx, this, aPayload.Length(), aPayload.Data());
 
   SetIsDOMBinding();
   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
 } // namespace mozilla
rename from dom/nfc/MozNdefRecord.h
rename to dom/nfc/MozNDEFRecord.h
--- a/dom/nfc/MozNdefRecord.h
+++ b/dom/nfc/MozNDEFRecord.h
@@ -1,18 +1,18 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* 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/. */
 
 /* 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"
 #include "nsCycleCollectionParticipant.h"
 #include "nsWrapperCache.h"
 #include "jsapi.h"
 
 #include "nsIDocument.h"
@@ -21,40 +21,40 @@
 #include "jsfriendapi.h"
 #include "js/GCAPI.h"
 
 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
   {
     return mWindow;
   }
 
   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);
 
   uint8_t Tnf() const
   {
     return mTnf;
   }
@@ -85,23 +85,23 @@ public:
   }
   JSObject* GetPayloadObject() const
   {
     JS::ExposeObjectToActiveJS(mPayload);
     return mPayload;
   }
 
 private:
-  MozNdefRecord() MOZ_DELETE;
+  MozNDEFRecord() MOZ_DELETE;
   nsRefPtr<nsPIDOMWindow> mWindow;
   void HoldData();
   void DropData();
 
   uint8_t mTnf;
   JS::Heap<JSObject*> mType;
   JS::Heap<JSObject*> mId;
   JS::Heap<JSObject*> mPayload;
 };
 
 } // namespace dom
 } // namespace mozilla
 
-#endif // mozilla_dom_MozNdefRecord_h__
+#endif // mozilla_dom_MozNDEFRecord_h__
--- a/dom/nfc/moz.build
+++ b/dom/nfc/moz.build
@@ -2,20 +2,20 @@
 # 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/.
 #
 # Copyright © 2013 Deutsche Telekom, Inc.
 
 if CONFIG['MOZ_NFC']:
     EXPORTS.mozilla.dom += [
-        'MozNdefRecord.h',
+        'MozNDEFRecord.h',
     ]
     SOURCES += [
-        'MozNdefRecord.cpp',
+        'MozNDEFRecord.cpp',
     ]
     EXTRA_COMPONENTS += [
       'nsNfc.js',
       'nsNfc.manifest',
     ]
 
 FAIL_ON_WARNINGS = True
 
--- a/dom/system/gonk/NfcContentHelper.js
+++ b/dom/system/gonk/NfcContentHelper.js
@@ -87,17 +87,17 @@ NfcContentHelper.prototype = {
 
   _requestMap: null,
   peerEventsCallbackMap: null,
 
   /* TODO: Bug 815526: This is a limitation when a DOMString is used in sequences of Moz DOM Objects.
    *       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];
       encodedRecords.push({
         tnf: record.tnf,
         type: record.type,
         id: record.id,
         payload: record.payload,
@@ -156,17 +156,17 @@ NfcContentHelper.prototype = {
     if (window == null) {
       throw Components.Exception("Can't get window object",
                                   Cr.NS_ERROR_UNEXPECTED);
     }
     let request = Services.DOMRequest.createRequest(window);
     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,
       records: encodedRecords
     });
     return request;
   },
 
@@ -385,17 +385,17 @@ NfcContentHelper.prototype = {
     let requestId = atob(message.requestId);
 
     if (message.status !== NFC.GECKO_NFC_ERROR_SUCCESS) {
       this.fireRequestError(requestId, message.status);
     } else {
       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));
       }
       this.fireRequestSuccess(requestId, ndefMsg);
     }
   },
 
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -638,17 +638,17 @@ var interfaceNamesInGlobalScope =
     {name: "MozMobileConnectionArray", b2g: true, pref: "dom.mobileconnection.enabled"},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "MozMobileMessageManager",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "MozMobileMessageThread",
 // 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!
     {name: "MozNFCTag", b2g: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozOtaStatusEvent", b2g: true, pref: "dom.mobileconnection.enabled"},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "MozPowerManager",
rename from dom/webidl/MozNdefRecord.webidl
rename to dom/webidl/MozNDEFRecord.webidl
--- a/dom/webidl/MozNdefRecord.webidl
+++ b/dom/webidl/MozNDEFRecord.webidl
@@ -1,17 +1,17 @@
 /* -*- Mode: IDL; 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/. */
 
 /* 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.
    *   tnf_empty: 0x00
    *   tnf_well_known: 0x01
    *   tnf_mime_media: 0x02
    *   tnf_absolute_uri: 0x03
    *   tnf_external type: 0x04
--- a/dom/webidl/MozNFCPeer.webidl
+++ b/dom/webidl/MozNFCPeer.webidl
@@ -5,17 +5,17 @@
  * Part of this IDL file is from:
  * http://w3c.github.io/nfc/proposals/common/nfc.html#idl-def-NFCPeer
  *
  * Copyright © 2013 Deutsche Telekom, Inc.
  */
 
 [JSImplementation="@mozilla.org/nfc/NFCPeer;1"]
 interface MozNFCPeer {
-  DOMRequest sendNDEF(sequence<MozNdefRecord> records);
+  DOMRequest sendNDEF(sequence<MozNDEFRecord> records);
   DOMRequest sendFile(Blob blob);
 };
 
 // Mozilla Only
 partial interface MozNFCPeer {
   [ChromeOnly]
   attribute DOMString session;
   [ChromeOnly]
--- a/dom/webidl/MozNFCTag.webidl
+++ b/dom/webidl/MozNFCTag.webidl
@@ -22,17 +22,17 @@ enum NFCTechType {
   "P2P",
   "UNKNOWN_TECH"
 };
 
 [JSImplementation="@mozilla.org/nfc/NFCTag;1"]
 interface MozNFCTag {
   DOMRequest getDetailsNDEF();
   DOMRequest readNDEF();
-  DOMRequest writeNDEF(sequence<MozNdefRecord> records);
+  DOMRequest writeNDEF(sequence<MozNDEFRecord> records);
   DOMRequest makeReadOnlyNDEF();
 
   DOMRequest connect(NFCTechType techType);
   DOMRequest close();
 };
 
 // Mozilla Only
 partial interface MozNFCTag {
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -524,17 +524,17 @@ if CONFIG['MOZ_B2G_RIL']:
         'MozIcc.webidl',
         'MozMobileConnectionArray.webidl',
         'MozVoicemail.webidl',
         'MozVoicemailEvent.webidl',
     ]
 
 if CONFIG['MOZ_NFC']:
     WEBIDL_FILES += [
-         'MozNdefRecord.webidl',
+         'MozNDEFRecord.webidl',
          'MozNfc.webidl',
          'MozNFCPeer.webidl',
          'MozNFCTag.webidl',
     ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
     WEBIDL_FILES += [
         'MozSpeakerManager.webidl',