| 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 25 matching lines...) Expand all Loading... |
| 36 #include "bindings/core/v8/ScriptState.h" | 36 #include "bindings/core/v8/ScriptState.h" |
| 37 #include "bindings/core/v8/V8PersistentValueVector.h" | 37 #include "bindings/core/v8/V8PersistentValueVector.h" |
| 38 #include "platform/heap/Handle.h" | 38 #include "platform/heap/Handle.h" |
| 39 #include "wtf/Forward.h" | 39 #include "wtf/Forward.h" |
| 40 #include <v8.h> | 40 #include <v8.h> |
| 41 | 41 |
| 42 namespace blink { | 42 namespace blink { |
| 43 | 43 |
| 44 class LocalFrame; | 44 class LocalFrame; |
| 45 class ExecutionContext; | 45 class ExecutionContext; |
| 46 class SourceLocation; | |
| 47 class WorkerGlobalScope; | 46 class WorkerGlobalScope; |
| 48 | 47 |
| 49 class ScheduledAction final | 48 class ScheduledAction final |
| 50 : public GarbageCollectedFinalized<ScheduledAction> { | 49 : public GarbageCollectedFinalized<ScheduledAction> { |
| 51 WTF_MAKE_NONCOPYABLE(ScheduledAction); | 50 WTF_MAKE_NONCOPYABLE(ScheduledAction); |
| 52 | 51 |
| 53 public: | 52 public: |
| 54 static ScheduledAction* create(ScriptState*, | 53 static ScheduledAction* create(ScriptState*, |
| 55 const ScriptValue& handler, | 54 const ScriptValue& handler, |
| 56 const Vector<ScriptValue>& arguments); | 55 const Vector<ScriptValue>& arguments); |
| 57 static ScheduledAction* create(ScriptState*, const String& handler); | 56 static ScheduledAction* create(ScriptState*, const String& handler); |
| 58 | 57 |
| 59 ~ScheduledAction(); | 58 ~ScheduledAction(); |
| 60 DECLARE_TRACE(); | 59 DECLARE_TRACE(); |
| 61 | 60 |
| 62 void execute(ExecutionContext*); | 61 void execute(ExecutionContext*); |
| 63 std::unique_ptr<SourceLocation> handlerLocation(); | |
| 64 | 62 |
| 65 private: | 63 private: |
| 66 ScheduledAction(ScriptState*, | 64 ScheduledAction(ScriptState*, |
| 67 const ScriptValue& handler, | 65 const ScriptValue& handler, |
| 68 const Vector<ScriptValue>& arguments); | 66 const Vector<ScriptValue>& arguments); |
| 69 ScheduledAction(ScriptState*, const String& handler); | 67 ScheduledAction(ScriptState*, const String& handler); |
| 70 | 68 |
| 71 void execute(LocalFrame*); | 69 void execute(LocalFrame*); |
| 72 void execute(WorkerGlobalScope*); | 70 void execute(WorkerGlobalScope*); |
| 73 void createLocalHandlesForArgs(Vector<v8::Local<v8::Value>>* handles); | 71 void createLocalHandlesForArgs(Vector<v8::Local<v8::Value>>* handles); |
| 74 | 72 |
| 75 ScriptStateProtectingContext m_scriptState; | 73 ScriptStateProtectingContext m_scriptState; |
| 76 ScopedPersistent<v8::Function> m_function; | 74 ScopedPersistent<v8::Function> m_function; |
| 77 V8PersistentValueVector<v8::Value> m_info; | 75 V8PersistentValueVector<v8::Value> m_info; |
| 78 ScriptSourceCode m_code; | 76 ScriptSourceCode m_code; |
| 79 }; | 77 }; |
| 80 | 78 |
| 81 } // namespace blink | 79 } // namespace blink |
| 82 | 80 |
| 83 #endif // ScheduledAction | 81 #endif // ScheduledAction |
| OLD | NEW |