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

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

Issue 23619034: Pass isolate to v8::False() / v8::True() when possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update more places 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
« no previous file with comments | « Source/bindings/v8/ScriptFunctionCall.cpp ('k') | no next file » | 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 return scriptData.release(); 63 return scriptData.release();
64 } 64 }
65 65
66 v8::Local<v8::Script> V8ScriptRunner::compileScript(v8::Handle<v8::String> code, const String& fileName, const TextPosition& scriptStartPosition, v8::ScriptData * scriptData, v8::Isolate* isolate, AccessControlStatus corsStatus) 66 v8::Local<v8::Script> V8ScriptRunner::compileScript(v8::Handle<v8::String> code, const String& fileName, const TextPosition& scriptStartPosition, v8::ScriptData * scriptData, v8::Isolate* isolate, AccessControlStatus corsStatus)
67 { 67 {
68 TRACE_EVENT0("v8", "v8.compile"); 68 TRACE_EVENT0("v8", "v8.compile");
69 TRACE_EVENT_SCOPED_SAMPLING_STATE("V8", "Compile"); 69 TRACE_EVENT_SCOPED_SAMPLING_STATE("V8", "Compile");
70 v8::Handle<v8::String> name = v8String(fileName, isolate); 70 v8::Handle<v8::String> name = v8String(fileName, isolate);
71 v8::Handle<v8::Integer> line = v8::Integer::New(scriptStartPosition.m_line.z eroBasedInt(), isolate); 71 v8::Handle<v8::Integer> line = v8::Integer::New(scriptStartPosition.m_line.z eroBasedInt(), isolate);
72 v8::Handle<v8::Integer> column = v8::Integer::New(scriptStartPosition.m_colu mn.zeroBasedInt(), isolate); 72 v8::Handle<v8::Integer> column = v8::Integer::New(scriptStartPosition.m_colu mn.zeroBasedInt(), isolate);
73 v8::Handle<v8::Boolean> isSharedCrossOrigin = corsStatus == SharableCrossOri gin ? v8::True() : v8::False(); 73 v8::Handle<v8::Boolean> isSharedCrossOrigin = corsStatus == SharableCrossOri gin ? v8::True(isolate) : v8::False(isolate);
74 v8::ScriptOrigin origin(name, line, column, isSharedCrossOrigin); 74 v8::ScriptOrigin origin(name, line, column, isSharedCrossOrigin);
75 return v8::Script::Compile(code, &origin, scriptData); 75 return v8::Script::Compile(code, &origin, scriptData);
76 } 76 }
77 77
78 v8::Local<v8::Value> V8ScriptRunner::runCompiledScript(v8::Handle<v8::Script> sc ript, ScriptExecutionContext* context, v8::Isolate* isolate) 78 v8::Local<v8::Value> V8ScriptRunner::runCompiledScript(v8::Handle<v8::Script> sc ript, ScriptExecutionContext* context, v8::Isolate* isolate)
79 { 79 {
80 TRACE_EVENT0("v8", "v8.run"); 80 TRACE_EVENT0("v8", "v8.run");
81 TRACE_EVENT_SCOPED_SAMPLING_STATE("V8", "Execution"); 81 TRACE_EVENT_SCOPED_SAMPLING_STATE("V8", "Execution");
82 if (script.IsEmpty()) 82 if (script.IsEmpty())
83 return v8::Local<v8::Value>(); 83 return v8::Local<v8::Value>();
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 { 187 {
188 TRACE_EVENT0("v8", "v8.newInstance"); 188 TRACE_EVENT0("v8", "v8.newInstance");
189 TRACE_EVENT_SCOPED_SAMPLING_STATE("V8", "Execution"); 189 TRACE_EVENT_SCOPED_SAMPLING_STATE("V8", "Execution");
190 V8RecursionScope scope(context); 190 V8RecursionScope scope(context);
191 v8::Local<v8::Object> result = function->NewInstance(argc, argv); 191 v8::Local<v8::Object> result = function->NewInstance(argc, argv);
192 crashIfV8IsDead(); 192 crashIfV8IsDead();
193 return result; 193 return result;
194 } 194 }
195 195
196 } // namespace WebCore 196 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/ScriptFunctionCall.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698