Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R ights Reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R ights Reserved. |
| 3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) | 3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 // static | 76 // static |
| 77 HashSet<Page*>& Page::ordinaryPages() | 77 HashSet<Page*>& Page::ordinaryPages() |
| 78 { | 78 { |
| 79 DEFINE_STATIC_LOCAL(HashSet<Page*>, ordinaryPages, ()); | 79 DEFINE_STATIC_LOCAL(HashSet<Page*>, ordinaryPages, ()); |
| 80 return ordinaryPages; | 80 return ordinaryPages; |
| 81 } | 81 } |
| 82 | 82 |
| 83 | 83 |
| 84 void Page::networkStateChanged(bool online) | 84 void Page::networkStateChanged(bool online) |
| 85 { | 85 { |
| 86 Vector<RefPtr<LocalFrame> > frames; | 86 WillBeHeapVector<RefPtrWillBeMember<LocalFrame> > frames; |
| 87 | 87 |
| 88 // Get all the frames of all the pages in all the page groups | 88 // Get all the frames of all the pages in all the page groups |
| 89 HashSet<Page*>::iterator end = allPages().end(); | 89 HashSet<Page*>::iterator end = allPages().end(); |
| 90 for (HashSet<Page*>::iterator it = allPages().begin(); it != end; ++it) { | 90 for (HashSet<Page*>::iterator it = allPages().begin(); it != end; ++it) { |
| 91 for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree().tra verseNext()) { | 91 for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree().tra verseNext()) { |
| 92 // FIXME: There is currently no way to dispatch events to out-of-pro cess frames. | 92 // FIXME: There is currently no way to dispatch events to out-of-pro cess frames. |
| 93 if (frame->isLocalFrame()) | 93 if (frame->isLocalFrame()) |
| 94 frames.append(toLocalFrame(frame)); | 94 frames.append(toLocalFrame(frame)); |
| 95 } | 95 } |
| 96 InspectorInstrumentation::networkStateChanged(*it, online); | 96 InspectorInstrumentation::networkStateChanged(*it, online); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 258 } | 258 } |
| 259 } | 259 } |
| 260 | 260 |
| 261 void Page::refreshPlugins(bool reload) | 261 void Page::refreshPlugins(bool reload) |
| 262 { | 262 { |
| 263 if (allPages().isEmpty()) | 263 if (allPages().isEmpty()) |
| 264 return; | 264 return; |
| 265 | 265 |
| 266 PluginData::refresh(); | 266 PluginData::refresh(); |
| 267 | 267 |
| 268 Vector<RefPtr<LocalFrame> > framesNeedingReload; | 268 WillBeHeapVector<RefPtrWillBeMember<LocalFrame> > framesNeedingReload; |
| 269 | 269 |
| 270 HashSet<Page*>::iterator end = allPages().end(); | 270 HashSet<Page*>::iterator end = allPages().end(); |
| 271 for (HashSet<Page*>::iterator it = allPages().begin(); it != end; ++it) { | 271 for (HashSet<Page*>::iterator it = allPages().begin(); it != end; ++it) { |
| 272 Page* page = *it; | 272 Page* page = *it; |
| 273 | 273 |
| 274 // Clear out the page's plug-in data. | 274 // Clear out the page's plug-in data. |
| 275 if (page->m_pluginData) | 275 if (page->m_pluginData) |
| 276 page->m_pluginData = nullptr; | 276 page->m_pluginData = nullptr; |
| 277 | 277 |
| 278 if (!reload) | 278 if (!reload) |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 561 lifecycleNotifier().notifyDidCommitLoad(frame); | 561 lifecycleNotifier().notifyDidCommitLoad(frame); |
| 562 if (m_mainFrame == frame) { | 562 if (m_mainFrame == frame) { |
| 563 frame->console().clearMessages(); | 563 frame->console().clearMessages(); |
| 564 useCounter().didCommitLoad(); | 564 useCounter().didCommitLoad(); |
| 565 m_inspectorController->didCommitLoadForMainFrame(); | 565 m_inspectorController->didCommitLoadForMainFrame(); |
| 566 } | 566 } |
| 567 } | 567 } |
| 568 | 568 |
| 569 void Page::acceptLanguagesChanged() | 569 void Page::acceptLanguagesChanged() |
| 570 { | 570 { |
| 571 Vector< RefPtr<LocalFrame> > frames; | 571 WillBeHeapVector<RefPtrWillBeMember<LocalFrame> > frames; |
| 572 | 572 |
| 573 // Even though we don't fire an event from here, the LocalDOMWindow's will f ire | 573 // Even though we don't fire an event from here, the LocalDOMWindow's will f ire |
| 574 // an event so we keep the frames alive until we are done. | 574 // an event so we keep the frames alive until we are done. |
| 575 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext() ) { | 575 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext() ) { |
| 576 if (frame->isLocalFrame()) | 576 if (frame->isLocalFrame()) |
| 577 frames.append(toLocalFrame(frame)); | 577 frames.append(toLocalFrame(frame)); |
| 578 } | 578 } |
| 579 | 579 |
| 580 for (unsigned i = 0; i < frames.size(); ++i) | 580 for (unsigned i = 0; i < frames.size(); ++i) |
| 581 frames[i]->domWindow()->acceptLanguagesChanged(); | 581 frames[i]->domWindow()->acceptLanguagesChanged(); |
| 582 } | 582 } |
| 583 | 583 |
| 584 PageLifecycleNotifier& Page::lifecycleNotifier() | 584 PageLifecycleNotifier& Page::lifecycleNotifier() |
| 585 { | 585 { |
| 586 return static_cast<PageLifecycleNotifier&>(LifecycleContext<Page>::lifecycle Notifier()); | 586 return static_cast<PageLifecycleNotifier&>(LifecycleContext<Page>::lifecycle Notifier()); |
| 587 } | 587 } |
| 588 | 588 |
| 589 PassOwnPtr<LifecycleNotifier<Page> > Page::createLifecycleNotifier() | 589 PassOwnPtr<LifecycleNotifier<Page> > Page::createLifecycleNotifier() |
| 590 { | 590 { |
| 591 return PageLifecycleNotifier::create(this); | 591 return PageLifecycleNotifier::create(this); |
| 592 } | 592 } |
| 593 | 593 |
| 594 void Page::trace(Visitor* visitor) | 594 void Page::trace(Visitor* visitor) |
| 595 { | 595 { |
| 596 #if ENABLE(OILPAN) | 596 #if ENABLE(OILPAN) |
| 597 visitor->trace(m_dragCaretController); | 597 visitor->trace(m_dragCaretController); |
| 598 visitor->trace(m_dragController); | 598 visitor->trace(m_dragController); |
| 599 visitor->trace(m_focusController); | |
| 599 visitor->trace(m_contextMenuController); | 600 visitor->trace(m_contextMenuController); |
| 600 visitor->trace(m_inspectorController); | 601 visitor->trace(m_inspectorController); |
| 601 visitor->trace(m_pointerLockController); | 602 visitor->trace(m_pointerLockController); |
| 602 visitor->trace(m_undoStack); | 603 visitor->trace(m_undoStack); |
| 603 visitor->trace(m_validationMessageClient); | 604 visitor->trace(m_validationMessageClient); |
| 604 visitor->trace(m_multisamplingChangedObservers); | 605 visitor->trace(m_multisamplingChangedObservers); |
| 605 visitor->trace(m_frameHost); | 606 visitor->trace(m_frameHost); |
| 606 #endif | 607 #endif |
| 607 WillBeHeapSupplementable<Page>::trace(visitor); | 608 WillBeHeapSupplementable<Page>::trace(visitor); |
| 608 LifecycleContext<Page>::trace(visitor); | 609 LifecycleContext<Page>::trace(visitor); |
| 609 } | 610 } |
| 610 | 611 |
| 611 void Page::willBeDestroyed() | 612 void Page::willBeDestroyed() |
| 612 { | 613 { |
| 613 // Destroy inspector first, since it uses frame and view during destruction. | 614 // Destroy inspector first, since it uses frame and view during destruction. |
| 614 m_inspectorController->willBeDestroyed(); | 615 m_inspectorController->willBeDestroyed(); |
| 615 | 616 |
| 616 RefPtr<Frame> mainFrame = m_mainFrame; | 617 RefPtrWillBeRawPtr<Frame> mainFrame = m_mainFrame; |
| 617 | 618 |
| 618 mainFrame->detach(); | 619 mainFrame->detach(); |
| 619 | 620 |
| 620 if (mainFrame->isLocalFrame()) { | 621 if (mainFrame->isLocalFrame()) { |
| 621 toLocalFrame(mainFrame.get())->setView(nullptr); | 622 toLocalFrame(mainFrame.get())->setView(nullptr); |
| 622 } else { | 623 } else { |
| 623 ASSERT(m_mainFrame->isRemoteFrame()); | 624 ASSERT(m_mainFrame->isRemoteFrame()); |
| 624 toRemoteFrame(mainFrame.get())->setView(nullptr); | 625 toRemoteFrame(mainFrame.get())->setView(nullptr); |
| 625 } | 626 } |
| 626 | 627 |
| 627 allPages().remove(this); | 628 allPages().remove(this); |
| 628 if (ordinaryPages().contains(this)) | 629 if (ordinaryPages().contains(this)) |
| 629 ordinaryPages().remove(this); | 630 ordinaryPages().remove(this); |
| 630 | 631 |
| 631 if (m_scrollingCoordinator) | 632 if (m_scrollingCoordinator) |
| 632 m_scrollingCoordinator->willBeDestroyed(); | 633 m_scrollingCoordinator->willBeDestroyed(); |
| 633 | 634 |
| 634 #ifndef NDEBUG | 635 #ifndef NDEBUG |
| 635 pageCounter.decrement(); | 636 pageCounter.decrement(); |
| 636 #endif | 637 #endif |
| 637 | 638 |
| 638 m_chrome->willBeDestroyed(); | 639 m_chrome->willBeDestroyed(); |
| 639 m_mainFrame = 0; | |
| 640 if (m_validationMessageClient) | 640 if (m_validationMessageClient) |
| 641 m_validationMessageClient->willBeDestroyed(); | 641 m_validationMessageClient->willBeDestroyed(); |
| 642 m_mainFrame = 0; | |
|
haraken
2014/09/11 14:47:25
Nit: m_mainFrame = nullptr
sof
2014/09/12 14:47:40
Done.
| |
| 642 } | 643 } |
| 643 | 644 |
| 644 Page::PageClients::PageClients() | 645 Page::PageClients::PageClients() |
| 645 : chromeClient(0) | 646 : chromeClient(0) |
| 646 , contextMenuClient(0) | 647 , contextMenuClient(0) |
| 647 , editorClient(0) | 648 , editorClient(0) |
| 648 , dragClient(0) | 649 , dragClient(0) |
| 649 , inspectorClient(0) | 650 , inspectorClient(0) |
| 650 , backForwardClient(0) | 651 , backForwardClient(0) |
| 651 , spellCheckerClient(0) | 652 , spellCheckerClient(0) |
| 652 , storageClient(0) | 653 , storageClient(0) |
| 653 { | 654 { |
| 654 } | 655 } |
| 655 | 656 |
| 656 Page::PageClients::~PageClients() | 657 Page::PageClients::~PageClients() |
| 657 { | 658 { |
| 658 } | 659 } |
| 659 | 660 |
| 660 } // namespace blink | 661 } // namespace blink |
| OLD | NEW |