| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // Get agent from the map again, since it could have detached during script | 90 // Get agent from the map again, since it could have detached during script |
| 91 // execution. | 91 // execution. |
| 92 if (V8DebuggerAgentImpl* agent = enabledDebuggerAgentForGroup(groupId)) | 92 if (V8DebuggerAgentImpl* agent = enabledDebuggerAgentForGroup(groupId)) |
| 93 agent->didExecuteScript(); | 93 agent->didExecuteScript(); |
| 94 return result; | 94 return result; |
| 95 } | 95 } |
| 96 | 96 |
| 97 v8::MaybeLocal<v8::Value> V8InspectorImpl::callFunction( | 97 v8::MaybeLocal<v8::Value> V8InspectorImpl::callFunction( |
| 98 v8::Local<v8::Function> function, v8::Local<v8::Context> context, | 98 v8::Local<v8::Function> function, v8::Local<v8::Context> context, |
| 99 v8::Local<v8::Value> receiver, int argc, v8::Local<v8::Value> info[]) { | 99 v8::Local<v8::Value> receiver, int argc, v8::Local<v8::Value> info[]) { |
| 100 v8::MicrotasksScope microtasksScope(m_isolate, | 100 return callFunction(function, context, receiver, argc, info, |
| 101 v8::MicrotasksScope::kRunMicrotasks); | 101 v8::MicrotasksScope::kRunMicrotasks); |
| 102 } |
| 103 |
| 104 v8::MaybeLocal<v8::Value> V8InspectorImpl::callInternalFunction( |
| 105 v8::Local<v8::Function> function, v8::Local<v8::Context> context, |
| 106 v8::Local<v8::Value> receiver, int argc, v8::Local<v8::Value> info[]) { |
| 107 return callFunction(function, context, receiver, argc, info, |
| 108 v8::MicrotasksScope::kDoNotRunMicrotasks); |
| 109 } |
| 110 |
| 111 v8::MaybeLocal<v8::Value> V8InspectorImpl::callFunction( |
| 112 v8::Local<v8::Function> function, v8::Local<v8::Context> context, |
| 113 v8::Local<v8::Value> receiver, int argc, v8::Local<v8::Value> info[], |
| 114 v8::MicrotasksScope::Type runMicrotasks) { |
| 115 v8::MicrotasksScope microtasksScope(m_isolate, runMicrotasks); |
| 102 int groupId = V8Debugger::getGroupId(context); | 116 int groupId = V8Debugger::getGroupId(context); |
| 103 if (V8DebuggerAgentImpl* agent = enabledDebuggerAgentForGroup(groupId)) | 117 if (V8DebuggerAgentImpl* agent = enabledDebuggerAgentForGroup(groupId)) |
| 104 agent->willExecuteScript(function->ScriptId()); | 118 agent->willExecuteScript(function->ScriptId()); |
| 105 v8::MaybeLocal<v8::Value> result = | 119 v8::MaybeLocal<v8::Value> result = |
| 106 function->Call(context, receiver, argc, info); | 120 function->Call(context, receiver, argc, info); |
| 107 // Get agent from the map again, since it could have detached during script | 121 // Get agent from the map again, since it could have detached during script |
| 108 // execution. | 122 // execution. |
| 109 if (V8DebuggerAgentImpl* agent = enabledDebuggerAgentForGroup(groupId)) | 123 if (V8DebuggerAgentImpl* agent = enabledDebuggerAgentForGroup(groupId)) |
| 110 agent->didExecuteScript(); | 124 agent->didExecuteScript(); |
| 111 return result; | 125 return result; |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 } | 379 } |
| 366 | 380 |
| 367 V8InspectorSessionImpl* V8InspectorImpl::sessionForContextGroup( | 381 V8InspectorSessionImpl* V8InspectorImpl::sessionForContextGroup( |
| 368 int contextGroupId) { | 382 int contextGroupId) { |
| 369 if (!contextGroupId) return nullptr; | 383 if (!contextGroupId) return nullptr; |
| 370 SessionMap::iterator iter = m_sessions.find(contextGroupId); | 384 SessionMap::iterator iter = m_sessions.find(contextGroupId); |
| 371 return iter == m_sessions.end() ? nullptr : iter->second; | 385 return iter == m_sessions.end() ? nullptr : iter->second; |
| 372 } | 386 } |
| 373 | 387 |
| 374 } // namespace v8_inspector | 388 } // namespace v8_inspector |
| OLD | NEW |