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

Side by Side Diff: Source/core/inspector/InjectedScriptBase.cpp

Issue 1104233004: DevTools: rebaseline inspector tests with poor expectations (2). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebaselined Created 5 years, 7 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
OLDNEW
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
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(), "In jectedScriptSource.js", 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 String text = !message.IsEmpty() ? toCoreStringWithUndefinedOrNullCheck( message->Get()) : "Internal error"; 230 String text = !message.IsEmpty() ? toCoreStringWithUndefinedOrNullCheck( message->Get()) : "Internal error";
228 *exceptionDetails = TypeBuilder::Debugger::ExceptionDetails::create().se tText(text); 231 *exceptionDetails = TypeBuilder::Debugger::ExceptionDetails::create().se tText(text);
229 } else { 232 } else {
230 *result = toJSONValue(resultValue); 233 *result = toJSONValue(resultValue);
231 if (!*result) 234 if (!*result)
232 *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));
233 } 236 }
234 } 237 }
235 238
236 } // namespace blink 239 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8Binding.cpp ('k') | Source/devtools/front_end/timeline/TimelineModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698