| 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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 return v8::Local<v8::Value>(); | 416 return v8::Local<v8::Value>(); |
| 417 if (context) | 417 if (context) |
| 418 *context = injectedScript->context()->context(); | 418 *context = injectedScript->context()->context(); |
| 419 if (groupName) | 419 if (groupName) |
| 420 *groupName = injectedScript->objectGroupName(*remoteId); | 420 *groupName = injectedScript->objectGroupName(*remoteId); |
| 421 return objectValue; | 421 return objectValue; |
| 422 } | 422 } |
| 423 | 423 |
| 424 void V8RuntimeAgentImpl::addInspectedObject(PassOwnPtr<Inspectable> inspectable) | 424 void V8RuntimeAgentImpl::addInspectedObject(PassOwnPtr<Inspectable> inspectable) |
| 425 { | 425 { |
| 426 m_session->addInspectedObject(inspectable); | 426 m_inspectedObjects.prepend(inspectable); |
| 427 while (m_inspectedObjects.size() > inspectedObjectBufferSize) |
| 428 m_inspectedObjects.removeLast(); |
| 429 } |
| 430 |
| 431 V8RuntimeAgent::Inspectable* V8RuntimeAgentImpl::inspectedObject(unsigned num) |
| 432 { |
| 433 if (num >= m_inspectedObjects.size()) |
| 434 return nullptr; |
| 435 return m_inspectedObjects[num].get(); |
| 427 } | 436 } |
| 428 | 437 |
| 429 void V8RuntimeAgentImpl::reset() | 438 void V8RuntimeAgentImpl::reset() |
| 430 { | 439 { |
| 431 m_compiledScripts.clear(); | 440 m_compiledScripts.clear(); |
| 441 m_inspectedObjects.clear(); |
| 432 if (m_enabled) { | 442 if (m_enabled) { |
| 433 if (const V8DebuggerImpl::ContextByIdMap* contexts = m_debugger->context
Group(m_session->contextGroupId())) { | 443 if (const V8DebuggerImpl::ContextByIdMap* contexts = m_debugger->context
Group(m_session->contextGroupId())) { |
| 434 for (auto& idContext : *contexts) | 444 for (auto& idContext : *contexts) |
| 435 idContext.second->setReported(false); | 445 idContext.second->setReported(false); |
| 436 } | 446 } |
| 437 m_frontend->executionContextsCleared(); | 447 m_frontend->executionContextsCleared(); |
| 438 } | 448 } |
| 439 } | 449 } |
| 440 | 450 |
| 441 void V8RuntimeAgentImpl::reportExecutionContextCreated(InspectedContext* context
) | 451 void V8RuntimeAgentImpl::reportExecutionContextCreated(InspectedContext* context
) |
| (...skipping 18 matching lines...) Expand all Loading... |
| 460 } | 470 } |
| 461 } | 471 } |
| 462 | 472 |
| 463 void V8RuntimeAgentImpl::inspect(PassOwnPtr<protocol::Runtime::RemoteObject> obj
ectToInspect, PassOwnPtr<protocol::DictionaryValue> hints) | 473 void V8RuntimeAgentImpl::inspect(PassOwnPtr<protocol::Runtime::RemoteObject> obj
ectToInspect, PassOwnPtr<protocol::DictionaryValue> hints) |
| 464 { | 474 { |
| 465 if (m_enabled) | 475 if (m_enabled) |
| 466 m_frontend->inspectRequested(objectToInspect, hints); | 476 m_frontend->inspectRequested(objectToInspect, hints); |
| 467 } | 477 } |
| 468 | 478 |
| 469 } // namespace blink | 479 } // namespace blink |
| OLD | NEW |