Chromium Code Reviews| 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 28 matching lines...) Expand all Loading... | |
| 39 #include "core/dom/Document.h" | 39 #include "core/dom/Document.h" |
| 40 #include "core/dom/ExecutionContext.h" | 40 #include "core/dom/ExecutionContext.h" |
| 41 #include "core/frame/LocalFrame.h" | 41 #include "core/frame/LocalFrame.h" |
| 42 #include "core/workers/WorkerGlobalScope.h" | 42 #include "core/workers/WorkerGlobalScope.h" |
| 43 #include "core/workers/WorkerThread.h" | 43 #include "core/workers/WorkerThread.h" |
| 44 #include "platform/Logging.h" | 44 #include "platform/Logging.h" |
| 45 #include "platform/TraceEvent.h" | 45 #include "platform/TraceEvent.h" |
| 46 | 46 |
| 47 namespace blink { | 47 namespace blink { |
| 48 | 48 |
| 49 ScheduledAction::ScheduledAction(ScriptState* scriptState, v8::Handle<v8::Functi on> function, int argc, v8::Handle<v8::Value> argv[], v8::Isolate* isolate) | 49 ScheduledAction::ScheduledAction(ScriptState* scriptState, const ScriptValue& fu nction, const Vector<ScriptValue>& arguments, v8::Isolate* isolate) |
|
haraken
2014/11/13 12:59:31
You can drop the v8::Isolate* parameter, since you
Jens Widell
2014/11/13 13:26:48
Done.
| |
| 50 : m_scriptState(scriptState) | 50 : m_scriptState(scriptState) |
| 51 , m_function(isolate, function) | |
| 52 , m_info(isolate) | 51 , m_info(isolate) |
| 53 , m_code(String(), KURL(), TextPosition::belowRangePosition()) | 52 , m_code(String(), KURL(), TextPosition::belowRangePosition()) |
| 54 { | 53 { |
| 55 m_info.ReserveCapacity(argc); | 54 ASSERT(function.isFunction()); |
| 56 for (int i = 0; i < argc; ++i) | 55 m_function.set(isolate, v8::Handle<v8::Function>::Cast(function.v8Value())); |
| 57 m_info.Append(argv[i]); | 56 m_info.ReserveCapacity(arguments.size()); |
| 57 for (const ScriptValue& argument : arguments) | |
| 58 m_info.Append(argument.v8Value()); | |
| 58 } | 59 } |
| 59 | 60 |
| 60 ScheduledAction::ScheduledAction(ScriptState* scriptState, const String& code, c onst KURL& url, v8::Isolate* isolate) | 61 ScheduledAction::ScheduledAction(ScriptState* scriptState, const String& code, c onst KURL& url, v8::Isolate* isolate) |
| 61 : m_scriptState(scriptState) | 62 : m_scriptState(scriptState) |
| 62 , m_info(isolate) | 63 , m_info(isolate) |
| 63 , m_code(code, url) | 64 , m_code(code, url) |
| 64 { | 65 { |
| 65 } | 66 } |
| 66 | 67 |
| 67 ScheduledAction::~ScheduledAction() | 68 ScheduledAction::~ScheduledAction() |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 } | 125 } |
| 125 | 126 |
| 126 void ScheduledAction::createLocalHandlesForArgs(Vector<v8::Handle<v8::Value> >* handles) | 127 void ScheduledAction::createLocalHandlesForArgs(Vector<v8::Handle<v8::Value> >* handles) |
| 127 { | 128 { |
| 128 handles->reserveCapacity(m_info.Size()); | 129 handles->reserveCapacity(m_info.Size()); |
| 129 for (size_t i = 0; i < m_info.Size(); ++i) | 130 for (size_t i = 0; i < m_info.Size(); ++i) |
| 130 handles->append(m_info.Get(i)); | 131 handles->append(m_info.Get(i)); |
| 131 } | 132 } |
| 132 | 133 |
| 133 } // namespace blink | 134 } // namespace blink |
| OLD | NEW |