Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Side by Side Diff: Source/core/page/Page.cpp

Issue 38143002: Have LifecycleContext::lifecycleNotifier() return a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/page/Page.h ('k') | Source/core/platform/LifecycleContext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 if (m_visibilityState == visibilityState) 552 if (m_visibilityState == visibilityState)
553 return; 553 return;
554 m_visibilityState = visibilityState; 554 m_visibilityState = visibilityState;
555 555
556 if (visibilityState == WebCore::PageVisibilityStateHidden) 556 if (visibilityState == WebCore::PageVisibilityStateHidden)
557 setTimerAlignmentInterval(DOMTimer::hiddenPageAlignmentInterval()); 557 setTimerAlignmentInterval(DOMTimer::hiddenPageAlignmentInterval());
558 else 558 else
559 setTimerAlignmentInterval(DOMTimer::visiblePageAlignmentInterval()); 559 setTimerAlignmentInterval(DOMTimer::visiblePageAlignmentInterval());
560 560
561 if (!isInitialState) 561 if (!isInitialState)
562 lifecycleNotifier()->notifyPageVisibilityChanged(); 562 lifecycleNotifier().notifyPageVisibilityChanged();
563 563
564 if (!isInitialState && m_mainFrame) 564 if (!isInitialState && m_mainFrame)
565 m_mainFrame->dispatchVisibilityStateChangeEvent(); 565 m_mainFrame->dispatchVisibilityStateChangeEvent();
566 } 566 }
567 567
568 PageVisibilityState Page::visibilityState() const 568 PageVisibilityState Page::visibilityState() const
569 { 569 {
570 return m_visibilityState; 570 return m_visibilityState;
571 } 571 }
572 572
573 void Page::addMultisamplingChangedObserver(MultisamplingChangedObserver* observe r) 573 void Page::addMultisamplingChangedObserver(MultisamplingChangedObserver* observe r)
574 { 574 {
575 m_multisamplingChangedObservers.add(observer); 575 m_multisamplingChangedObservers.add(observer);
576 } 576 }
577 577
578 void Page::removeMultisamplingChangedObserver(MultisamplingChangedObserver* obse rver) 578 void Page::removeMultisamplingChangedObserver(MultisamplingChangedObserver* obse rver)
579 { 579 {
580 m_multisamplingChangedObservers.remove(observer); 580 m_multisamplingChangedObservers.remove(observer);
581 } 581 }
582 582
583 void Page::multisamplingChanged() 583 void Page::multisamplingChanged()
584 { 584 {
585 HashSet<MultisamplingChangedObserver*>::iterator stop = m_multisamplingChang edObservers.end(); 585 HashSet<MultisamplingChangedObserver*>::iterator stop = m_multisamplingChang edObservers.end();
586 for (HashSet<MultisamplingChangedObserver*>::iterator it = m_multisamplingCh angedObservers.begin(); it != stop; ++it) 586 for (HashSet<MultisamplingChangedObserver*>::iterator it = m_multisamplingCh angedObservers.begin(); it != stop; ++it)
587 (*it)->multisamplingChanged(m_settings->openGLMultisamplingEnabled()); 587 (*it)->multisamplingChanged(m_settings->openGLMultisamplingEnabled());
588 } 588 }
589 589
590 void Page::didCommitLoad(Frame* frame) 590 void Page::didCommitLoad(Frame* frame)
591 { 591 {
592 lifecycleNotifier()->notifyDidCommitLoad(frame); 592 lifecycleNotifier().notifyDidCommitLoad(frame);
593 if (m_mainFrame == frame) 593 if (m_mainFrame == frame)
594 useCounter().didCommitLoad(); 594 useCounter().didCommitLoad();
595 } 595 }
596 596
597 PageLifecycleNotifier* Page::lifecycleNotifier() 597 PageLifecycleNotifier& Page::lifecycleNotifier()
598 { 598 {
599 return static_cast<PageLifecycleNotifier*>(LifecycleContext::lifecycleNotifi er()); 599 return static_cast<PageLifecycleNotifier&>(LifecycleContext::lifecycleNotifi er());
600 } 600 }
601 601
602 PassOwnPtr<LifecycleNotifier<Page> > Page::createLifecycleNotifier() 602 PassOwnPtr<LifecycleNotifier<Page> > Page::createLifecycleNotifier()
603 { 603 {
604 return PageLifecycleNotifier::create(this); 604 return PageLifecycleNotifier::create(this);
605 } 605 }
606 606
607 Page::PageClients::PageClients() 607 Page::PageClients::PageClients()
608 : chromeClient(0) 608 : chromeClient(0)
609 , contextMenuClient(0) 609 , contextMenuClient(0)
610 , editorClient(0) 610 , editorClient(0)
611 , dragClient(0) 611 , dragClient(0)
612 , inspectorClient(0) 612 , inspectorClient(0)
613 , backForwardClient(0) 613 , backForwardClient(0)
614 { 614 {
615 } 615 }
616 616
617 Page::PageClients::~PageClients() 617 Page::PageClients::~PageClients()
618 { 618 {
619 } 619 }
620 620
621 } // namespace WebCore 621 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/Page.h ('k') | Source/core/platform/LifecycleContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698