| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010-2011 Google Inc. All rights reserved. | 2 * Copyright (c) 2010-2011 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 agent->willExecuteScript(function->ScriptId()); | 98 agent->willExecuteScript(function->ScriptId()); |
| 99 v8::MaybeLocal<v8::Value> result = function->Call(context, receiver, argc, i
nfo); | 99 v8::MaybeLocal<v8::Value> result = function->Call(context, receiver, argc, i
nfo); |
| 100 // Get agent from the map again, since it could have detached during script
execution. | 100 // Get agent from the map again, since it could have detached during script
execution. |
| 101 if (V8DebuggerAgentImpl* agent = enabledDebuggerAgentForGroup(groupId)) | 101 if (V8DebuggerAgentImpl* agent = enabledDebuggerAgentForGroup(groupId)) |
| 102 agent->didExecuteScript(); | 102 agent->didExecuteScript(); |
| 103 return result; | 103 return result; |
| 104 } | 104 } |
| 105 | 105 |
| 106 v8::MaybeLocal<v8::Value> V8InspectorImpl::compileAndRunInternalScript(v8::Local
<v8::Context> context, v8::Local<v8::String> source) | 106 v8::MaybeLocal<v8::Value> V8InspectorImpl::compileAndRunInternalScript(v8::Local
<v8::Context> context, v8::Local<v8::String> source) |
| 107 { | 107 { |
| 108 v8::Local<v8::Script> script = compileScript(context, source, String(), true
); | 108 v8::Local<v8::Script> script = compileScript(context, source, String16(), tr
ue); |
| 109 if (script.IsEmpty()) | 109 if (script.IsEmpty()) |
| 110 return v8::MaybeLocal<v8::Value>(); | 110 return v8::MaybeLocal<v8::Value>(); |
| 111 v8::MicrotasksScope microtasksScope(m_isolate, v8::MicrotasksScope::kDoNotRu
nMicrotasks); | 111 v8::MicrotasksScope microtasksScope(m_isolate, v8::MicrotasksScope::kDoNotRu
nMicrotasks); |
| 112 return script->Run(context); | 112 return script->Run(context); |
| 113 } | 113 } |
| 114 | 114 |
| 115 v8::Local<v8::Script> V8InspectorImpl::compileScript(v8::Local<v8::Context> cont
ext, v8::Local<v8::String> code, const String16& fileName, bool markAsInternal) | 115 v8::Local<v8::Script> V8InspectorImpl::compileScript(v8::Local<v8::Context> cont
ext, v8::Local<v8::String> code, const String16& fileName, bool markAsInternal) |
| 116 { | 116 { |
| 117 v8::ScriptOrigin origin( | 117 v8::ScriptOrigin origin( |
| 118 toV8String(m_isolate, fileName), | 118 toV8String(m_isolate, fileName), |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 | 341 |
| 342 V8InspectorSessionImpl* V8InspectorImpl::sessionForContextGroup(int contextGroup
Id) | 342 V8InspectorSessionImpl* V8InspectorImpl::sessionForContextGroup(int contextGroup
Id) |
| 343 { | 343 { |
| 344 if (!contextGroupId) | 344 if (!contextGroupId) |
| 345 return nullptr; | 345 return nullptr; |
| 346 SessionMap::iterator iter = m_sessions.find(contextGroupId); | 346 SessionMap::iterator iter = m_sessions.find(contextGroupId); |
| 347 return iter == m_sessions.end() ? nullptr : iter->second; | 347 return iter == m_sessions.end() ? nullptr : iter->second; |
| 348 } | 348 } |
| 349 | 349 |
| 350 } // namespace blink | 350 } // namespace blink |
| OLD | NEW |