Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // File-level comment to appease parser. Eventually this will not be necessary. | 5 // File-level comment to appease parser. Eventually this will not be necessary. |
| 6 | 6 |
| 7 [nodoc] namespace experimental.pushMessaging{ | 7 [nodoc] namespace experimental.pushMessaging{ |
| 8 dictionary Message { | 8 dictionary Message { |
| 9 // The subchannel the message was sent on. | 9 // The subchannel the message was sent on. |
| 10 long subchannelId; | 10 long subchannelId; |
| 11 | 11 |
| 12 // The payload associated with the message, if any. | 12 // The payload associated with the message, if any. |
| 13 DOMString payload; | 13 DOMString payload; |
| 14 }; | 14 }; |
| 15 | 15 |
| 16 dictionary ChannelIdResult { | |
| 17 // The subchannel the message was sent on. | |
|
Mihai Parparita -not on Chrome
2012/08/22 21:40:45
This comment needs to be updated.
Also, APIs gene
Pete Williamson
2012/08/23 17:20:50
Done.
| |
| 18 long status; | |
| 19 | |
| 20 // The payload associated with the message, if any. | |
|
Mihai Parparita -not on Chrome
2012/08/22 21:40:45
This comment needs to be updated.
Pete Williamson
2012/08/23 17:20:50
Done.
| |
| 21 DOMString channelId; | |
| 22 }; | |
| 23 | |
| 24 callback ChannelIdCallback = void (ChannelIdResult channelId); | |
| 25 | |
| 26 interface Functions { | |
| 27 // Retrieves the channel ID associated with this extension. Typically, an | |
| 28 // extension will want to send this value to its application server so the | |
| 29 // server can use it to trigger push messages back to the extension. | |
| 30 static void getChannelId(ChannelIdCallback callback); | |
| 31 }; | |
| 32 | |
| 16 interface Events { | 33 interface Events { |
| 17 // Fired when a push message has been received. | 34 // Fired when a push message has been received. |
| 18 // |message| : The details associated with the message. | 35 // |message| : The details associated with the message. |
| 19 static void onMessage(Message message); | 36 static void onMessage(Message message); |
| 20 }; | 37 }; |
| 21 }; | 38 }; |
| OLD | NEW |