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