OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007-2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2007-2009 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 } | 89 } |
90 | 90 |
91 if (m_argc > 0) | 91 if (m_argc > 0) |
92 delete[] m_argv; | 92 delete[] m_argv; |
93 } | 93 } |
94 | 94 |
95 void ScheduledAction::execute(ScriptExecutionContext* context) | 95 void ScheduledAction::execute(ScriptExecutionContext* context) |
96 { | 96 { |
97 if (context->isDocument()) { | 97 if (context->isDocument()) { |
98 Frame* frame = static_cast<Document*>(context)->frame(); | 98 Frame* frame = static_cast<Document*>(context)->frame(); |
| 99 if (!frame) |
| 100 return; |
99 ScriptController* scriptController = frame->script(); | 101 ScriptController* scriptController = frame->script(); |
100 if (!scriptController->canExecuteScripts(NotAboutToExecuteScript)) | 102 if (!scriptController->canExecuteScripts(NotAboutToExecuteScript)) |
101 return; | 103 return; |
102 V8Proxy* proxy = V8Proxy::retrieve(frame); | 104 V8Proxy* proxy = V8Proxy::retrieve(frame); |
103 execute(proxy); | 105 execute(proxy); |
104 } | 106 } |
105 #if ENABLE(WORKERS) | 107 #if ENABLE(WORKERS) |
106 else { | 108 else { |
107 ASSERT(context->isWorkerContext()); | 109 ASSERT(context->isWorkerContext()); |
108 execute(static_cast<WorkerContext*>(context)); | 110 execute(static_cast<WorkerContext*>(context)); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 v8::Handle<v8::Context> v8Context = v8::Local<v8::Context>::New(m_contex
t.get()); | 149 v8::Handle<v8::Context> v8Context = v8::Local<v8::Context>::New(m_contex
t.get()); |
148 ASSERT(!v8Context.IsEmpty()); | 150 ASSERT(!v8Context.IsEmpty()); |
149 v8::Context::Scope scope(v8Context); | 151 v8::Context::Scope scope(v8Context); |
150 m_function->Call(v8Context->Global(), m_argc, m_argv); | 152 m_function->Call(v8Context->Global(), m_argc, m_argv); |
151 } else | 153 } else |
152 scriptController->evaluate(m_code); | 154 scriptController->evaluate(m_code); |
153 } | 155 } |
154 #endif | 156 #endif |
155 | 157 |
156 } // namespace WebCore | 158 } // namespace WebCore |
OLD | NEW |