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

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

Issue 23799009: Always pass v8::Isolate to v8::Number::New() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 void ScriptCallArgumentHandler::appendArgument(const char* argument) 68 void ScriptCallArgumentHandler::appendArgument(const char* argument)
69 { 69 {
70 ScriptScope scope(m_scriptState); 70 ScriptScope scope(m_scriptState);
71 m_arguments.append(v8String(argument, m_scriptState->isolate())); 71 m_arguments.append(v8String(argument, m_scriptState->isolate()));
72 } 72 }
73 73
74 void ScriptCallArgumentHandler::appendArgument(long argument) 74 void ScriptCallArgumentHandler::appendArgument(long argument)
75 { 75 {
76 ScriptScope scope(m_scriptState); 76 ScriptScope scope(m_scriptState);
77 m_arguments.append(v8::Number::New(argument)); 77 m_arguments.append(v8::Number::New(m_scriptState->isolate(), argument));
78 } 78 }
79 79
80 void ScriptCallArgumentHandler::appendArgument(long long argument) 80 void ScriptCallArgumentHandler::appendArgument(long long argument)
81 { 81 {
82 ScriptScope scope(m_scriptState); 82 ScriptScope scope(m_scriptState);
83 m_arguments.append(v8::Number::New(argument)); 83 m_arguments.append(v8::Number::New(m_scriptState->isolate(), argument));
84 } 84 }
85 85
86 void ScriptCallArgumentHandler::appendArgument(unsigned int argument) 86 void ScriptCallArgumentHandler::appendArgument(unsigned int argument)
87 { 87 {
88 ScriptScope scope(m_scriptState); 88 ScriptScope scope(m_scriptState);
89 m_arguments.append(v8::Number::New(argument)); 89 m_arguments.append(v8::Number::New(m_scriptState->isolate(), argument));
90 } 90 }
91 91
92 void ScriptCallArgumentHandler::appendArgument(unsigned long argument) 92 void ScriptCallArgumentHandler::appendArgument(unsigned long argument)
93 { 93 {
94 ScriptScope scope(m_scriptState); 94 ScriptScope scope(m_scriptState);
95 m_arguments.append(v8::Number::New(argument)); 95 m_arguments.append(v8::Number::New(m_scriptState->isolate(), argument));
96 } 96 }
97 97
98 void ScriptCallArgumentHandler::appendArgument(int argument) 98 void ScriptCallArgumentHandler::appendArgument(int argument)
99 { 99 {
100 ScriptScope scope(m_scriptState); 100 ScriptScope scope(m_scriptState);
101 m_arguments.append(v8::Number::New(argument)); 101 m_arguments.append(v8::Number::New(m_scriptState->isolate(), argument));
102 } 102 }
103 103
104 void ScriptCallArgumentHandler::appendArgument(bool argument) 104 void ScriptCallArgumentHandler::appendArgument(bool argument)
105 { 105 {
106 m_arguments.append(v8Boolean(argument)); 106 m_arguments.append(v8Boolean(argument));
107 } 107 }
108 108
109 ScriptFunctionCall::ScriptFunctionCall(const ScriptObject& thisObject, const Str ing& name) 109 ScriptFunctionCall::ScriptFunctionCall(const ScriptObject& thisObject, const Str ing& name)
110 : ScriptCallArgumentHandler(thisObject.scriptState()) 110 : ScriptCallArgumentHandler(thisObject.scriptState())
111 , m_thisObject(thisObject) 111 , m_thisObject(thisObject)
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 OwnArrayPtr<v8::Handle<v8::Value> > args = adoptArrayPtr(new v8::Handle<v8:: Value>[m_arguments.size()]); 194 OwnArrayPtr<v8::Handle<v8::Value> > args = adoptArrayPtr(new v8::Handle<v8:: Value>[m_arguments.size()]);
195 for (size_t i = 0; i < m_arguments.size(); ++i) 195 for (size_t i = 0; i < m_arguments.size(); ++i)
196 args[i] = m_arguments[i].v8Value(); 196 args[i] = m_arguments[i].v8Value();
197 197
198 v8::Handle<v8::Value> result = ScriptController::callFunctionWithInstrumenta tion(0, function, object, m_arguments.size(), args.get(), m_scriptState->isolate ()); 198 v8::Handle<v8::Value> result = ScriptController::callFunctionWithInstrumenta tion(0, function, object, m_arguments.size(), args.get(), m_scriptState->isolate ());
199 return ScriptValue(result); 199 return ScriptValue(result);
200 } 200 }
201 201
202 } // namespace WebCore 202 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/IDBBindingUtilities.cpp ('k') | Source/bindings/v8/SerializedScriptValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698