OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 * @return {?SDK.ExecutionContext} | 89 * @return {?SDK.ExecutionContext} |
90 */ | 90 */ |
91 executionContext(id) { | 91 executionContext(id) { |
92 return this._executionContextById.get(id) || null; | 92 return this._executionContextById.get(id) || null; |
93 } | 93 } |
94 | 94 |
95 /** | 95 /** |
96 * @param {!Protocol.Runtime.ExecutionContextDescription} context | 96 * @param {!Protocol.Runtime.ExecutionContextDescription} context |
97 */ | 97 */ |
98 _executionContextCreated(context) { | 98 _executionContextCreated(context) { |
99 // The private script context should be hidden behind an experiment. | |
100 if (context.name === SDK.RuntimeModel._privateScript && !context.origin && | |
101 !Runtime.experiments.isEnabled('privateScriptInspection')) | |
102 return; | |
103 | |
104 var data = context.auxData || {isDefault: true}; | 99 var data = context.auxData || {isDefault: true}; |
105 var executionContext = new SDK.ExecutionContext( | 100 var executionContext = new SDK.ExecutionContext( |
106 this.target(), context.id, context.name, context.origin, data['isDefault
'], data['frameId']); | 101 this.target(), context.id, context.name, context.origin, data['isDefault
'], data['frameId']); |
107 this._executionContextById.set(executionContext.id, executionContext); | 102 this._executionContextById.set(executionContext.id, executionContext); |
108 this.dispatchEventToListeners(SDK.RuntimeModel.Events.ExecutionContextCreate
d, executionContext); | 103 this.dispatchEventToListeners(SDK.RuntimeModel.Events.ExecutionContextCreate
d, executionContext); |
109 } | 104 } |
110 | 105 |
111 /** | 106 /** |
112 * @param {number} executionContextId | 107 * @param {number} executionContextId |
113 */ | 108 */ |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 }; | 324 }; |
330 | 325 |
331 /** @enum {symbol} */ | 326 /** @enum {symbol} */ |
332 SDK.RuntimeModel.Events = { | 327 SDK.RuntimeModel.Events = { |
333 ExecutionContextCreated: Symbol('ExecutionContextCreated'), | 328 ExecutionContextCreated: Symbol('ExecutionContextCreated'), |
334 ExecutionContextDestroyed: Symbol('ExecutionContextDestroyed'), | 329 ExecutionContextDestroyed: Symbol('ExecutionContextDestroyed'), |
335 ExecutionContextChanged: Symbol('ExecutionContextChanged'), | 330 ExecutionContextChanged: Symbol('ExecutionContextChanged'), |
336 ExecutionContextOrderChanged: Symbol('ExecutionContextOrderChanged') | 331 ExecutionContextOrderChanged: Symbol('ExecutionContextOrderChanged') |
337 }; | 332 }; |
338 | 333 |
339 SDK.RuntimeModel._privateScript = 'private script'; | |
340 | |
341 /** | 334 /** |
342 * @implements {Protocol.RuntimeDispatcher} | 335 * @implements {Protocol.RuntimeDispatcher} |
343 * @unrestricted | 336 * @unrestricted |
344 */ | 337 */ |
345 SDK.RuntimeDispatcher = class { | 338 SDK.RuntimeDispatcher = class { |
346 /** | 339 /** |
347 * @param {!SDK.RuntimeModel} runtimeModel | 340 * @param {!SDK.RuntimeModel} runtimeModel |
348 */ | 341 */ |
349 constructor(runtimeModel) { | 342 constructor(runtimeModel) { |
350 this._runtimeModel = runtimeModel; | 343 this._runtimeModel = runtimeModel; |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 this._type === 'wheel'; | 785 this._type === 'wheel'; |
793 } | 786 } |
794 | 787 |
795 /** | 788 /** |
796 * @return {boolean} | 789 * @return {boolean} |
797 */ | 790 */ |
798 isNormalListenerType() { | 791 isNormalListenerType() { |
799 return this._listenerType === 'normal'; | 792 return this._listenerType === 'normal'; |
800 } | 793 } |
801 }; | 794 }; |
OLD | NEW |