OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 /** | 5 /** |
6 * @fileoverview These stubs emulate backend functionality and allows | 6 * @fileoverview These stubs emulate backend functionality and allows |
7 * DevTools frontend to function as a standalone web app. | 7 * DevTools frontend to function as a standalone web app. |
8 */ | 8 */ |
9 | 9 |
10 /** | 10 /** |
11 * @constructor | 11 * @constructor |
12 */ | 12 */ |
13 RemoteDebuggerAgentStub = function() { | 13 RemoteDebuggerAgentStub = function() { |
14 }; | 14 }; |
15 | 15 |
16 RemoteDebuggerAgentStub.prototype.DebugBreak = function() { | 16 RemoteDebuggerAgentStub.prototype.DebugBreak = function() { |
17 }; | 17 }; |
18 | 18 |
19 RemoteDebuggerAgentStub.prototype.GetContextId = function() { | 19 RemoteDebuggerAgentStub.prototype.GetContextId = function() { |
20 RemoteDebuggerAgent.DidGetContextId(3); | 20 RemoteDebuggerAgent.DidGetContextId(3); |
21 }; | 21 }; |
22 | 22 |
| 23 RemoteDebuggerAgentStub.prototype.StopProfiling = function() { |
| 24 }; |
| 25 |
| 26 RemoteDebuggerAgentStub.prototype.StartProfiling = function() { |
| 27 }; |
| 28 |
| 29 RemoteDebuggerAgentStub.prototype.GetLogLines = function(pos) { |
| 30 if (pos < RemoteDebuggerAgentStub.ProfilerLogBuffer.length) { |
| 31 setTimeout(function() { |
| 32 RemoteDebuggerAgent.DidGetLogLines( |
| 33 RemoteDebuggerAgentStub.ProfilerLogBuffer, |
| 34 pos + RemoteDebuggerAgentStub.ProfilerLogBuffer.length); |
| 35 }, |
| 36 100); |
| 37 } else { |
| 38 setTimeout(function() { RemoteDebuggerAgent.DidGetLogLines('', pos); }, 100)
; |
| 39 } |
| 40 }; |
23 | 41 |
24 /** | 42 /** |
25 * @constructor | 43 * @constructor |
26 */ | 44 */ |
27 RemoteDomAgentStub = function() { | 45 RemoteDomAgentStub = function() { |
28 }; | 46 }; |
29 | 47 |
30 | 48 |
31 RemoteDomAgentStub.sendDocumentElement_ = function() { | 49 RemoteDomAgentStub.sendDocumentElement_ = function() { |
32 RemoteDomAgent.SetDocumentElement([ | 50 RemoteDomAgent.SetDocumentElement([ |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 RemoteToolsAgent.DidGetNodePrototypes(callId, | 216 RemoteToolsAgent.DidGetNodePrototypes(callId, |
199 JSON.stringify()); | 217 JSON.stringify()); |
200 }, 0); | 218 }, 0); |
201 }; | 219 }; |
202 | 220 |
203 | 221 |
204 RemoteToolsAgentStub.prototype.ClearConsoleMessages = function() { | 222 RemoteToolsAgentStub.prototype.ClearConsoleMessages = function() { |
205 }; | 223 }; |
206 | 224 |
207 | 225 |
| 226 RemoteDebuggerAgentStub.ProfilerLogBuffer = |
| 227 'code-creation,LazyCompile,0x1000,256,"test1 http://aaa.js:1"\n' + |
| 228 'code-creation,LazyCompile,0x2000,256,"test2 http://bbb.js:2"\n' + |
| 229 'code-creation,LazyCompile,0x3000,256,"test3 http://ccc.js:3"\n' + |
| 230 'tick,0x1010,0x0,3\n' + |
| 231 'tick,0x2020,0x0,3,0x1010\n' + |
| 232 'tick,0x2020,0x0,3,0x1010\n' + |
| 233 'tick,0x3010,0x0,3,0x2020, 0x1010\n' + |
| 234 'tick,0x2020,0x0,3,0x1010\n' + |
| 235 'tick,0x2030,0x0,3,0x2020, 0x1010\n' + |
| 236 'tick,0x2020,0x0,3,0x1010\n' + |
| 237 'tick,0x1010,0x0,3\n'; |
| 238 |
| 239 |
208 /** | 240 /** |
209 * @constructor | 241 * @constructor |
210 */ | 242 */ |
211 RemoteDebuggerCommandExecutorStub = function() { | 243 RemoteDebuggerCommandExecutorStub = function() { |
212 }; | 244 }; |
213 | 245 |
214 | 246 |
215 RemoteDebuggerCommandExecutorStub.prototype.DebuggerCommand = function(cmd) { | 247 RemoteDebuggerCommandExecutorStub.prototype.DebuggerCommand = function(cmd) { |
216 }; | 248 }; |
217 | 249 |
(...skipping 23 matching lines...) Expand all Loading... |
241 | 273 |
242 if (!window['DevToolsHost']) { | 274 if (!window['DevToolsHost']) { |
243 window['RemoteDebuggerAgent'] = new RemoteDebuggerAgentStub(); | 275 window['RemoteDebuggerAgent'] = new RemoteDebuggerAgentStub(); |
244 window['RemoteDebuggerCommandExecutor'] = | 276 window['RemoteDebuggerCommandExecutor'] = |
245 new RemoteDebuggerCommandExecutorStub(); | 277 new RemoteDebuggerCommandExecutorStub(); |
246 window['RemoteDomAgent'] = new RemoteDomAgentStub(); | 278 window['RemoteDomAgent'] = new RemoteDomAgentStub(); |
247 window['RemoteNetAgent'] = new RemoteNetAgentStub(); | 279 window['RemoteNetAgent'] = new RemoteNetAgentStub(); |
248 window['RemoteToolsAgent'] = new RemoteToolsAgentStub(); | 280 window['RemoteToolsAgent'] = new RemoteToolsAgentStub(); |
249 window['DevToolsHost'] = new DevToolsHostStub(); | 281 window['DevToolsHost'] = new DevToolsHostStub(); |
250 } | 282 } |
OLD | NEW |