call-watcher.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. "use strict";
  5. const { functionCallSpec, callWatcherSpec } = require("devtools/shared/specs/call-watcher");
  6. const protocol = require("devtools/shared/protocol");
  7. /**
  8. * The corresponding Front object for the FunctionCallActor.
  9. */
  10. const FunctionCallFront = protocol.FrontClassWithSpec(functionCallSpec, {
  11. initialize: function (client, form) {
  12. protocol.Front.prototype.initialize.call(this, client, form);
  13. },
  14. /**
  15. * Adds some generic information directly to this instance,
  16. * to avoid extra roundtrips.
  17. */
  18. form: function (form) {
  19. this.actorID = form.actor;
  20. this.type = form.type;
  21. this.name = form.name;
  22. this.file = form.file;
  23. this.line = form.line;
  24. this.timestamp = form.timestamp;
  25. this.callerPreview = form.callerPreview;
  26. this.argsPreview = form.argsPreview;
  27. this.resultPreview = form.resultPreview;
  28. }
  29. });
  30. exports.FunctionCallFront = FunctionCallFront;
  31. /**
  32. * The corresponding Front object for the CallWatcherActor.
  33. */
  34. var CallWatcherFront =
  35. exports.CallWatcherFront =
  36. protocol.FrontClassWithSpec(callWatcherSpec, {
  37. initialize: function (client, { callWatcherActor }) {
  38. protocol.Front.prototype.initialize.call(this, client, { actor: callWatcherActor });
  39. this.manage(this);
  40. }
  41. });
  42. /**
  43. * Constants.
  44. */
  45. CallWatcherFront.METHOD_FUNCTION = 0;
  46. CallWatcherFront.GETTER_FUNCTION = 1;
  47. CallWatcherFront.SETTER_FUNCTION = 2;
  48. CallWatcherFront.KNOWN_METHODS = {};
  49. CallWatcherFront.KNOWN_METHODS.CanvasRenderingContext2D = {
  50. asyncDrawXULElement: {
  51. enums: new Set([6]),
  52. },
  53. drawWindow: {
  54. enums: new Set([6])
  55. },
  56. };
  57. CallWatcherFront.KNOWN_METHODS.WebGLRenderingContext = {
  58. activeTexture: {
  59. enums: new Set([0]),
  60. },
  61. bindBuffer: {
  62. enums: new Set([0]),
  63. },
  64. bindFramebuffer: {
  65. enums: new Set([0]),
  66. },
  67. bindRenderbuffer: {
  68. enums: new Set([0]),
  69. },
  70. bindTexture: {
  71. enums: new Set([0]),
  72. },
  73. blendEquation: {
  74. enums: new Set([0]),
  75. },
  76. blendEquationSeparate: {
  77. enums: new Set([0, 1]),
  78. },
  79. blendFunc: {
  80. enums: new Set([0, 1]),
  81. },
  82. blendFuncSeparate: {
  83. enums: new Set([0, 1, 2, 3]),
  84. },
  85. bufferData: {
  86. enums: new Set([0, 1, 2]),
  87. },
  88. bufferSubData: {
  89. enums: new Set([0, 1]),
  90. },
  91. checkFramebufferStatus: {
  92. enums: new Set([0]),
  93. },
  94. clear: {
  95. enums: new Set([0]),
  96. },
  97. compressedTexImage2D: {
  98. enums: new Set([0, 2]),
  99. },
  100. compressedTexSubImage2D: {
  101. enums: new Set([0, 6]),
  102. },
  103. copyTexImage2D: {
  104. enums: new Set([0, 2]),
  105. },
  106. copyTexSubImage2D: {
  107. enums: new Set([0]),
  108. },
  109. createShader: {
  110. enums: new Set([0]),
  111. },
  112. cullFace: {
  113. enums: new Set([0]),
  114. },
  115. depthFunc: {
  116. enums: new Set([0]),
  117. },
  118. disable: {
  119. enums: new Set([0]),
  120. },
  121. drawArrays: {
  122. enums: new Set([0]),
  123. },
  124. drawElements: {
  125. enums: new Set([0, 2]),
  126. },
  127. enable: {
  128. enums: new Set([0]),
  129. },
  130. framebufferRenderbuffer: {
  131. enums: new Set([0, 1, 2]),
  132. },
  133. framebufferTexture2D: {
  134. enums: new Set([0, 1, 2]),
  135. },
  136. frontFace: {
  137. enums: new Set([0]),
  138. },
  139. generateMipmap: {
  140. enums: new Set([0]),
  141. },
  142. getBufferParameter: {
  143. enums: new Set([0, 1]),
  144. },
  145. getParameter: {
  146. enums: new Set([0]),
  147. },
  148. getFramebufferAttachmentParameter: {
  149. enums: new Set([0, 1, 2]),
  150. },
  151. getProgramParameter: {
  152. enums: new Set([1]),
  153. },
  154. getRenderbufferParameter: {
  155. enums: new Set([0, 1]),
  156. },
  157. getShaderParameter: {
  158. enums: new Set([1]),
  159. },
  160. getShaderPrecisionFormat: {
  161. enums: new Set([0, 1]),
  162. },
  163. getTexParameter: {
  164. enums: new Set([0, 1]),
  165. },
  166. getVertexAttrib: {
  167. enums: new Set([1]),
  168. },
  169. getVertexAttribOffset: {
  170. enums: new Set([1]),
  171. },
  172. hint: {
  173. enums: new Set([0, 1]),
  174. },
  175. isEnabled: {
  176. enums: new Set([0]),
  177. },
  178. pixelStorei: {
  179. enums: new Set([0]),
  180. },
  181. readPixels: {
  182. enums: new Set([4, 5]),
  183. },
  184. renderbufferStorage: {
  185. enums: new Set([0, 1]),
  186. },
  187. stencilFunc: {
  188. enums: new Set([0]),
  189. },
  190. stencilFuncSeparate: {
  191. enums: new Set([0, 1]),
  192. },
  193. stencilMaskSeparate: {
  194. enums: new Set([0]),
  195. },
  196. stencilOp: {
  197. enums: new Set([0, 1, 2]),
  198. },
  199. stencilOpSeparate: {
  200. enums: new Set([0, 1, 2, 3]),
  201. },
  202. texImage2D: {
  203. enums: args => args.length > 6 ? new Set([0, 2, 6, 7]) : new Set([0, 2, 3, 4]),
  204. },
  205. texParameterf: {
  206. enums: new Set([0, 1]),
  207. },
  208. texParameteri: {
  209. enums: new Set([0, 1, 2]),
  210. },
  211. texSubImage2D: {
  212. enums: args => args.length === 9 ? new Set([0, 6, 7]) : new Set([0, 4, 5]),
  213. },
  214. vertexAttribPointer: {
  215. enums: new Set([2])
  216. },
  217. };