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

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

Issue 24118003: Pass isolate to v8::Undefined() function (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master 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/NPV8Object.cpp ('k') | Source/bindings/v8/SerializedScriptValue.cpp » ('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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 m_context.set(m_isolate, context); 68 m_context.set(m_isolate, context);
69 m_preprocessorFunction.set(m_isolate, v8::Handle<v8::Function>::Cast(preproc essorFunction.v8Value())); 69 m_preprocessorFunction.set(m_isolate, v8::Handle<v8::Function>::Cast(preproc essorFunction.v8Value()));
70 } 70 }
71 71
72 String ScriptPreprocessor::preprocessSourceCode(const String& sourceCode, const String& sourceName) 72 String ScriptPreprocessor::preprocessSourceCode(const String& sourceCode, const String& sourceName)
73 { 73 {
74 if (!isValid()) 74 if (!isValid())
75 return sourceCode; 75 return sourceCode;
76 76
77 return preprocessSourceCode(sourceCode, sourceName, v8::Undefined()); 77 return preprocessSourceCode(sourceCode, sourceName, v8::Undefined(m_isolate) );
78 } 78 }
79 79
80 String ScriptPreprocessor::preprocessSourceCode(const String& sourceCode, const String& sourceName, const String& functionName) 80 String ScriptPreprocessor::preprocessSourceCode(const String& sourceCode, const String& sourceName, const String& functionName)
81 { 81 {
82 if (!isValid()) 82 if (!isValid())
83 return sourceCode; 83 return sourceCode;
84 84
85 v8::Handle<v8::String> functionNameString = v8String(functionName, m_isolate ); 85 v8::Handle<v8::String> functionNameString = v8String(functionName, m_isolate );
86 return preprocessSourceCode(sourceCode, sourceName, functionNameString); 86 return preprocessSourceCode(sourceCode, sourceName, functionNameString);
87 } 87 }
(...skipping 15 matching lines...) Expand all
103 TemporaryChange<bool> isPreprocessing(m_isPreprocessing, true); 103 TemporaryChange<bool> isPreprocessing(m_isPreprocessing, true);
104 v8::Handle<v8::Value> resultValue = V8ScriptRunner::callAsFunction(m_preproc essorFunction.newLocal(m_isolate), m_context.newLocal(m_isolate)->Global(), WTF_ ARRAY_LENGTH(argv), argv); 104 v8::Handle<v8::Value> resultValue = V8ScriptRunner::callAsFunction(m_preproc essorFunction.newLocal(m_isolate), m_context.newLocal(m_isolate)->Global(), WTF_ ARRAY_LENGTH(argv), argv);
105 105
106 if (!resultValue.IsEmpty() && resultValue->IsString()) 106 if (!resultValue.IsEmpty() && resultValue->IsString())
107 return toWebCoreStringWithNullCheck(resultValue); 107 return toWebCoreStringWithNullCheck(resultValue);
108 108
109 return sourceCode; 109 return sourceCode;
110 } 110 }
111 111
112 } // namespace WebCore 112 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/NPV8Object.cpp ('k') | Source/bindings/v8/SerializedScriptValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698