mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
Share the breakpoint store across ThreadActor instances (bug 777146); r=past
This commit is contained in:
parent
e283cc98e2
commit
0b9e755f46
@ -25,10 +25,15 @@ function ThreadActor(aHooks)
|
||||
this._frameActors = [];
|
||||
this._environmentActors = [];
|
||||
this._hooks = aHooks ? aHooks : {};
|
||||
this._breakpointStore = {};
|
||||
this._scripts = {};
|
||||
}
|
||||
|
||||
/**
|
||||
* The breakpoint store must be shared across instances of ThreadActor so that
|
||||
* page reloads don't blow away all of our breakpoints.
|
||||
*/
|
||||
ThreadActor._breakpointStore = {};
|
||||
|
||||
ThreadActor.prototype = {
|
||||
actorPrefix: "context",
|
||||
|
||||
@ -36,6 +41,8 @@ ThreadActor.prototype = {
|
||||
|
||||
get dbg() { return this._dbg; },
|
||||
|
||||
get _breakpointStore() { return ThreadActor._breakpointStore; },
|
||||
|
||||
get threadLifetimePool() {
|
||||
if (!this._threadLifetimePool) {
|
||||
this._threadLifetimePool = new ActorPool(this.conn);
|
||||
|
19
toolkit/devtools/debugger/tests/unit/test_breakpointstore.js
Normal file
19
toolkit/devtools/debugger/tests/unit/test_breakpointstore.js
Normal file
@ -0,0 +1,19 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Note: Removing this test will regress bug 754251. See comment above
|
||||
// ThreadActor._breakpointStore.
|
||||
|
||||
function run_test()
|
||||
{
|
||||
let loader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
|
||||
.getService(Components.interfaces.mozIJSSubScriptLoader);
|
||||
loader.loadSubScript("chrome://global/content/devtools/dbg-script-actors.js");
|
||||
|
||||
let instance1 = new ThreadActor();
|
||||
let instance2 = new ThreadActor();
|
||||
do_check_eq(instance1._breakpointStore, ThreadActor._breakpointStore);
|
||||
do_check_eq(instance2._breakpointStore, ThreadActor._breakpointStore);
|
||||
do_check_eq(instance1._breakpointStore, instance2._breakpointStore);
|
||||
}
|
@ -60,3 +60,4 @@ tail =
|
||||
[test_framebindings-05.js]
|
||||
[test_pause_exceptions-01.js]
|
||||
[test_pause_exceptions-02.js]
|
||||
[test_breakpointstore.js]
|
||||
|
Loading…
Reference in New Issue
Block a user