| 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 { | 358 { |
| 359 m_frontend->executionContextsCleared(); | 359 m_frontend->executionContextsCleared(); |
| 360 ErrorString error; | 360 ErrorString error; |
| 361 enable(&error); | 361 enable(&error); |
| 362 if (m_state->booleanProperty(V8RuntimeAgentImplState::customObjectFormatterE
nabled, false)) | 362 if (m_state->booleanProperty(V8RuntimeAgentImplState::customObjectFormatterE
nabled, false)) |
| 363 m_session->setCustomObjectFormatterEnabled(true); | 363 m_session->setCustomObjectFormatterEnabled(true); |
| 364 } | 364 } |
| 365 | 365 |
| 366 void V8RuntimeAgentImpl::enable(ErrorString* errorString) | 366 void V8RuntimeAgentImpl::enable(ErrorString* errorString) |
| 367 { | 367 { |
| 368 if (m_enabled) |
| 369 return; |
| 370 m_session->changeInstrumentationCounter(+1); |
| 368 m_enabled = true; | 371 m_enabled = true; |
| 369 v8::HandleScope handles(m_debugger->isolate()); | 372 v8::HandleScope handles(m_debugger->isolate()); |
| 370 m_session->reportAllContexts(this); | 373 m_session->reportAllContexts(this); |
| 371 } | 374 } |
| 372 | 375 |
| 373 void V8RuntimeAgentImpl::disable(ErrorString* errorString) | 376 void V8RuntimeAgentImpl::disable(ErrorString* errorString) |
| 374 { | 377 { |
| 375 if (!m_enabled) | 378 if (!m_enabled) |
| 376 return; | 379 return; |
| 377 m_enabled = false; | 380 m_enabled = false; |
| 378 m_session->discardInjectedScripts(); | 381 m_session->discardInjectedScripts(); |
| 379 reset(); | 382 reset(); |
| 383 m_session->changeInstrumentationCounter(-1); |
| 380 } | 384 } |
| 381 | 385 |
| 382 void V8RuntimeAgentImpl::setClearConsoleCallback(PassOwnPtr<V8RuntimeAgent::Clea
rConsoleCallback> callback) | 386 void V8RuntimeAgentImpl::setClearConsoleCallback(PassOwnPtr<V8RuntimeAgent::Clea
rConsoleCallback> callback) |
| 383 { | 387 { |
| 384 m_session->setClearConsoleCallback(callback); | 388 m_session->setClearConsoleCallback(callback); |
| 385 } | 389 } |
| 386 | 390 |
| 387 PassOwnPtr<RemoteObject> V8RuntimeAgentImpl::wrapObject(v8::Local<v8::Context> c
ontext, v8::Local<v8::Value> value, const String16& groupName, bool generatePrev
iew) | 391 PassOwnPtr<RemoteObject> V8RuntimeAgentImpl::wrapObject(v8::Local<v8::Context> c
ontext, v8::Local<v8::Value> value, const String16& groupName, bool generatePrev
iew) |
| 388 { | 392 { |
| 389 ErrorString errorString; | 393 ErrorString errorString; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 } | 469 } |
| 466 } | 470 } |
| 467 | 471 |
| 468 void V8RuntimeAgentImpl::inspect(PassOwnPtr<protocol::Runtime::RemoteObject> obj
ectToInspect, PassOwnPtr<protocol::DictionaryValue> hints) | 472 void V8RuntimeAgentImpl::inspect(PassOwnPtr<protocol::Runtime::RemoteObject> obj
ectToInspect, PassOwnPtr<protocol::DictionaryValue> hints) |
| 469 { | 473 { |
| 470 if (m_enabled) | 474 if (m_enabled) |
| 471 m_frontend->inspectRequested(objectToInspect, hints); | 475 m_frontend->inspectRequested(objectToInspect, hints); |
| 472 } | 476 } |
| 473 | 477 |
| 474 } // namespace blink | 478 } // namespace blink |
| OLD | NEW |