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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 m_frontend->loadEventFired(currentTime()); | 551 m_frontend->loadEventFired(currentTime()); |
552 } | 552 } |
553 | 553 |
554 void InspectorPageAgent::frameNavigated(DocumentLoader* loader) | 554 void InspectorPageAgent::frameNavigated(DocumentLoader* loader) |
555 { | 555 { |
556 m_frontend->frameNavigated(buildObjectForFrame(loader->frame()), loaderId(lo
ader)); | 556 m_frontend->frameNavigated(buildObjectForFrame(loader->frame()), loaderId(lo
ader)); |
557 } | 557 } |
558 | 558 |
559 void InspectorPageAgent::frameDetached(Frame* frame) | 559 void InspectorPageAgent::frameDetached(Frame* frame) |
560 { | 560 { |
561 m_frontend->frameDetached(frameId(frame)); | 561 HashMap<Frame*, String>::iterator iterator = m_frameToIdentifier.find(frame)
; |
| 562 if (iterator != m_frameToIdentifier.end()) { |
| 563 m_frontend->frameDetached(iterator->second); |
| 564 m_identifierToFrame.remove(iterator->second); |
| 565 m_frameToIdentifier.remove(iterator); |
| 566 } |
562 } | 567 } |
563 | 568 |
564 Frame* InspectorPageAgent::mainFrame() | 569 Frame* InspectorPageAgent::mainFrame() |
565 { | 570 { |
566 return m_page->mainFrame(); | 571 return m_page->mainFrame(); |
567 } | 572 } |
568 | 573 |
569 Frame* InspectorPageAgent::frameForId(const String& frameId) | 574 Frame* InspectorPageAgent::frameForId(const String& frameId) |
570 { | 575 { |
571 return frameId.isEmpty() ? 0 : m_identifierToFrame.get(frameId); | 576 return frameId.isEmpty() ? 0 : m_identifierToFrame.get(frameId); |
(...skipping 17 matching lines...) Expand all Loading... |
589 if (!loader) | 594 if (!loader) |
590 return ""; | 595 return ""; |
591 String identifier = m_loaderToIdentifier.get(loader); | 596 String identifier = m_loaderToIdentifier.get(loader); |
592 if (identifier.isNull()) { | 597 if (identifier.isNull()) { |
593 identifier = IdentifiersFactory::createIdentifier(); | 598 identifier = IdentifiersFactory::createIdentifier(); |
594 m_loaderToIdentifier.set(loader, identifier); | 599 m_loaderToIdentifier.set(loader, identifier); |
595 } | 600 } |
596 return identifier; | 601 return identifier; |
597 } | 602 } |
598 | 603 |
599 void InspectorPageAgent::frameDestroyed(Frame* frame) | |
600 { | |
601 HashMap<Frame*, String>::iterator iterator = m_frameToIdentifier.find(frame)
; | |
602 if (iterator != m_frameToIdentifier.end()) { | |
603 m_identifierToFrame.remove(iterator->second); | |
604 m_frameToIdentifier.remove(iterator); | |
605 } | |
606 } | |
607 | |
608 void InspectorPageAgent::loaderDetachedFromFrame(DocumentLoader* loader) | 604 void InspectorPageAgent::loaderDetachedFromFrame(DocumentLoader* loader) |
609 { | 605 { |
610 HashMap<DocumentLoader*, String>::iterator iterator = m_loaderToIdentifier.f
ind(loader); | 606 HashMap<DocumentLoader*, String>::iterator iterator = m_loaderToIdentifier.f
ind(loader); |
611 if (iterator != m_loaderToIdentifier.end()) | 607 if (iterator != m_loaderToIdentifier.end()) |
612 m_loaderToIdentifier.remove(iterator); | 608 m_loaderToIdentifier.remove(iterator); |
613 } | 609 } |
614 | 610 |
615 PassRefPtr<InspectorObject> InspectorPageAgent::buildObjectForFrame(Frame* frame
) | 611 PassRefPtr<InspectorObject> InspectorPageAgent::buildObjectForFrame(Frame* frame
) |
616 { | 612 { |
617 RefPtr<InspectorObject> frameObject = InspectorObject::create(); | 613 RefPtr<InspectorObject> frameObject = InspectorObject::create(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 result->setArray("childFrames", childrenArray); | 653 result->setArray("childFrames", childrenArray); |
658 } | 654 } |
659 childrenArray->pushObject(buildObjectForFrameTree(child)); | 655 childrenArray->pushObject(buildObjectForFrameTree(child)); |
660 } | 656 } |
661 return result; | 657 return result; |
662 } | 658 } |
663 | 659 |
664 } // namespace WebCore | 660 } // namespace WebCore |
665 | 661 |
666 #endif // ENABLE(INSPECTOR) | 662 #endif // ENABLE(INSPECTOR) |
OLD | NEW |