| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 ErrorString error; | 355 ErrorString error; |
| 356 enable(&error); | 356 enable(&error); |
| 357 if (m_state->booleanProperty(V8RuntimeAgentImplState::customObjectFormatterE
nabled, false)) | 357 if (m_state->booleanProperty(V8RuntimeAgentImplState::customObjectFormatterE
nabled, false)) |
| 358 m_session->setCustomObjectFormatterEnabled(true); | 358 m_session->setCustomObjectFormatterEnabled(true); |
| 359 } | 359 } |
| 360 | 360 |
| 361 void V8RuntimeAgentImpl::enable(ErrorString* errorString) | 361 void V8RuntimeAgentImpl::enable(ErrorString* errorString) |
| 362 { | 362 { |
| 363 if (m_enabled) | 363 if (m_enabled) |
| 364 return; | 364 return; |
| 365 m_session->changeInstrumentationCounter(+1); | 365 m_session->client()->runtimeEnabled(); |
| 366 m_enabled = true; | 366 m_enabled = true; |
| 367 m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, true); | 367 m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, true); |
| 368 v8::HandleScope handles(m_debugger->isolate()); | 368 v8::HandleScope handles(m_debugger->isolate()); |
| 369 m_session->reportAllContexts(this); | 369 m_session->reportAllContexts(this); |
| 370 } | 370 } |
| 371 | 371 |
| 372 void V8RuntimeAgentImpl::disable(ErrorString* errorString) | 372 void V8RuntimeAgentImpl::disable(ErrorString* errorString) |
| 373 { | 373 { |
| 374 if (!m_enabled) | 374 if (!m_enabled) |
| 375 return; | 375 return; |
| 376 m_enabled = false; | 376 m_enabled = false; |
| 377 m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, false); | 377 m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, false); |
| 378 m_session->discardInjectedScripts(); | 378 m_session->discardInjectedScripts(); |
| 379 reset(); | 379 reset(); |
| 380 m_session->changeInstrumentationCounter(-1); | 380 m_session->client()->runtimeDisabled(); |
| 381 } | 381 } |
| 382 | 382 |
| 383 void V8RuntimeAgentImpl::reset() | 383 void V8RuntimeAgentImpl::reset() |
| 384 { | 384 { |
| 385 m_compiledScripts.clear(); | 385 m_compiledScripts.clear(); |
| 386 if (m_enabled) { | 386 if (m_enabled) { |
| 387 if (const V8DebuggerImpl::ContextByIdMap* contexts = m_debugger->context
Group(m_session->contextGroupId())) { | 387 if (const V8DebuggerImpl::ContextByIdMap* contexts = m_debugger->context
Group(m_session->contextGroupId())) { |
| 388 for (auto& idContext : *contexts) | 388 for (auto& idContext : *contexts) |
| 389 idContext.second->setReported(false); | 389 idContext.second->setReported(false); |
| 390 } | 390 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 414 } | 414 } |
| 415 } | 415 } |
| 416 | 416 |
| 417 void V8RuntimeAgentImpl::inspect(std::unique_ptr<protocol::Runtime::RemoteObject
> objectToInspect, std::unique_ptr<protocol::DictionaryValue> hints) | 417 void V8RuntimeAgentImpl::inspect(std::unique_ptr<protocol::Runtime::RemoteObject
> objectToInspect, std::unique_ptr<protocol::DictionaryValue> hints) |
| 418 { | 418 { |
| 419 if (m_enabled) | 419 if (m_enabled) |
| 420 m_frontend.inspectRequested(std::move(objectToInspect), std::move(hints)
); | 420 m_frontend.inspectRequested(std::move(objectToInspect), std::move(hints)
); |
| 421 } | 421 } |
| 422 | 422 |
| 423 } // namespace blink | 423 } // namespace blink |
| OLD | NEW |