зеркало из https://github.com/mozilla/gecko-dev.git
Bug 274300 - Catch and handle hook processing errors in event queue.
ChatZilla only. r=rginda a=bsmedberg
This commit is contained in:
Родитель
914cd1b9bd
Коммит
e9cd03e90c
|
@ -22,6 +22,7 @@
|
||||||
*
|
*
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
* Robert Ginda, rginda@ndcico.com, original author
|
* Robert Ginda, rginda@ndcico.com, original author
|
||||||
|
* James Ross, silver@warwickcompsoc.co.uk
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
|
@ -43,7 +44,6 @@
|
||||||
|
|
||||||
function CEvent (set, type, destObject, destMethod)
|
function CEvent (set, type, destObject, destMethod)
|
||||||
{
|
{
|
||||||
|
|
||||||
this.set = set;
|
this.set = set;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.destObject = destObject;
|
this.destObject = destObject;
|
||||||
|
@ -57,7 +57,6 @@ function CEvent (set, type, destObject, destMethod)
|
||||||
*/
|
*/
|
||||||
function CEventPump (eventsPerStep)
|
function CEventPump (eventsPerStep)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* event routing stops after this many levels, safety valve */
|
/* event routing stops after this many levels, safety valve */
|
||||||
this.MAX_EVENT_DEPTH = 50;
|
this.MAX_EVENT_DEPTH = 50;
|
||||||
/* When there are this many 'used' items in a queue, always clean up. At
|
/* When there are this many 'used' items in a queue, always clean up. At
|
||||||
|
@ -103,7 +102,17 @@ function ep_hook(e, hooks)
|
||||||
continue hook_loop;
|
continue hook_loop;
|
||||||
|
|
||||||
e.hooks.push(hooks[h]);
|
e.hooks.push(hooks[h]);
|
||||||
|
try
|
||||||
|
{
|
||||||
var rv = hooks[h].f(e);
|
var rv = hooks[h].f(e);
|
||||||
|
}
|
||||||
|
catch(ex)
|
||||||
|
{
|
||||||
|
dd("hook #" + h + " '" +
|
||||||
|
((typeof hooks[h].name != "undefined") ? hooks[h].name :
|
||||||
|
"") + "' had an error!");
|
||||||
|
dd(formatException(ex));
|
||||||
|
}
|
||||||
if ((typeof rv == "boolean") &&
|
if ((typeof rv == "boolean") &&
|
||||||
(rv == false))
|
(rv == false))
|
||||||
{
|
{
|
||||||
|
@ -345,6 +354,6 @@ function ep_stepevents()
|
||||||
this.bulkQueuePointer = 0;
|
this.bulkQueuePointer = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return i;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче