OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2011 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 v8SetReturnValue(info, 0); | 132 v8SetReturnValue(info, 0); |
133 return; | 133 return; |
134 } | 134 } |
135 ASSERT(imp->frame()); | 135 ASSERT(imp->frame()); |
136 action = adoptPtr(new ScheduledAction(context, functionString, KURL(), i
nfo.GetIsolate())); | 136 action = adoptPtr(new ScheduledAction(context, functionString, KURL(), i
nfo.GetIsolate())); |
137 } | 137 } |
138 | 138 |
139 int32_t timeout = argumentCount >= 2 ? info[1]->Int32Value() : 0; | 139 int32_t timeout = argumentCount >= 2 ? info[1]->Int32Value() : 0; |
140 int timerId; | 140 int timerId; |
141 if (singleShot) | 141 if (singleShot) |
142 timerId = DOMWindowTimers::setTimeout(imp, action.release(), timeout); | 142 timerId = DOMWindowTimers::setTimeout(*imp, action.release(), timeout); |
143 else | 143 else |
144 timerId = DOMWindowTimers::setInterval(imp, action.release(), timeout); | 144 timerId = DOMWindowTimers::setInterval(*imp, action.release(), timeout); |
145 | 145 |
146 // Try to do the idle notification before the timeout expires to get better | 146 // Try to do the idle notification before the timeout expires to get better |
147 // use of any idle time. Aim for the middle of the interval for simplicity. | 147 // use of any idle time. Aim for the middle of the interval for simplicity. |
148 if (timeout >= 0) { | 148 if (timeout >= 0) { |
149 double maximumFireInterval = static_cast<double>(timeout) / 1000 / 2; | 149 double maximumFireInterval = static_cast<double>(timeout) / 1000 / 2; |
150 V8GCForContextDispose::instanceTemplate().notifyIdleSooner(maximumFireIn
terval); | 150 V8GCForContextDispose::instanceTemplate().notifyIdleSooner(maximumFireIn
terval); |
151 } | 151 } |
152 | 152 |
153 v8SetReturnValue(info, timerId); | 153 v8SetReturnValue(info, timerId); |
154 } | 154 } |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 v8::Handle<v8::Context> context = toV8Context(isolate, frame, DOMWrapperWorl
d::current(isolate)); | 554 v8::Handle<v8::Context> context = toV8Context(isolate, frame, DOMWrapperWorl
d::current(isolate)); |
555 if (context.IsEmpty()) | 555 if (context.IsEmpty()) |
556 return v8Undefined(); | 556 return v8Undefined(); |
557 | 557 |
558 v8::Handle<v8::Object> global = context->Global(); | 558 v8::Handle<v8::Object> global = context->Global(); |
559 ASSERT(!global.IsEmpty()); | 559 ASSERT(!global.IsEmpty()); |
560 return global; | 560 return global; |
561 } | 561 } |
562 | 562 |
563 } // namespace WebCore | 563 } // namespace WebCore |
OLD | NEW |