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

Side by Side Diff: ppapi/c/dev/pp_message_event_dev.h

Issue 6538028: A proposal for an initial postMessage interface. This will allow JavaScript ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ppapi/c/ppb_instance.h » ('j') | ppapi/c/ppp_instance.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 */
5 #ifndef PPAPI_C_DEV_PP_MESSAGE_EVENT_DEV_H_
6 #define PPAPI_C_DEV_PP_MESSAGE_EVENT_DEV_H_
7
8 #include "ppapi/c/pp_macros.h"
9 #include "ppapi/c/pp_var.h"
10
11 /**
12 * PP_MessageEvent_Dev defines a PPAPI version of MessageEvent, as defined
13 * in:
14 * http://dev.w3.org/html5/postmsg/#event-definitions
15 * Note that PPAPI does not currently support @a lastEventId or @a ports.
16 */
17 struct PP_MessageEvent_Dev {
18 /** @a data represents the contents of the message. Currently, it can be an
19 * instrinsic type or string (but not structured data such as an object or
Mark Seaborn 2011/02/17 19:18:47 "instrinsic" -> "intrinsic" Does "intrinsic type
dmichael(do not use this one) 2011/02/17 20:07:04 I agree, it's not. But the postMessage spec allow
dmichael(do not use this one) 2011/02/17 22:18:22 I reworded it.
20 * array).
21 * DESIGN ISSUE: I want to support structured data and the structured
darin (slow to review) 2011/02/17 19:20:52 SGTM2
22 * clone algorithm in the future. I believe that will
23 * require adding a new type for PP_Var, which is perhaps a
24 * tree structure encompassing the object, or a serialized
25 * blob. In the latter case, the wire format becomes part
26 * of the PPAPI interface. In the former case, the wire
27 * format is more hidden but still needs to be carefully
28 * managed by the proxy code to maintain backwards
29 * compatibility. This does not need to be resolved now.
30 */
31 struct PP_Var data;
Mark Seaborn 2011/02/17 19:18:47 I thought the purpose of this async messaging was
dmichael(do not use this one) 2011/02/17 20:07:04 The proposal is more about getting rid of PPB_Var,
32
33 /** @a origin is a UTF string containing the origin of the message. It is
34 * strongly recommended that message handlers check @a origin before doing
Mark Seaborn 2011/02/17 19:18:47 This is contradictory. On the one hand you say th
dmichael(do not use this one) 2011/02/17 20:07:04 PP_MessageEvent_Dev is based around the spec for M
35 * any processing of the message data, to ensure it was received from the
36 * expected @a origin.
37 * DESIGN ISSUE: There was discussion of omitting this parameter. For now,
darin (slow to review) 2011/02/17 19:20:52 OK, yeah... While NaCl has a same-origin restrict
dmichael(do not use this one) 2011/02/17 20:07:04 Ah, thanks for pointing that out!
38 * there is no way to send messages to other origins or
39 * receive messages from other origins, so this is arguably
40 * not necessary.
41 *
42 * I think we can provide it anyway for now. That frees us
43 * up to relax that restriction in the future without changing
44 * this structure. It also makes this structure a little more
45 * familiar to people used to the JavaScript postMessage.
46 */
47 struct PP_Var origin;
48
49 /** @a source is a reference to the WindowObject that sent this message.
50 * DESIGN ISSUE: Part of me originally wanted to yank out the 'object id'
51 * type for PP_Var eventually. But... maybe it's okay to
52 * keep the ID if we can only ever use it asynchronously. I
53 * think in this case, source fills the role of a WindowProxy
54 * and allows us to respond to the same iframe/window that
55 * invoked postMessage on us. Currently, I'm not showing an
56 * interface that would allow you to post a message to just
57 * any PP_Var (only to instances), so we could omit this. But
58 * like origin, we can provide it now easily and possibly make
59 * use of it later.
60 */
61 struct PP_Var source;
darin (slow to review) 2011/02/17 19:20:52 it is an interesting idea to include this here. i
brettw 2011/02/17 20:40:01 Yeah, I would probably just delete this.
dmichael(do not use this one) 2011/02/17 22:18:22 Done.
62 };
63
64 #endif /* PPAPI_C_DEV_PP_MESSAGE_EVENT_DEV_H_ */
65
OLDNEW
« no previous file with comments | « no previous file | ppapi/c/ppb_instance.h » ('j') | ppapi/c/ppp_instance.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698