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

Side by Side Diff: Source/WebCore/history/PageCache.cpp

Issue 13866007: WebKit & WebCore part of the device motion implementation using the platform layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@devicemotion-webcore
Patch Set: added unregister in destructor of DeviceMotionController Created 7 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 236
237 if (!page->backForward()->isActive()) { 237 if (!page->backForward()->isActive()) {
238 PCLOG(" -The back/forward list is disabled or has 0 capacity"); 238 PCLOG(" -The back/forward list is disabled or has 0 capacity");
239 rejectReasons |= 1 << DisabledBackForwardList; 239 rejectReasons |= 1 << DisabledBackForwardList;
240 } 240 }
241 if (!page->settings()->usesPageCache()) { 241 if (!page->settings()->usesPageCache()) {
242 PCLOG(" -Page settings says b/f cache disabled"); 242 PCLOG(" -Page settings says b/f cache disabled");
243 rejectReasons |= 1 << DisabledPageCache; 243 rejectReasons |= 1 << DisabledPageCache;
244 } 244 }
245 #if ENABLE(DEVICE_ORIENTATION) 245 #if ENABLE(DEVICE_ORIENTATION)
246 if (DeviceMotionController::shared().isActiveAt(page)) { 246 if (DeviceMotionController::isActiveAt(page)) {
247 PCLOG(" -Page is using DeviceMotion"); 247 PCLOG(" -Page is using DeviceMotion");
248 rejectReasons |= 1 << UsesDeviceMotion; 248 rejectReasons |= 1 << UsesDeviceMotion;
249 } 249 }
250 if (DeviceOrientationController::isActiveAt(page)) { 250 if (DeviceOrientationController::isActiveAt(page)) {
251 PCLOG(" -Page is using DeviceOrientation"); 251 PCLOG(" -Page is using DeviceOrientation");
252 rejectReasons |= 1 << UsesDeviceOrientation; 252 rejectReasons |= 1 << UsesDeviceOrientation;
253 } 253 }
254 #endif 254 #endif
255 #if ENABLE(PROXIMITY_EVENTS) 255 #if ENABLE(PROXIMITY_EVENTS)
256 if (DeviceProximityController::isActiveAt(page)) { 256 if (DeviceProximityController::isActiveAt(page)) {
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 // store the final page we end up on. 381 // store the final page we end up on.
382 // No point writing to the cache on a reload or loadSame, since we will just write 382 // No point writing to the cache on a reload or loadSame, since we will just write
383 // over it again when we leave that page. 383 // over it again when we leave that page.
384 FrameLoadType loadType = page->mainFrame()->loader()->loadType(); 384 FrameLoadType loadType = page->mainFrame()->loader()->loadType();
385 385
386 return m_capacity > 0 386 return m_capacity > 0
387 && canCachePageContainingThisFrame(page->mainFrame()) 387 && canCachePageContainingThisFrame(page->mainFrame())
388 && page->backForward()->isActive() 388 && page->backForward()->isActive()
389 && page->settings()->usesPageCache() 389 && page->settings()->usesPageCache()
390 #if ENABLE(DEVICE_ORIENTATION) 390 #if ENABLE(DEVICE_ORIENTATION)
391 && !DeviceMotionController::shared().isActiveAt(page) 391 && !DeviceMotionController::isActiveAt(page)
392 && !DeviceOrientationController::isActiveAt(page) 392 && !DeviceOrientationController::isActiveAt(page)
393 #endif 393 #endif
394 #if ENABLE(PROXIMITY_EVENTS) 394 #if ENABLE(PROXIMITY_EVENTS)
395 && !DeviceProximityController::isActiveAt(page) 395 && !DeviceProximityController::isActiveAt(page)
396 #endif 396 #endif
397 && loadType != FrameLoadTypeReload 397 && loadType != FrameLoadTypeReload
398 && loadType != FrameLoadTypeReloadFromOrigin 398 && loadType != FrameLoadTypeReloadFromOrigin
399 && loadType != FrameLoadTypeSame; 399 && loadType != FrameLoadTypeSame;
400 } 400 }
401 401
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 if (!item->m_prev) { 528 if (!item->m_prev) {
529 ASSERT(item == m_head); 529 ASSERT(item == m_head);
530 m_head = item->m_next; 530 m_head = item->m_next;
531 } else { 531 } else {
532 ASSERT(item != m_head); 532 ASSERT(item != m_head);
533 item->m_prev->m_next = item->m_next; 533 item->m_prev->m_next = item->m_next;
534 } 534 }
535 } 535 }
536 536
537 } // namespace WebCore 537 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698