| 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 21 matching lines...) Expand all Loading... |
| 32 #include "core/frame/FrameConsole.h" | 32 #include "core/frame/FrameConsole.h" |
| 33 #include "core/frame/FrameHost.h" | 33 #include "core/frame/FrameHost.h" |
| 34 #include "core/frame/FrameView.h" | 34 #include "core/frame/FrameView.h" |
| 35 #include "core/frame/RemoteFrame.h" | 35 #include "core/frame/RemoteFrame.h" |
| 36 #include "core/frame/RemoteFrameView.h" | 36 #include "core/frame/RemoteFrameView.h" |
| 37 #include "core/frame/Settings.h" | 37 #include "core/frame/Settings.h" |
| 38 #include "core/html/HTMLMediaElement.h" | 38 #include "core/html/HTMLMediaElement.h" |
| 39 #include "core/inspector/InspectorInstrumentation.h" | 39 #include "core/inspector/InspectorInstrumentation.h" |
| 40 #include "core/layout/LayoutView.h" | 40 #include "core/layout/LayoutView.h" |
| 41 #include "core/layout/TextAutosizer.h" | 41 #include "core/layout/TextAutosizer.h" |
| 42 #include "core/layout/svg/SVGResourcesCache.h" |
| 42 #include "core/page/AutoscrollController.h" | 43 #include "core/page/AutoscrollController.h" |
| 43 #include "core/page/ChromeClient.h" | 44 #include "core/page/ChromeClient.h" |
| 44 #include "core/page/ContextMenuController.h" | 45 #include "core/page/ContextMenuController.h" |
| 45 #include "core/page/DragController.h" | 46 #include "core/page/DragController.h" |
| 46 #include "core/page/FocusController.h" | 47 #include "core/page/FocusController.h" |
| 47 #include "core/page/PointerLockController.h" | 48 #include "core/page/PointerLockController.h" |
| 48 #include "core/page/ValidationMessageClient.h" | 49 #include "core/page/ValidationMessageClient.h" |
| 49 #include "core/page/scrolling/ScrollingCoordinator.h" | 50 #include "core/page/scrolling/ScrollingCoordinator.h" |
| 50 #include "core/paint/PaintLayer.h" | 51 #include "core/paint/PaintLayer.h" |
| 52 #include "platform/graphics/ColorSpaceProfile.h" |
| 51 #include "platform/graphics/GraphicsLayer.h" | 53 #include "platform/graphics/GraphicsLayer.h" |
| 54 #include "platform/graphics/GraphicsScreen.h" |
| 52 #include "platform/plugins/PluginData.h" | 55 #include "platform/plugins/PluginData.h" |
| 53 #include "platform/text/CompressibleString.h" | 56 #include "platform/text/CompressibleString.h" |
| 54 #include "public/platform/Platform.h" | 57 #include "public/platform/Platform.h" |
| 55 | 58 |
| 56 namespace blink { | 59 namespace blink { |
| 57 | 60 |
| 58 // Set of all live pages; includes internal Page objects that are | 61 // Set of all live pages; includes internal Page objects that are |
| 59 // not observable from scripts. | 62 // not observable from scripts. |
| 60 static Page::PageSet& allPages() | 63 static Page::PageSet& allPages() |
| 61 { | 64 { |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 | 331 |
| 329 m_deviceScaleFactor = scaleFactor; | 332 m_deviceScaleFactor = scaleFactor; |
| 330 setNeedsRecalcStyleInAllFrames(); | 333 setNeedsRecalcStyleInAllFrames(); |
| 331 | 334 |
| 332 if (mainFrame() && mainFrame()->isLocalFrame()) | 335 if (mainFrame() && mainFrame()->isLocalFrame()) |
| 333 deprecatedLocalMainFrame()->deviceScaleFactorChanged(); | 336 deprecatedLocalMainFrame()->deviceScaleFactorChanged(); |
| 334 } | 337 } |
| 335 | 338 |
| 336 void Page::setDeviceColorProfile(const Vector<char>& profile) | 339 void Page::setDeviceColorProfile(const Vector<char>& profile) |
| 337 { | 340 { |
| 338 // FIXME: implement. | 341 if (!imageColorProfilesEnabled()) |
| 342 return; |
| 343 |
| 344 fprintf(stderr, "\nWebCore::Page %ld setDeviceColorProfile begins\n", (long
int)this); |
| 345 fflush(stderr); |
| 346 |
| 347 RefPtr<ColorSpaceProfile> screen = screenColorProfile(Page::screenId(this)); |
| 348 setScreenColorProfile(Page::screenId(this), profile.data(), profile.size()); |
| 349 |
| 350 setCurrentScreenId(Page::screenId(this)); |
| 351 |
| 352 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()
) { |
| 353 if (!frame->isLocalFrame()) |
| 354 continue; |
| 355 |
| 356 toLocalFrame(frame)->view()->invalidatePaintForTickmarks(); |
| 357 |
| 358 if (LayoutView* layoutView = toLocalFrame(frame)->document()->layoutView
()) |
| 359 layoutView->invalidatePaintForViewAndCompositedLayers(true); |
| 360 |
| 361 // Clear the SVG image pattern cache: see crbug.com/531258 |
| 362 SVGResourcesCache::invalidateAllResources(*toLocalFrame(frame)->document
()); |
| 363 |
| 364 RELEASE_ASSERT(currentScreenId() == Page::screenId(this)); |
| 365 } |
| 366 |
| 367 if (mainFrame() && mainFrame()->isLocalFrame()) |
| 368 animator().scheduleVisualUpdate(toLocalFrame(mainFrame())); |
| 369 |
| 370 fprintf(stderr, "WebCore::Page %ld setDeviceColorProfile ends\n\n", (long in
t)this); |
| 371 fflush(stderr); |
| 372 |
| 373 setCurrentScreenId(0); |
| 374 |
| 375 if (screen) |
| 376 pruneColorTransform(screen.get()); |
| 339 } | 377 } |
| 340 | 378 |
| 341 void Page::resetDeviceColorProfileForTesting() | 379 void Page::resetDeviceColorProfileForTesting() |
| 342 { | 380 { |
| 381 if (imageColorProfilesEnabled()) { |
| 382 fprintf(stderr, "\nWebCore::Page %ld resetDeviceColorProfileForTesting\n
", (long int)this); |
| 383 fflush(stderr); |
| 384 } |
| 385 |
| 386 removeScreenColorProfile(Page::screenId(this)); |
| 387 |
| 343 RuntimeEnabledFeatures::setImageColorProfilesEnabled(false); | 388 RuntimeEnabledFeatures::setImageColorProfilesEnabled(false); |
| 344 } | 389 } |
| 345 | 390 |
| 346 void Page::allVisitedStateChanged(bool invalidateVisitedLinkHashes) | 391 void Page::allVisitedStateChanged(bool invalidateVisitedLinkHashes) |
| 347 { | 392 { |
| 348 for (const Page* page : ordinaryPages()) { | 393 for (const Page* page : ordinaryPages()) { |
| 349 for (Frame* frame = page->m_mainFrame; frame; frame = frame->tree().trav
erseNext()) { | 394 for (Frame* frame = page->m_mainFrame; frame; frame = frame->tree().trav
erseNext()) { |
| 350 if (frame->isLocalFrame()) | 395 if (frame->isLocalFrame()) |
| 351 toLocalFrame(frame)->document()->visitedLinkState().invalidateSt
yleForAllLinks(invalidateVisitedLinkHashes); | 396 toLocalFrame(frame)->document()->visitedLinkState().invalidateSt
yleForAllLinks(invalidateVisitedLinkHashes); |
| 352 } | 397 } |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 if (m_memoryPurgeController) | 631 if (m_memoryPurgeController) |
| 587 m_memoryPurgeController->unregisterClient(this); | 632 m_memoryPurgeController->unregisterClient(this); |
| 588 #endif | 633 #endif |
| 589 | 634 |
| 590 if (m_scrollingCoordinator) | 635 if (m_scrollingCoordinator) |
| 591 m_scrollingCoordinator->willBeDestroyed(); | 636 m_scrollingCoordinator->willBeDestroyed(); |
| 592 | 637 |
| 593 chromeClient().chromeDestroyed(); | 638 chromeClient().chromeDestroyed(); |
| 594 if (m_validationMessageClient) | 639 if (m_validationMessageClient) |
| 595 m_validationMessageClient->willBeDestroyed(); | 640 m_validationMessageClient->willBeDestroyed(); |
| 641 |
| 642 removeScreenColorProfile(Page::screenId(this)); |
| 596 m_mainFrame = nullptr; | 643 m_mainFrame = nullptr; |
| 597 | 644 |
| 598 PageLifecycleNotifier::notifyContextDestroyed(); | 645 PageLifecycleNotifier::notifyContextDestroyed(); |
| 599 } | 646 } |
| 600 | 647 |
| 601 void Page::compressStrings(Timer<Page>* timer) | 648 void Page::compressStrings(Timer<Page>* timer) |
| 602 { | 649 { |
| 603 ASSERT_UNUSED(timer, timer == &m_timerForCompressStrings); | 650 ASSERT_UNUSED(timer, timer == &m_timerForCompressStrings); |
| 604 if (m_visibilityState == PageVisibilityStateHidden) | 651 if (m_visibilityState == PageVisibilityStateHidden) |
| 605 CompressibleStringImpl::compressAll(); | 652 CompressibleStringImpl::compressAll(); |
| 606 } | 653 } |
| 607 | 654 |
| 608 Page::PageClients::PageClients() | 655 Page::PageClients::PageClients() |
| 609 : chromeClient(nullptr) | 656 : chromeClient(nullptr) |
| 610 , contextMenuClient(nullptr) | 657 , contextMenuClient(nullptr) |
| 611 , editorClient(nullptr) | 658 , editorClient(nullptr) |
| 612 , dragClient(nullptr) | 659 , dragClient(nullptr) |
| 613 , spellCheckerClient(nullptr) | 660 , spellCheckerClient(nullptr) |
| 614 { | 661 { |
| 615 } | 662 } |
| 616 | 663 |
| 617 Page::PageClients::~PageClients() | 664 Page::PageClients::~PageClients() |
| 618 { | 665 { |
| 619 } | 666 } |
| 620 | 667 |
| 621 template class CORE_TEMPLATE_EXPORT WillBeHeapSupplement<Page>; | 668 template class CORE_TEMPLATE_EXPORT WillBeHeapSupplement<Page>; |
| 622 | 669 |
| 623 } // namespace blink | 670 } // namespace blink |
| OLD | NEW |