• Leon Han's avatar
    Reland "[webnfc] Refactor/Refine impl for "Creating Web NFC message" algorithm" · 59d962b4
    Leon Han authored
    This is a reland of 581b273e
    
    Original change's description:
    > [webnfc] Refactor/Refine impl for "Creating Web NFC message" algorithm
    >
    > This CL implements strictly the "Creating Web NFC message" algorithm
    > described at http://w3c.github.io/web-nfc/#creating-web-nfc-message.
    >
    > 1.
    > Changes the Web IDL definition for NDEFRecordData from
    > "typedef (DOMString or unrestricted double or ArrayBuffer or Dictionary) NDEFRecordData;"
    > to
    > "typedef any NDEFRecordData;"
    >
    > 2.
    > Adds verification of NDEFRecordInit when creating NDEFRecord, i.e. makes
    > NDEFRecord ctor throw exceptions in case of invalid NDEFRecordInit.
    > Also, the same thing for NDEFMessage and NFCReadingEvent.
    >
    > 3.
    > Changes code flow for Step 10.9 of "9.10.1 The push() method" described
    > at https://w3c.github.io/web-nfc/#the-push-method.
    > "
    > Let output be the notation for the NDEF message to be created by UA, as
    > the result of passing message to create Web NFC message. If this throws
    > an exception, reject p with that exception and abort these steps.
    > "
    > Previously,
    >   NDEFMessageSource (NDEFMessageInit) -Validity check->
    >   -Mojo TypeConverter-> Mojom NDEFMessagePtr
    > Now,
    >   Remove "Validity check" and "Mojo TypeConverter" mentioned above,
    >   instead, we reuse the process of creating NDEFMessage from
    >   NDEFMessageSource (NDEFMessageInit), then the next step converting
    >   NDEFMessage to Mojom NDEFMessagePtr is quite an easy job.
    >
    > BUG=520391
    >
    > Change-Id: I628981e556f89ffdd0f883da0cfa99b20a6f8300
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1767719
    > Commit-Queue: Leon Han <leon.han@intel.com>
    > Reviewed-by: Daniel Cheng <dcheng@chromium.org>
    > Reviewed-by: Reilly Grant <reillyg@chromium.org>
    > Reviewed-by: Rijubrata Bhaumik <rijubrata.bhaumik@intel.com>
    > Cr-Commit-Position: refs/heads/master@{#693539}
    
    Bug: 520391,923974
    TBR: dcheng@,reillyg@
    Change-Id: I608e28638c0909c9d4f675774514cd990f9878c8
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1787557
    Commit-Queue: Leon Han <leon.han@intel.com>
    Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#693638}
    59d962b4
nfc_utils.cc 4.71 KB