wire.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. * @fileoverview Interface and shared data structures for implementing
  16. * different wire protocol versions.
  17. * @visibility {//closure/goog:__pkg__}
  18. * @visibility {//closure/goog/bin/sizetests:__pkg__}
  19. */
  20. goog.provide('goog.labs.net.webChannel.Wire');
  21. /**
  22. * The interface class.
  23. *
  24. * @interface
  25. */
  26. goog.labs.net.webChannel.Wire = function() {};
  27. goog.scope(function() {
  28. var Wire = goog.labs.net.webChannel.Wire;
  29. /**
  30. * The latest protocol version that this class supports. We request this version
  31. * from the server when opening the connection. Should match
  32. * LATEST_CHANNEL_VERSION on the server code.
  33. * @type {number}
  34. */
  35. Wire.LATEST_CHANNEL_VERSION = 8;
  36. /**
  37. * Simple container class for a (mapId, map) pair.
  38. * @param {number} mapId The id for this map.
  39. * @param {!Object|!goog.structs.Map} map The map itself.
  40. * @param {!Object=} opt_context The context associated with the map.
  41. * @constructor
  42. * @struct
  43. */
  44. Wire.QueuedMap = function(mapId, map, opt_context) {
  45. /**
  46. * The id for this map.
  47. * @type {number}
  48. */
  49. this.mapId = mapId;
  50. /**
  51. * The map itself.
  52. * @type {!Object|!goog.structs.Map}
  53. */
  54. this.map = map;
  55. /**
  56. * The context for the map.
  57. * @type {Object}
  58. */
  59. this.context = opt_context || null;
  60. };
  61. }); // goog.scope