Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Issue 2875283002: [NFC] Only connect to NFC impl if ExecutionContext supports it (Closed)

Created:
3 years, 7 months ago by blundell
Modified:
3 years, 7 months ago
CC:
blink-reviews, chromium-reviews, haraken
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[NFC] Only connect to NFC impl if ExecutionContext supports it NFC has the spec property that it can only be accessed from the main frame. Currently, NFC.cpp unconditionally connects to the NFC impl in its constructor and then implements this spec by disallowing requests made in the context of nested frames in the implementations of the IDL invocations (e.g., push). An upcoming refactor of NFC for servicification would be eased by the simplifying property that the browser receives NFC requests only from the main frame. This CL adds this property by having NFC.cpp connect to the NFC implementation only if its ExecutionContext supports it. This change will have no user-visible effect (all of the IDL invocations will fail in the same way as they did before, as the CL does not change the checks that they are making), but makes the servicification task significantly easier. BUG=680924 Review-Url: https://codereview.chromium.org/2875283002 Cr-Commit-Position: refs/heads/master@{#471707} Committed: https://chromium.googlesource.com/chromium/src/+/b167a1b1183710ff042fd72c8ca53aae3bb81bd3

Patch Set 1 #

Total comments: 2

Patch Set 2 : Response to review #

Patch Set 3 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -8 lines) Patch
M third_party/WebKit/Source/modules/nfc/NFC.h View 1 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/nfc/NFC.cpp View 2 chunks +21 lines, -8 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 17 (10 generated)
blundell
Jochen, This is what I was talking about over chat. Does this make sense?
3 years, 7 months ago (2017-05-12 12:32:42 UTC) #6
blundell
+alexander.shalamov@intel.com for OWNERS
3 years, 7 months ago (2017-05-12 13:51:02 UTC) #8
jochen (gone - plz use gerrit)
lgtm https://codereview.chromium.org/2875283002/diff/1/third_party/WebKit/Source/modules/nfc/NFC.h File third_party/WebKit/Source/modules/nfc/NFC.h (right): https://codereview.chromium.org/2875283002/diff/1/third_party/WebKit/Source/modules/nfc/NFC.h#newcode70 third_party/WebKit/Source/modules/nfc/NFC.h:70: bool IsSupportedInContext(ExecutionContext*, String&); nit. should be String& error_message, ...
3 years, 7 months ago (2017-05-15 05:34:55 UTC) #9
shalamov
Thanks! lgtm
3 years, 7 months ago (2017-05-15 06:34:19 UTC) #10
blundell
https://codereview.chromium.org/2875283002/diff/1/third_party/WebKit/Source/modules/nfc/NFC.h File third_party/WebKit/Source/modules/nfc/NFC.h (right): https://codereview.chromium.org/2875283002/diff/1/third_party/WebKit/Source/modules/nfc/NFC.h#newcode70 third_party/WebKit/Source/modules/nfc/NFC.h:70: bool IsSupportedInContext(ExecutionContext*, String&); On 2017/05/15 05:34:55, jochen wrote: > ...
3 years, 7 months ago (2017-05-15 07:27:55 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2875283002/40001
3 years, 7 months ago (2017-05-15 07:28:05 UTC) #14
commit-bot: I haz the power
3 years, 7 months ago (2017-05-15 09:08:41 UTC) #17
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/b167a1b1183710ff042fd72c8ca5...

Powered by Google App Engine
This is Rietveld 408576698