OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 module device.nfc; | 5 module device.nfc; |
6 | 6 |
7 enum NFCErrorType { | 7 enum NFCErrorType { |
8 SECURITY, | 8 SECURITY, |
9 NOT_SUPPORTED, | 9 NOT_SUPPORTED, |
10 DEVICE_DISABLED, | 10 DEVICE_DISABLED, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
58 }; | 58 }; |
59 | 59 |
60 struct NFCMessage { | 60 struct NFCMessage { |
61 // The body of the NFCMessage is a collection of NFCRecord objects. | 61 // The body of the NFCMessage is a collection of NFCRecord objects. |
62 array<NFCRecord> data; | 62 array<NFCRecord> data; |
63 | 63 |
64 // The |url| field is an ASCII serialized origin, optionally followed by a URL | 64 // The |url| field is an ASCII serialized origin, optionally followed by a URL |
65 // path. It represents Web NFC id, that can be used for matching Web NFC | 65 // path. It represents Web NFC id, that can be used for matching Web NFC |
66 // content with the filter specified by |url| field in NFCWatchOptions. | 66 // content with the filter specified by |url| field in NFCWatchOptions. |
67 string? url; | 67 string? url; |
68 | |
69 // Maximum size of NFC message that can be sent over IPC is 32KB. | |
70 const uint32 kMaxNFCMessageSize = 32768; | |
dcheng
2016/09/08 04:42:38
Nit: omit NFCMessage here, since the constant is e
shalamov
2016/09/22 13:53:22
Done.
| |
68 }; | 71 }; |
69 | 72 |
70 struct NFCPushOptions { | 73 struct NFCPushOptions { |
71 // The target of the push operation. | 74 // The target of the push operation. |
72 NFCPushTarget target; | 75 NFCPushTarget target; |
73 | 76 |
74 // The timeout for the push operation, in milliseconds. | 77 // The timeout for the push operation, in milliseconds. |
75 double timeout; | 78 double timeout; |
76 | 79 |
77 // If the property is true, the push operation will suspend active watchers | 80 // If the property is true, the push operation will suspend active watchers |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 // visibility or focus is lost. | 128 // visibility or focus is lost. |
126 SuspendNFCOperations(); | 129 SuspendNFCOperations(); |
127 | 130 |
128 // Resumes all suspended NFC operations. | 131 // Resumes all suspended NFC operations. |
129 ResumeNFCOperations(); | 132 ResumeNFCOperations(); |
130 }; | 133 }; |
131 | 134 |
132 interface NFCClient { | 135 interface NFCClient { |
133 OnWatch(array<uint32> watch_ids, NFCMessage message); | 136 OnWatch(array<uint32> watch_ids, NFCMessage message); |
134 }; | 137 }; |
OLD | NEW |