Debian Codegraph @

closure-library/closure/goog/labs/net/webchannel/wire.js

raw
1 // Copyright 2013 The Closure Library Authors. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS-IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 /**
16 * @fileoverview Interface and shared data structures for implementing
17 * different wire protocol versions.
18 * @visibility {//closure/goog:__pkg__}
19 * @visibility {//closure/goog/bin/sizetests:__pkg__}
20 */
21
22
23 goog.provide('goog.labs.net.webChannel.Wire');
24
25
26
27 /**
28 * The interface class.
29 *
30 * @interface
31 */
32 goog.labs.net.webChannel.Wire = function() {};
33
34
35 goog.scope(function() {
36 var Wire = goog.labs.net.webChannel.Wire;
37
38
39 /**
40 * The latest protocol version that this class supports. We request this version
41 * from the server when opening the connection. Should match
42 * LATEST_CHANNEL_VERSION on the server code.
43 * @type {number}
44 */
45 Wire.LATEST_CHANNEL_VERSION = 8;
46
47
48
49 /**
50 * Simple container class for a (mapId, map) pair.
51 * @param {number} mapId The id for this map.
52 * @param {!Object|!goog.structs.Map} map The map itself.
53 * @param {!Object=} opt_context The context associated with the map.
54 * @constructor
55 * @struct
56 */
57 Wire.QueuedMap = function(mapId, map, opt_context) {
58 /**
59 * The id for this map.
60 * @type {number}
61 */
62 this.mapId = mapId;
63
64 /**
65 * The map itself.
66 * @type {!Object|!goog.structs.Map}
67 */
68 this.map = map;
69
70 /**
71 * The context for the map.
72 * @type {Object}
73 */
74 this.context = opt_context || null;
75 };
76 }); // goog.scope