| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 namespace blink { | 48 namespace blink { |
| 49 | 49 |
| 50 ScheduledAction* ScheduledAction::create(ScriptState* scriptState, | 50 ScheduledAction* ScheduledAction::create(ScriptState* scriptState, |
| 51 ExecutionContext* target, | 51 ExecutionContext* target, |
| 52 const ScriptValue& handler, | 52 const ScriptValue& handler, |
| 53 const Vector<ScriptValue>& arguments) { | 53 const Vector<ScriptValue>& arguments) { |
| 54 ASSERT(handler.isFunction()); | 54 ASSERT(handler.isFunction()); |
| 55 if (!scriptState->world().isWorkerWorld()) { | 55 if (!scriptState->world().isWorkerWorld()) { |
| 56 if (!BindingSecurity::shouldAllowAccessToFrame( | 56 if (!BindingSecurity::shouldAllowAccessToFrame( |
| 57 enteredOrMicrotaskDOMWindow(scriptState->isolate()), | 57 enteredDOMWindow(scriptState->isolate()), |
| 58 toDocument(target)->frame(), | 58 toDocument(target)->frame(), |
| 59 BindingSecurity::ErrorReportOption::DoNotReport)) { | 59 BindingSecurity::ErrorReportOption::DoNotReport)) { |
| 60 UseCounter::count(target, UseCounter::ScheduledActionIgnored); | 60 UseCounter::count(target, UseCounter::ScheduledActionIgnored); |
| 61 return new ScheduledAction(scriptState); | 61 return new ScheduledAction(scriptState); |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 return new ScheduledAction(scriptState, handler, arguments); | 64 return new ScheduledAction(scriptState, handler, arguments); |
| 65 } | 65 } |
| 66 | 66 |
| 67 ScheduledAction* ScheduledAction::create(ScriptState* scriptState, | 67 ScheduledAction* ScheduledAction::create(ScriptState* scriptState, |
| 68 ExecutionContext* target, | 68 ExecutionContext* target, |
| 69 const String& handler) { | 69 const String& handler) { |
| 70 if (!scriptState->world().isWorkerWorld()) { | 70 if (!scriptState->world().isWorkerWorld()) { |
| 71 if (!BindingSecurity::shouldAllowAccessToFrame( | 71 if (!BindingSecurity::shouldAllowAccessToFrame( |
| 72 enteredOrMicrotaskDOMWindow(scriptState->isolate()), | 72 enteredDOMWindow(scriptState->isolate()), |
| 73 toDocument(target)->frame(), | 73 toDocument(target)->frame(), |
| 74 BindingSecurity::ErrorReportOption::DoNotReport)) { | 74 BindingSecurity::ErrorReportOption::DoNotReport)) { |
| 75 UseCounter::count(target, UseCounter::ScheduledActionIgnored); | 75 UseCounter::count(target, UseCounter::ScheduledActionIgnored); |
| 76 return new ScheduledAction(scriptState); | 76 return new ScheduledAction(scriptState); |
| 77 } | 77 } |
| 78 } | 78 } |
| 79 return new ScheduledAction(scriptState, handler); | 79 return new ScheduledAction(scriptState, handler); |
| 80 } | 80 } |
| 81 | 81 |
| 82 DEFINE_TRACE(ScheduledAction) { | 82 DEFINE_TRACE(ScheduledAction) { |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after 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(m_info.Size()); | 207 handles->reserveCapacity(m_info.Size()); |
| 208 for (size_t i = 0; i < m_info.Size(); ++i) | 208 for (size_t i = 0; i < m_info.Size(); ++i) |
| 209 handles->push_back(m_info.Get(i)); | 209 handles->push_back(m_info.Get(i)); |
| 210 } | 210 } |
| 211 | 211 |
| 212 } // namespace blink | 212 } // namespace blink |
| OLD | NEW |