A lice-sized code review (wangxianzhu localrev 1288)

3 views
Skip to first unread message

phni...@gmail.com

unread,
Jan 11, 2010, 5:11:40 AM1/11/10
to jame...@gmail.com, google-gadgets...@googlegroups.com
Hello james.su,

I'd like you to do a code review. Please review the following patch:

----------------------------------------------------------------------
r1288: (no author) | 2010-01-11 18:11:02 +0800

Check for time change to avoid false-positive of blocked script.
----------------------------------------------------------------------

=== extensions/smjs_script_runtime/js_script_context.cc
==================================================================
--- extensions/smjs_script_runtime/js_script_context.cc (revision 1287)
+++ extensions/smjs_script_runtime/js_script_context.cc (revision 1288)
@@ -654,6 +654,16 @@
return JS_TRUE;
}

+ static uint64_t last_time = 0;
+ if (last_time != 0 &&
+ (now < last_time || now - last_time > kMaxScriptRunTime / 10)) {
+ // There must be some time change. Reset the timer.
+ last_time = now;
+ operation_callback_time_ = now;
+ return JS_TRUE;
+ }
+ last_time = now;
+
if (now > operation_callback_time_ + kMaxScriptRunTime) {
static bool handling_script_blocked_signal = false;
if (handling_script_blocked_signal) {

This is a semiautomated message from "svkmail". Complaints or suggestions?
Mail edy...@gmail.com.

James Su

unread,
Jan 11, 2010, 5:15:17 AM1/11/10
to phni...@gmail.com, google-gadgets...@googlegroups.com
LGTM.

2010/1/11 <phni...@gmail.com>
Reply all
Reply to author
Forward
0 new messages