OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 const ScriptValue& InjectedScriptBase::injectedScriptObject() const | 136 const ScriptValue& InjectedScriptBase::injectedScriptObject() const |
137 { | 137 { |
138 return m_injectedScriptObject; | 138 return m_injectedScriptObject; |
139 } | 139 } |
140 | 140 |
141 ScriptValue InjectedScriptBase::callFunctionWithEvalEnabled(ScriptFunctionCall&
function, bool& hadException) const | 141 ScriptValue InjectedScriptBase::callFunctionWithEvalEnabled(ScriptFunctionCall&
function, bool& hadException) const |
142 { | 142 { |
143 ASSERT(!isEmpty()); | 143 ASSERT(!isEmpty()); |
144 ExecutionContext* executionContext = m_injectedScriptObject.scriptState()->e
xecutionContext(); | 144 ExecutionContext* executionContext = m_injectedScriptObject.scriptState()->e
xecutionContext(); |
145 ScriptState::Scope scope(m_injectedScriptObject.scriptState()); | 145 ScriptState::Scope scope(m_injectedScriptObject.scriptState()); |
146 v8::Handle<v8::Function> functionObj = function.function(); | 146 v8::Local<v8::Function> functionObj = function.function(); |
147 DevToolsFunctionInfo info(functionObj); | 147 DevToolsFunctionInfo info(functionObj); |
148 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "FunctionCall",
"data", InspectorFunctionCallEvent::data(executionContext, info.scriptId(), "In
jectedScriptSource.js", info.lineNumber())); | 148 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "FunctionCall",
"data", InspectorFunctionCallEvent::data(executionContext, info.scriptId(), "In
jectedScriptSource.js", info.lineNumber())); |
149 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willCallFu
nction(executionContext, info); | 149 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willCallFu
nction(executionContext, info); |
150 | 150 |
151 ScriptState* scriptState = m_injectedScriptObject.scriptState(); | 151 ScriptState* scriptState = m_injectedScriptObject.scriptState(); |
152 bool evalIsDisabled = false; | 152 bool evalIsDisabled = false; |
153 if (scriptState) { | 153 if (scriptState) { |
154 evalIsDisabled = !scriptState->evalEnabled(); | 154 evalIsDisabled = !scriptState->evalEnabled(); |
155 // Temporarily enable allow evals for inspector. | 155 // Temporarily enable allow evals for inspector. |
156 if (evalIsDisabled) | 156 if (evalIsDisabled) |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 String text = !message.IsEmpty() ? toCoreStringWithUndefinedOrNullCheck(
message->Get()) : "Internal error"; | 230 String text = !message.IsEmpty() ? toCoreStringWithUndefinedOrNullCheck(
message->Get()) : "Internal error"; |
231 *exceptionDetails = TypeBuilder::Debugger::ExceptionDetails::create().se
tText(text); | 231 *exceptionDetails = TypeBuilder::Debugger::ExceptionDetails::create().se
tText(text); |
232 } else { | 232 } else { |
233 *result = toJSONValue(resultValue); | 233 *result = toJSONValue(resultValue); |
234 if (!*result) | 234 if (!*result) |
235 *result = JSONString::create(String::format("Object has too long ref
erence chain(must not be longer than %d)", JSONValue::maxDepth)); | 235 *result = JSONString::create(String::format("Object has too long ref
erence chain(must not be longer than %d)", JSONValue::maxDepth)); |
236 } | 236 } |
237 } | 237 } |
238 | 238 |
239 } // namespace blink | 239 } // namespace blink |
OLD | NEW |