| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 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 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "FunctionCall",
"data", InspectorFunctionCallEvent::data(executionContext, 0, name(), 1)); | 145 ScriptState::Scope scope(m_injectedScriptObject.scriptState()); |
| 146 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willCallFu
nction(executionContext, DevToolsFunctionInfo(0, name(), 1)); | 146 v8::Handle<v8::Function> functionObj = function.function(); |
| 147 DevToolsFunctionInfo info(functionObj); |
| 148 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "FunctionCall",
"data", InspectorFunctionCallEvent::data(executionContext, info.scriptId(), inf
o.resourceName(), info.lineNumber())); |
| 149 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willCallFu
nction(executionContext, info); |
| 147 | 150 |
| 148 ScriptState* scriptState = m_injectedScriptObject.scriptState(); | 151 ScriptState* scriptState = m_injectedScriptObject.scriptState(); |
| 149 bool evalIsDisabled = false; | 152 bool evalIsDisabled = false; |
| 150 if (scriptState) { | 153 if (scriptState) { |
| 151 evalIsDisabled = !scriptState->evalEnabled(); | 154 evalIsDisabled = !scriptState->evalEnabled(); |
| 152 // Temporarily enable allow evals for inspector. | 155 // Temporarily enable allow evals for inspector. |
| 153 if (evalIsDisabled) | 156 if (evalIsDisabled) |
| 154 scriptState->setEvalEnabled(true); | 157 scriptState->setEvalEnabled(true); |
| 155 } | 158 } |
| 156 | 159 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 if (wasThrownVal) { | 214 if (wasThrownVal) { |
| 212 RefPtr<JSONObject> objectExceptionDetails = resultPair->getObject("excep
tionDetails"); | 215 RefPtr<JSONObject> objectExceptionDetails = resultPair->getObject("excep
tionDetails"); |
| 213 if (objectExceptionDetails) | 216 if (objectExceptionDetails) |
| 214 *exceptionDetails = toExceptionDetails(objectExceptionDetails.releas
e()); | 217 *exceptionDetails = toExceptionDetails(objectExceptionDetails.releas
e()); |
| 215 } | 218 } |
| 216 *objectResult = TypeBuilder::Runtime::RemoteObject::runtimeCast(resultObj); | 219 *objectResult = TypeBuilder::Runtime::RemoteObject::runtimeCast(resultObj); |
| 217 *wasThrown = wasThrownVal; | 220 *wasThrown = wasThrownVal; |
| 218 } | 221 } |
| 219 | 222 |
| 220 } // namespace blink | 223 } // namespace blink |
| OLD | NEW |