Changeset 69646 in webkit


Ignore:
Timestamp:
Oct 13, 2010 3:00:34 AM (14 years ago)
Author:
steveblock@google.com
Message:

2010-10-13 Steve Block <steveblock@google.com>

Reviewed by Alexey Proskuryakov.

Pages using DeviceOrientation and DeviceMotion should not go into the page cache
https://bugs.webkit.org/show_bug.cgi?id=47408

  • fast/dom/DeviceMotion/no-page-cache-expected.txt: Added.
  • fast/dom/DeviceMotion/no-page-cache.html: Added.
  • fast/dom/DeviceMotion/resources: Added.
  • fast/dom/DeviceMotion/resources/cached-page-1.html: Added.
  • fast/dom/DeviceMotion/resources/cached-page-2.html: Added.
  • fast/dom/DeviceMotion/script-tests/no-page-cache.js: Added. (reportPageOneOnload):
  • fast/dom/DeviceOrientation/no-page-cache-expected.txt: Added.
  • fast/dom/DeviceOrientation/no-page-cache.html: Added.
  • fast/dom/DeviceOrientation/resources: Added.
  • fast/dom/DeviceOrientation/resources/cached-page-1.html: Added.
  • fast/dom/DeviceOrientation/resources/cached-page-2.html: Added.
  • fast/dom/DeviceOrientation/script-tests/no-page-cache.js: Added. (reportPageOneOnload):

2010-10-13 Steve Block <steveblock@google.com>

Reviewed by Alexey Proskuryakov.

Pages using DeviceOrientation and DeviceMotion should not go into the page cache
https://bugs.webkit.org/show_bug.cgi?id=47408

Tests: fast/dom/DeviceMotion/no-page-cache.html

fast/dom/DeviceOrientation/no-page-cache.html

  • dom/DeviceMotionController.h: (WebCore::DeviceMotionController::isActive):
  • dom/DeviceOrientationController.h: (WebCore::DeviceOrientationController::isActive):
  • history/PageCache.cpp: (WebCore::logCanCachePageDecision): (WebCore::PageCache::canCache):
  • page/Page.cpp:
Location:
trunk
Files:
12 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r69645 r69646  
     12010-10-13  Steve Block  <steveblock@google.com>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        Pages using DeviceOrientation and DeviceMotion should not go into the page cache
     6        https://bugs.webkit.org/show_bug.cgi?id=47408
     7
     8        * fast/dom/DeviceMotion/no-page-cache-expected.txt: Added.
     9        * fast/dom/DeviceMotion/no-page-cache.html: Added.
     10        * fast/dom/DeviceMotion/resources: Added.
     11        * fast/dom/DeviceMotion/resources/cached-page-1.html: Added.
     12        * fast/dom/DeviceMotion/resources/cached-page-2.html: Added.
     13        * fast/dom/DeviceMotion/script-tests/no-page-cache.js: Added.
     14        (reportPageOneOnload):
     15        * fast/dom/DeviceOrientation/no-page-cache-expected.txt: Added.
     16        * fast/dom/DeviceOrientation/no-page-cache.html: Added.
     17        * fast/dom/DeviceOrientation/resources: Added.
     18        * fast/dom/DeviceOrientation/resources/cached-page-1.html: Added.
     19        * fast/dom/DeviceOrientation/resources/cached-page-2.html: Added.
     20        * fast/dom/DeviceOrientation/script-tests/no-page-cache.js: Added.
     21        (reportPageOneOnload):
     22
    1232010-10-13  Alexander Pavlov  <apavlov@chromium.org>
    224
  • trunk/WebCore/ChangeLog

    r69643 r69646  
     12010-10-13  Steve Block  <steveblock@google.com>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        Pages using DeviceOrientation and DeviceMotion should not go into the page cache
     6        https://bugs.webkit.org/show_bug.cgi?id=47408
     7
     8        Tests: fast/dom/DeviceMotion/no-page-cache.html
     9               fast/dom/DeviceOrientation/no-page-cache.html
     10
     11        * dom/DeviceMotionController.h:
     12        (WebCore::DeviceMotionController::isActive):
     13        * dom/DeviceOrientationController.h:
     14        (WebCore::DeviceOrientationController::isActive):
     15        * history/PageCache.cpp:
     16        (WebCore::logCanCachePageDecision):
     17        (WebCore::PageCache::canCache):
     18        * page/Page.cpp:
     19
    1202010-10-13  Jenn Braithwaite  <jennb@chromium.org>
    221
  • trunk/WebCore/dom/DeviceMotionController.h

    r67949 r69646  
    4747    void didChangeDeviceMotion(DeviceMotionData*);
    4848
     49    bool isActive() { return !m_listeners.isEmpty(); }
     50
    4951private:
    5052    void timerFired(Timer<DeviceMotionController>*);
  • trunk/WebCore/dom/DeviceOrientationController.h

    r67949 r69646  
    4949    void didChangeDeviceOrientation(DeviceOrientation*);
    5050
     51    bool isActive() { return !m_listeners.isEmpty(); }
     52
    5153private:
    5254    void timerFired(Timer<DeviceOrientationController>*);
  • trunk/WebCore/history/PageCache.cpp

    r67619 r69646  
    3232#include "CachedPage.h"
    3333#include "DOMWindow.h"
     34#include "DeviceMotionController.h"
     35#include "DeviceOrientationController.h"
    3436#include "Document.h"
    3537#include "DocumentLoader.h"
     
    202204        cannotCache = true;
    203205    }
     206#if ENABLE(DEVICE_ORIENTATION)
     207    if (!page->deviceMotionController()->isActive()) {
     208        PCLOG("   -Page is using DeviceMotion");
     209        cannotCache = true;
     210    }
     211    if (!page->deviceOrientationController()->isActive()) {
     212        PCLOG("   -Page is using DeviceOrientation");
     213        cannotCache = true;
     214    }
     215#endif
    204216    if (loadType == FrameLoadTypeReload) {
    205217        PCLOG("   -Load type is: Reload");
     
    298310        && page->backForwardList()->capacity() > 0
    299311        && page->settings()->usesPageCache()
    300         && loadType != FrameLoadTypeReload
     312#if ENABLE(DEVICE_ORIENTATION)
     313        && !page->deviceMotionController()->isActive()
     314        && !page->deviceOrientationController()->isActive()
     315#endif
     316        && loadType != FrameLoadTypeReload
    301317        && loadType != FrameLoadTypeReloadFromOrigin
    302318        && loadType != FrameLoadTypeSame;
  • trunk/WebCore/page/Page.cpp

    r69635 r69646  
    2121#include "Page.h"
    2222
    23 #include "DeviceMotionController.h"
    2423#include "BackForwardController.h"
    2524#include "BackForwardList.h"
     
    3130#include "ContextMenuController.h"
    3231#include "DOMWindow.h"
     32#include "DeviceMotionController.h"
    3333#include "DeviceOrientationController.h"
    3434#include "DragController.h"
Note: See TracChangeset for help on using the changeset viewer.