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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 #include "core/page/FocusController.h" | 46 #include "core/page/FocusController.h" |
47 #include "core/page/FrameTree.h" | 47 #include "core/page/FrameTree.h" |
48 #include "core/page/PageLifecycleNotifier.h" | 48 #include "core/page/PageLifecycleNotifier.h" |
49 #include "core/page/PointerLockController.h" | 49 #include "core/page/PointerLockController.h" |
50 #include "core/page/StorageClient.h" | 50 #include "core/page/StorageClient.h" |
51 #include "core/page/ValidationMessageClient.h" | 51 #include "core/page/ValidationMessageClient.h" |
52 #include "core/page/scrolling/ScrollingCoordinator.h" | 52 #include "core/page/scrolling/ScrollingCoordinator.h" |
53 #include "core/rendering/FastTextAutosizer.h" | 53 #include "core/rendering/FastTextAutosizer.h" |
54 #include "core/rendering/RenderView.h" | 54 #include "core/rendering/RenderView.h" |
55 #include "core/rendering/TextAutosizer.h" | 55 #include "core/rendering/TextAutosizer.h" |
| 56 #include "core/speech/SpeechInput.h" |
56 #include "core/storage/StorageNamespace.h" | 57 #include "core/storage/StorageNamespace.h" |
57 #include "platform/plugins/PluginData.h" | 58 #include "platform/plugins/PluginData.h" |
58 #include "wtf/HashMap.h" | 59 #include "wtf/HashMap.h" |
59 #include "wtf/RefCountedLeakCounter.h" | 60 #include "wtf/RefCountedLeakCounter.h" |
60 #include "wtf/StdLibExtras.h" | 61 #include "wtf/StdLibExtras.h" |
61 #include "wtf/text/Base64.h" | 62 #include "wtf/text/Base64.h" |
62 | 63 |
63 namespace WebCore { | 64 namespace WebCore { |
64 | 65 |
65 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, pageCounter, ("Page")); | 66 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, pageCounter, ("Page")); |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 break; | 455 break; |
455 case SettingsDelegate::MediaTypeChange: | 456 case SettingsDelegate::MediaTypeChange: |
456 m_mainFrame->view()->setMediaType(AtomicString(settings().mediaTypeOverr
ide())); | 457 m_mainFrame->view()->setMediaType(AtomicString(settings().mediaTypeOverr
ide())); |
457 setNeedsRecalcStyleInAllFrames(); | 458 setNeedsRecalcStyleInAllFrames(); |
458 break; | 459 break; |
459 case SettingsDelegate::DNSPrefetchingChange: | 460 case SettingsDelegate::DNSPrefetchingChange: |
460 for (LocalFrame* frame = mainFrame(); frame; frame = frame->tree().trave
rseNext()) | 461 for (LocalFrame* frame = mainFrame(); frame; frame = frame->tree().trave
rseNext()) |
461 frame->document()->initDNSPrefetch(); | 462 frame->document()->initDNSPrefetch(); |
462 break; | 463 break; |
463 case SettingsDelegate::MultisamplingChange: { | 464 case SettingsDelegate::MultisamplingChange: { |
464 HashSet<MultisamplingChangedObserver*>::iterator stop = m_multisamplingC
hangedObservers.end(); | 465 WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<MultisamplingChangedO
bserver> >::iterator stop = m_multisamplingChangedObservers.end(); |
465 for (HashSet<MultisamplingChangedObserver*>::iterator it = m_multisampli
ngChangedObservers.begin(); it != stop; ++it) | 466 for (WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<MultisamplingCha
ngedObserver> >::iterator it = m_multisamplingChangedObservers.begin(); it != st
op; ++it) |
466 (*it)->multisamplingChanged(m_settings->openGLMultisamplingEnabled()
); | 467 (*it)->multisamplingChanged(m_settings->openGLMultisamplingEnabled()
); |
467 break; | 468 break; |
468 } | 469 } |
469 case SettingsDelegate::ImageLoadingChange: | 470 case SettingsDelegate::ImageLoadingChange: |
470 for (LocalFrame* frame = mainFrame(); frame; frame = frame->tree().trave
rseNext()) { | 471 for (LocalFrame* frame = mainFrame(); frame; frame = frame->tree().trave
rseNext()) { |
471 frame->document()->fetcher()->setImagesEnabled(settings().imagesEnab
led()); | 472 frame->document()->fetcher()->setImagesEnabled(settings().imagesEnab
led()); |
472 frame->document()->fetcher()->setAutoLoadImages(settings().loadsImag
esAutomatically()); | 473 frame->document()->fetcher()->setAutoLoadImages(settings().loadsImag
esAutomatically()); |
473 } | 474 } |
474 break; | 475 break; |
475 case SettingsDelegate::TextAutosizingChange: | 476 case SettingsDelegate::TextAutosizingChange: |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 return static_cast<PageLifecycleNotifier&>(LifecycleContext<Page>::lifecycle
Notifier()); | 513 return static_cast<PageLifecycleNotifier&>(LifecycleContext<Page>::lifecycle
Notifier()); |
513 } | 514 } |
514 | 515 |
515 PassOwnPtr<LifecycleNotifier<Page> > Page::createLifecycleNotifier() | 516 PassOwnPtr<LifecycleNotifier<Page> > Page::createLifecycleNotifier() |
516 { | 517 { |
517 return PageLifecycleNotifier::create(this); | 518 return PageLifecycleNotifier::create(this); |
518 } | 519 } |
519 | 520 |
520 void Page::trace(Visitor* visitor) | 521 void Page::trace(Visitor* visitor) |
521 { | 522 { |
| 523 visitor->registerWeakMembers<Page, &Page::clearWeakMembers>(this); |
| 524 visitor->trace(m_multisamplingChangedObservers); |
522 Supplementable<Page>::trace(visitor); | 525 Supplementable<Page>::trace(visitor); |
523 } | 526 } |
524 | 527 |
| 528 void Page::clearWeakMembers(Visitor* visitor) |
| 529 { |
| 530 SpeechInput* input = SpeechInput::from(this); |
| 531 if (input) |
| 532 input->clearWeakMembers(visitor); |
| 533 } |
| 534 |
525 void Page::willBeDestroyed() | 535 void Page::willBeDestroyed() |
526 { | 536 { |
527 // Disable all agents prior to resetting the frame view. | 537 // Disable all agents prior to resetting the frame view. |
528 m_inspectorController->willBeDestroyed(); | 538 m_inspectorController->willBeDestroyed(); |
529 | 539 |
530 m_mainFrame->setView(nullptr); | 540 m_mainFrame->setView(nullptr); |
531 | 541 |
532 allPages().remove(this); | 542 allPages().remove(this); |
533 if (ordinaryPages().contains(this)) | 543 if (ordinaryPages().contains(this)) |
534 ordinaryPages().remove(this); | 544 ordinaryPages().remove(this); |
(...skipping 27 matching lines...) Expand all Loading... |
562 , spellCheckerClient(0) | 572 , spellCheckerClient(0) |
563 , storageClient(0) | 573 , storageClient(0) |
564 { | 574 { |
565 } | 575 } |
566 | 576 |
567 Page::PageClients::~PageClients() | 577 Page::PageClients::~PageClients() |
568 { | 578 { |
569 } | 579 } |
570 | 580 |
571 } // namespace WebCore | 581 } // namespace WebCore |
OLD | NEW |