| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 return; | 158 return; |
| 159 } | 159 } |
| 160 Vector<v8::Local<v8::Value>> info; | 160 Vector<v8::Local<v8::Value>> info; |
| 161 CreateLocalHandlesForArgs(&info); | 161 CreateLocalHandlesForArgs(&info); |
| 162 V8ScriptRunner::CallFunction( | 162 V8ScriptRunner::CallFunction( |
| 163 function, frame->GetDocument(), script_state_->GetContext()->Global(), | 163 function, frame->GetDocument(), script_state_->GetContext()->Global(), |
| 164 info.size(), info.Data(), script_state_->GetIsolate()); | 164 info.size(), info.Data(), script_state_->GetIsolate()); |
| 165 } else { | 165 } else { |
| 166 DVLOG(1) << "ScheduledAction::execute " << this | 166 DVLOG(1) << "ScheduledAction::execute " << this |
| 167 << ": executing from source"; | 167 << ": executing from source"; |
| 168 frame->Script().ExecuteScriptAndReturnValue(script_state_->GetContext(), | 168 frame->GetScriptController().ExecuteScriptAndReturnValue( |
| 169 ScriptSourceCode(code_)); | 169 script_state_->GetContext(), ScriptSourceCode(code_)); |
| 170 } | 170 } |
| 171 | 171 |
| 172 // The frame might be invalid at this point because JavaScript could have | 172 // The frame might be invalid at this point because JavaScript could have |
| 173 // released it. | 173 // released it. |
| 174 } | 174 } |
| 175 | 175 |
| 176 void ScheduledAction::Execute(WorkerGlobalScope* worker) { | 176 void ScheduledAction::Execute(WorkerGlobalScope* worker) { |
| 177 ASSERT(worker->GetThread()->IsCurrentThread()); | 177 ASSERT(worker->GetThread()->IsCurrentThread()); |
| 178 | 178 |
| 179 if (!script_state_->ContextIsValid()) { | 179 if (!script_state_->ContextIsValid()) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 203 } | 203 } |
| 204 | 204 |
| 205 void ScheduledAction::CreateLocalHandlesForArgs( | 205 void ScheduledAction::CreateLocalHandlesForArgs( |
| 206 Vector<v8::Local<v8::Value>>* handles) { | 206 Vector<v8::Local<v8::Value>>* handles) { |
| 207 handles->ReserveCapacity(info_.Size()); | 207 handles->ReserveCapacity(info_.Size()); |
| 208 for (size_t i = 0; i < info_.Size(); ++i) | 208 for (size_t i = 0; i < info_.Size(); ++i) |
| 209 handles->push_back(info_.Get(i)); | 209 handles->push_back(info_.Get(i)); |
| 210 } | 210 } |
| 211 | 211 |
| 212 } // namespace blink | 212 } // namespace blink |
| OLD | NEW |