|
|
Created:
3 years, 7 months ago by shalamov Modified:
3 years, 7 months ago Reviewers:
Reilly Grant (use Gerrit) CC:
chromium-reviews, agrieve+watch_chromium.org Target Ref:
refs/heads/master Project:
chromium Visibility:
Public. |
Description[webnfc] Cancel nfc.push operation when timeout expires
This CL adds missing timeout handling functionality [1]. When user
provides timeout value for the push operation, and NFC tag is not
in proximity for the duration of timeout value, operation must be
rejected with timeout error. Unit test is added to test new
functionality.
https://w3c.github.io/web-nfc/#the-push-method (Step 14).
BUG=714037
Review-Url: https://codereview.chromium.org/2851453004
Cr-Commit-Position: refs/heads/master@{#469294}
Committed: https://chromium.googlesource.com/chromium/src/+/b49d34931454bc1fdffdba99d6a0b344430746b5
Patch Set 1 #
Total comments: 2
Patch Set 2 : Fix for review comments #
Total comments: 1
Patch Set 3 : Add more tests, fix for comment. #
Total comments: 1
Patch Set 4 : Don't check return value from postDelayed #
Messages
Total messages: 35 (24 generated)
The CQ bit was checked by alexander.shalamov@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
alexander.shalamov@intel.com changed reviewers: + reillyg@chromium.org
Reilly, could you please take a look? Thanks.
https://codereview.chromium.org/2851453004/diff/1/device/nfc/android/java/src... File device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java (right): https://codereview.chromium.org/2851453004/diff/1/device/nfc/android/java/src... device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java:183: mPendingPushOperation.complete(createError(NfcErrorType.OPERATION_CANCELLED)); Call cancelPushTimeoutTask() here so that we can assert that there is no pending timeout task in schedulePushTimeoutTask().
The CQ bit was checked by alexander.shalamov@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2851453004/diff/1/device/nfc/android/java/src... File device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java (right): https://codereview.chromium.org/2851453004/diff/1/device/nfc/android/java/src... device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java:183: mPendingPushOperation.complete(createError(NfcErrorType.OPERATION_CANCELLED)); On 2017/04/28 16:10:28, Reilly Grant wrote: > Call cancelPushTimeoutTask() here so that we can assert that there is no pending > timeout task in schedulePushTimeoutTask(). Done.
On 2017/04/28 16:10:28, Reilly Grant wrote: > Call cancelPushTimeoutTask() here so that we can assert that there is no pending > timeout task in schedulePushTimeoutTask(). Should I add assert in schedulePushTimeoutTask()?
Patchset #2 (id:20001) has been deleted
The CQ bit was checked by alexander.shalamov@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
On 2017/05/02 09:53:03, shalamov wrote: > On 2017/04/28 16:10:28, Reilly Grant wrote: > > Call cancelPushTimeoutTask() here so that we can assert that there is no > pending > > timeout task in schedulePushTimeoutTask(). > > Should I add assert in schedulePushTimeoutTask()? Yes. We should make the expected state transitions as clear as possible.
On 2017/05/02 15:41:23, Reilly Grant wrote: > On 2017/05/02 09:53:03, shalamov wrote: > > On 2017/04/28 16:10:28, Reilly Grant wrote: > > > Call cancelPushTimeoutTask() here so that we can assert that there is no > > pending > > > timeout task in schedulePushTimeoutTask(). > > > > Should I add assert in schedulePushTimeoutTask()? > > Yes. We should make the expected state transitions as clear as possible. Added. Line 627: assert mPushTimeoutRunnable == null;
https://codereview.chromium.org/2851453004/diff/40001/device/nfc/android/java... File device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java (right): https://codereview.chromium.org/2851453004/diff/40001/device/nfc/android/java... device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java:183: completePendingPushOperation(createError(NfcErrorType.OPERATION_CANCELLED)); The reason I suggested calling cancelPushTimeoutTask instead of completePendingPushOperation is that as written we will now always disable reader mode and then re-enable it. I'm not sure that churn is desirable.
The CQ bit was checked by alexander.shalamov@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2017/05/02 17:52:12, Reilly Grant wrote: > https://codereview.chromium.org/2851453004/diff/40001/device/nfc/android/java... > File device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java (right): > > https://codereview.chromium.org/2851453004/diff/40001/device/nfc/android/java... > device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java:183: > completePendingPushOperation(createError(NfcErrorType.OPERATION_CANCELLED)); > The reason I suggested calling cancelPushTimeoutTask instead of > completePendingPushOperation is that as written we will now always disable > reader mode and then re-enable it. I'm not sure that churn is desirable. Thanks, I missed that part when I refactored code. I added more tests for different cases related to timeout handling.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm with nit https://codereview.chromium.org/2851453004/diff/60001/device/nfc/android/java... File device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java (right): https://codereview.chromium.org/2851453004/diff/60001/device/nfc/android/java... device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java:647: return mPushTimeoutHandler.postDelayed(mPushTimeoutRunnable, (long) options.timeout); Since tasks are not guaranteed to run it isn't worth checking this return value.
The CQ bit was checked by alexander.shalamov@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by alexander.shalamov@intel.com
The patchset sent to the CQ was uploaded after l-g-t-m from reillyg@chromium.org Link to the patchset: https://codereview.chromium.org/2851453004/#ps80001 (title: "Don't check return value from postDelayed")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 80001, "attempt_start_ts": 1493887214207600, "parent_rev": "11b6b3790f4138d11f81a3af384d129383ea976a", "commit_rev": "b49d34931454bc1fdffdba99d6a0b344430746b5"}
Message was sent while issue was closed.
Description was changed from ========== [webnfc] Cancel nfc.push operation when timeout expires This CL adds missing timeout handling functionality [1]. When user provides timeout value for the push operation, and NFC tag is not in proximity for the duration of timeout value, operation must be rejected with timeout error. Unit test is added to test new functionality. https://w3c.github.io/web-nfc/#the-push-method (Step 14). BUG=714037 ========== to ========== [webnfc] Cancel nfc.push operation when timeout expires This CL adds missing timeout handling functionality [1]. When user provides timeout value for the push operation, and NFC tag is not in proximity for the duration of timeout value, operation must be rejected with timeout error. Unit test is added to test new functionality. https://w3c.github.io/web-nfc/#the-push-method (Step 14). BUG=714037 Review-Url: https://codereview.chromium.org/2851453004 Cr-Commit-Position: refs/heads/master@{#469294} Committed: https://chromium.googlesource.com/chromium/src/+/b49d34931454bc1fdffdba99d6a0... ==========
Message was sent while issue was closed.
Committed patchset #4 (id:80001) as https://chromium.googlesource.com/chromium/src/+/b49d34931454bc1fdffdba99d6a0... |