Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(460)

Side by Side Diff: Source/bindings/v8/ScriptFunctionCall.cpp

Issue 136333007: DevTools: Implement evaluation on async call frames. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/bindings/v8/ScriptFunctionCall.h ('k') | Source/core/inspector/InjectedScript.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 ScriptScope scope(m_scriptState); 106 ScriptScope scope(m_scriptState);
107 m_arguments.append(ScriptValue(v8::Number::New(isolate, argument), isolate)) ; 107 m_arguments.append(ScriptValue(v8::Number::New(isolate, argument), isolate)) ;
108 } 108 }
109 109
110 void ScriptCallArgumentHandler::appendArgument(bool argument) 110 void ScriptCallArgumentHandler::appendArgument(bool argument)
111 { 111 {
112 v8::Isolate* isolate = m_scriptState->isolate(); 112 v8::Isolate* isolate = m_scriptState->isolate();
113 m_arguments.append(ScriptValue(v8Boolean(argument, isolate), isolate)); 113 m_arguments.append(ScriptValue(v8Boolean(argument, isolate), isolate));
114 } 114 }
115 115
116 void ScriptCallArgumentHandler::appendArgument(const Vector<ScriptValue>& argume nt)
117 {
118 v8::Isolate* isolate = m_scriptState->isolate();
119 ScriptScope scope(m_scriptState);
120 v8::Handle<v8::Array> result = v8::Array::New(isolate, argument.size());
121 for (size_t i = 0; i < argument.size(); ++i)
122 result->Set(v8::Integer::New(isolate, i), argument[i].v8Value());
123 m_arguments.append(ScriptValue(result, isolate));
124 }
125
116 ScriptFunctionCall::ScriptFunctionCall(const ScriptObject& thisObject, const Str ing& name) 126 ScriptFunctionCall::ScriptFunctionCall(const ScriptObject& thisObject, const Str ing& name)
117 : ScriptCallArgumentHandler(thisObject.scriptState()) 127 : ScriptCallArgumentHandler(thisObject.scriptState())
118 , m_thisObject(thisObject) 128 , m_thisObject(thisObject)
119 , m_name(name) 129 , m_name(name)
120 { 130 {
121 } 131 }
122 132
123 ScriptValue ScriptFunctionCall::call(bool& hadException, bool reportExceptions) 133 ScriptValue ScriptFunctionCall::call(bool& hadException, bool reportExceptions)
124 { 134 {
125 ScriptScope scope(m_scriptState, reportExceptions); 135 ScriptScope scope(m_scriptState, reportExceptions);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 212
203 OwnPtr<v8::Handle<v8::Value>[]> info = adoptArrayPtr(new v8::Handle<v8::Valu e>[m_arguments.size()]); 213 OwnPtr<v8::Handle<v8::Value>[]> info = adoptArrayPtr(new v8::Handle<v8::Valu e>[m_arguments.size()]);
204 for (size_t i = 0; i < m_arguments.size(); ++i) 214 for (size_t i = 0; i < m_arguments.size(); ++i)
205 info[i] = m_arguments[i].v8Value(); 215 info[i] = m_arguments[i].v8Value();
206 216
207 v8::Handle<v8::Value> result = ScriptController::callFunction(m_scriptState- >executionContext(), function, object, m_arguments.size(), info.get(), m_scriptS tate->isolate()); 217 v8::Handle<v8::Value> result = ScriptController::callFunction(m_scriptState- >executionContext(), function, object, m_arguments.size(), info.get(), m_scriptS tate->isolate());
208 return ScriptValue(result, m_scriptState->isolate()); 218 return ScriptValue(result, m_scriptState->isolate());
209 } 219 }
210 220
211 } // namespace WebCore 221 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/ScriptFunctionCall.h ('k') | Source/core/inspector/InjectedScript.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698