| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 if (!m_function.isEmpty()) | 100 if (!m_function.isEmpty()) |
| 101 frame->script()->callFunction(m_function.get(), context->Global(), m_arg
s.size(), m_args.data()); | 101 frame->script()->callFunction(m_function.get(), context->Global(), m_arg
s.size(), m_args.data()); |
| 102 else | 102 else |
| 103 frame->script()->compileAndRunScript(m_code); | 103 frame->script()->compileAndRunScript(m_code); |
| 104 | 104 |
| 105 // The frame might be invalid at this point because JavaScript could have re
leased it. | 105 // The frame might be invalid at this point because JavaScript could have re
leased it. |
| 106 } | 106 } |
| 107 | 107 |
| 108 void ScheduledAction::execute(WorkerContext* worker) | 108 void ScheduledAction::execute(WorkerContext* worker) |
| 109 { | 109 { |
| 110 ASSERT(worker->thread()->threadID() == currentThread()); | 110 ASSERT(worker->thread()->isCurrentThread()); |
| 111 | 111 |
| 112 V8RecursionScope recursionScope(worker); | 112 V8RecursionScope recursionScope(worker); |
| 113 | 113 |
| 114 if (!m_function.isEmpty()) { | 114 if (!m_function.isEmpty()) { |
| 115 V8GCController::checkMemoryUsage(); | 115 V8GCController::checkMemoryUsage(); |
| 116 | 116 |
| 117 v8::HandleScope handleScope; | 117 v8::HandleScope handleScope; |
| 118 | 118 |
| 119 v8::Handle<v8::Context> context = v8::Local<v8::Context>::New(m_context.
get()); | 119 v8::Handle<v8::Context> context = v8::Local<v8::Context>::New(m_context.
get()); |
| 120 ASSERT(!context.IsEmpty()); | 120 ASSERT(!context.IsEmpty()); |
| 121 v8::Context::Scope scope(context); | 121 v8::Context::Scope scope(context); |
| 122 | 122 |
| 123 m_function->Call(context->Global(), m_args.size(), m_args.data()); | 123 m_function->Call(context->Global(), m_args.size(), m_args.data()); |
| 124 } else | 124 } else |
| 125 worker->script()->evaluate(m_code); | 125 worker->script()->evaluate(m_code); |
| 126 } | 126 } |
| 127 | 127 |
| 128 } // namespace WebCore | 128 } // namespace WebCore |
| OLD | NEW |