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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 m_handleScope(m_inspector->isolate()), | 421 m_handleScope(m_inspector->isolate()), |
422 m_tryCatch(m_inspector->isolate()), | 422 m_tryCatch(m_inspector->isolate()), |
423 m_ignoreExceptionsAndMuteConsole(false), | 423 m_ignoreExceptionsAndMuteConsole(false), |
424 m_previousPauseOnExceptionsState(v8::debug::NoBreakOnException), | 424 m_previousPauseOnExceptionsState(v8::debug::NoBreakOnException), |
425 m_userGesture(false), | 425 m_userGesture(false), |
426 m_contextGroupId(session->contextGroupId()), | 426 m_contextGroupId(session->contextGroupId()), |
427 m_sessionId(session->sessionId()) {} | 427 m_sessionId(session->sessionId()) {} |
428 | 428 |
429 Response InjectedScript::Scope::initialize() { | 429 Response InjectedScript::Scope::initialize() { |
430 cleanup(); | 430 cleanup(); |
431 V8InspectorSessionImpl* session = m_inspector->sessionById(m_sessionId); | 431 V8InspectorSessionImpl* session = |
| 432 m_inspector->sessionById(m_contextGroupId, m_sessionId); |
432 if (!session) return Response::InternalError(); | 433 if (!session) return Response::InternalError(); |
433 Response response = findInjectedScript(session); | 434 Response response = findInjectedScript(session); |
434 if (!response.isSuccess()) return response; | 435 if (!response.isSuccess()) return response; |
435 m_context = m_injectedScript->context()->context(); | 436 m_context = m_injectedScript->context()->context(); |
436 m_context->Enter(); | 437 m_context->Enter(); |
437 return Response::OK(); | 438 return Response::OK(); |
438 } | 439 } |
439 | 440 |
440 void InjectedScript::Scope::installCommandLineAPI() { | 441 void InjectedScript::Scope::installCommandLineAPI() { |
441 DCHECK(m_injectedScript && !m_context.IsEmpty() && | 442 DCHECK(m_injectedScript && !m_context.IsEmpty() && |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 Response InjectedScript::CallFrameScope::findInjectedScript( | 530 Response InjectedScript::CallFrameScope::findInjectedScript( |
530 V8InspectorSessionImpl* session) { | 531 V8InspectorSessionImpl* session) { |
531 std::unique_ptr<RemoteCallFrameId> remoteId; | 532 std::unique_ptr<RemoteCallFrameId> remoteId; |
532 Response response = RemoteCallFrameId::parse(m_remoteCallFrameId, &remoteId); | 533 Response response = RemoteCallFrameId::parse(m_remoteCallFrameId, &remoteId); |
533 if (!response.isSuccess()) return response; | 534 if (!response.isSuccess()) return response; |
534 m_frameOrdinal = static_cast<size_t>(remoteId->frameOrdinal()); | 535 m_frameOrdinal = static_cast<size_t>(remoteId->frameOrdinal()); |
535 return session->findInjectedScript(remoteId.get(), m_injectedScript); | 536 return session->findInjectedScript(remoteId.get(), m_injectedScript); |
536 } | 537 } |
537 | 538 |
538 } // namespace v8_inspector | 539 } // namespace v8_inspector |
OLD | NEW |