OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 16 matching lines...) Expand all Loading... |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "web/WebViewImpl.h" | 31 #include "web/WebViewImpl.h" |
32 | 32 |
33 #include "core/CSSValueKeywords.h" | 33 #include "core/CSSValueKeywords.h" |
34 #include "core/HTMLNames.h" | 34 #include "core/HTMLNames.h" |
35 #include "core/InputTypeNames.h" | 35 #include "core/InputTypeNames.h" |
36 #include "core/clipboard/DataObject.h" | 36 #include "core/clipboard/DataObject.h" |
| 37 #include "core/dom/DOMNodeIds.h" |
37 #include "core/dom/Document.h" | 38 #include "core/dom/Document.h" |
38 #include "core/dom/Fullscreen.h" | 39 #include "core/dom/Fullscreen.h" |
39 #include "core/dom/LayoutTreeBuilderTraversal.h" | 40 #include "core/dom/LayoutTreeBuilderTraversal.h" |
40 #include "core/dom/Text.h" | 41 #include "core/dom/Text.h" |
41 #include "core/editing/EditingUtilities.h" | 42 #include "core/editing/EditingUtilities.h" |
42 #include "core/editing/Editor.h" | 43 #include "core/editing/Editor.h" |
43 #include "core/editing/FrameSelection.h" | 44 #include "core/editing/FrameSelection.h" |
44 #include "core/editing/InputMethodController.h" | 45 #include "core/editing/InputMethodController.h" |
45 #include "core/editing/iterators/TextIterator.h" | 46 #include "core/editing/iterators/TextIterator.h" |
46 #include "core/editing/markers/DocumentMarkerController.h" | 47 #include "core/editing/markers/DocumentMarkerController.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 #include "core/page/Page.h" | 86 #include "core/page/Page.h" |
86 #include "core/page/PagePopupClient.h" | 87 #include "core/page/PagePopupClient.h" |
87 #include "core/page/PointerLockController.h" | 88 #include "core/page/PointerLockController.h" |
88 #include "core/page/ScopedPageLoadDeferrer.h" | 89 #include "core/page/ScopedPageLoadDeferrer.h" |
89 #include "core/page/TouchDisambiguation.h" | 90 #include "core/page/TouchDisambiguation.h" |
90 #include "core/paint/PaintLayer.h" | 91 #include "core/paint/PaintLayer.h" |
91 #include "core/timing/DOMWindowPerformance.h" | 92 #include "core/timing/DOMWindowPerformance.h" |
92 #include "core/timing/Performance.h" | 93 #include "core/timing/Performance.h" |
93 #include "modules/accessibility/AXObject.h" | 94 #include "modules/accessibility/AXObject.h" |
94 #include "modules/accessibility/AXObjectCacheImpl.h" | 95 #include "modules/accessibility/AXObjectCacheImpl.h" |
| 96 #include "modules/compositorworker/CompositorWorker.h" |
95 #include "modules/credentialmanager/CredentialManagerClient.h" | 97 #include "modules/credentialmanager/CredentialManagerClient.h" |
96 #include "modules/encryptedmedia/MediaKeysController.h" | 98 #include "modules/encryptedmedia/MediaKeysController.h" |
97 #include "modules/storage/StorageNamespaceController.h" | 99 #include "modules/storage/StorageNamespaceController.h" |
98 #include "modules/webgl/WebGLRenderingContext.h" | 100 #include "modules/webgl/WebGLRenderingContext.h" |
99 #include "platform/ContextMenu.h" | 101 #include "platform/ContextMenu.h" |
100 #include "platform/ContextMenuItem.h" | 102 #include "platform/ContextMenuItem.h" |
101 #include "platform/Cursor.h" | 103 #include "platform/Cursor.h" |
102 #include "platform/KeyboardCodes.h" | 104 #include "platform/KeyboardCodes.h" |
103 #include "platform/Logging.h" | 105 #include "platform/Logging.h" |
104 #include "platform/NotImplemented.h" | 106 #include "platform/NotImplemented.h" |
105 #include "platform/PlatformGestureEvent.h" | 107 #include "platform/PlatformGestureEvent.h" |
106 #include "platform/PlatformKeyboardEvent.h" | 108 #include "platform/PlatformKeyboardEvent.h" |
107 #include "platform/PlatformMouseEvent.h" | 109 #include "platform/PlatformMouseEvent.h" |
108 #include "platform/RuntimeEnabledFeatures.h" | 110 #include "platform/RuntimeEnabledFeatures.h" |
109 #include "platform/TraceEvent.h" | 111 #include "platform/TraceEvent.h" |
110 #include "platform/UserGestureIndicator.h" | 112 #include "platform/UserGestureIndicator.h" |
111 #include "platform/exported/WebActiveGestureAnimation.h" | 113 #include "platform/exported/WebActiveGestureAnimation.h" |
112 #include "platform/fonts/FontCache.h" | 114 #include "platform/fonts/FontCache.h" |
113 #include "platform/graphics/Color.h" | 115 #include "platform/graphics/Color.h" |
| 116 #include "platform/graphics/CompositorMutation.h" |
| 117 #include "platform/graphics/CompositorMutatorClient.h" |
114 #include "platform/graphics/FirstPaintInvalidationTracking.h" | 118 #include "platform/graphics/FirstPaintInvalidationTracking.h" |
115 #include "platform/graphics/GraphicsContext.h" | 119 #include "platform/graphics/GraphicsContext.h" |
116 #include "platform/graphics/Image.h" | 120 #include "platform/graphics/Image.h" |
117 #include "platform/graphics/ImageBuffer.h" | 121 #include "platform/graphics/ImageBuffer.h" |
118 #include "platform/graphics/gpu/DrawingBuffer.h" | 122 #include "platform/graphics/gpu/DrawingBuffer.h" |
119 #include "platform/graphics/paint/DrawingRecorder.h" | 123 #include "platform/graphics/paint/DrawingRecorder.h" |
120 #include "platform/scroll/ScrollbarTheme.h" | 124 #include "platform/scroll/ScrollbarTheme.h" |
121 #include "platform/weborigin/SchemeRegistry.h" | 125 #include "platform/weborigin/SchemeRegistry.h" |
122 #include "public/platform/Platform.h" | 126 #include "public/platform/Platform.h" |
123 #include "public/platform/WebCompositeAndReadbackAsyncCallback.h" | 127 #include "public/platform/WebCompositeAndReadbackAsyncCallback.h" |
(...skipping 18 matching lines...) Expand all Loading... |
142 #include "public/web/WebMediaPlayerAction.h" | 146 #include "public/web/WebMediaPlayerAction.h" |
143 #include "public/web/WebNode.h" | 147 #include "public/web/WebNode.h" |
144 #include "public/web/WebPlugin.h" | 148 #include "public/web/WebPlugin.h" |
145 #include "public/web/WebPluginAction.h" | 149 #include "public/web/WebPluginAction.h" |
146 #include "public/web/WebRange.h" | 150 #include "public/web/WebRange.h" |
147 #include "public/web/WebSelection.h" | 151 #include "public/web/WebSelection.h" |
148 #include "public/web/WebTextInputInfo.h" | 152 #include "public/web/WebTextInputInfo.h" |
149 #include "public/web/WebViewClient.h" | 153 #include "public/web/WebViewClient.h" |
150 #include "public/web/WebWindowFeatures.h" | 154 #include "public/web/WebWindowFeatures.h" |
151 #include "web/CompositionUnderlineVectorBuilder.h" | 155 #include "web/CompositionUnderlineVectorBuilder.h" |
| 156 #include "web/CompositorMutatorImpl.h" |
152 #include "web/ContextFeaturesClientImpl.h" | 157 #include "web/ContextFeaturesClientImpl.h" |
153 #include "web/ContextMenuAllowedScope.h" | 158 #include "web/ContextMenuAllowedScope.h" |
154 #include "web/DatabaseClientImpl.h" | 159 #include "web/DatabaseClientImpl.h" |
155 #include "web/DevToolsEmulator.h" | 160 #include "web/DevToolsEmulator.h" |
156 #include "web/FullscreenController.h" | 161 #include "web/FullscreenController.h" |
157 #include "web/GraphicsLayerFactoryChromium.h" | 162 #include "web/GraphicsLayerFactoryChromium.h" |
158 #include "web/InspectorOverlay.h" | 163 #include "web/InspectorOverlay.h" |
159 #include "web/LinkHighlightImpl.h" | 164 #include "web/LinkHighlightImpl.h" |
160 #include "web/PageOverlay.h" | 165 #include "web/PageOverlay.h" |
161 #include "web/PrerendererClientImpl.h" | 166 #include "web/PrerendererClientImpl.h" |
(...skipping 4269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4431 blink::DOMWindow* domWindow = frame->domWindow(); | 4436 blink::DOMWindow* domWindow = frame->domWindow(); |
4432 blink::Performance* performance = DOMWindowPerformance::performance(*domWind
ow); | 4437 blink::Performance* performance = DOMWindowPerformance::performance(*domWind
ow); |
4433 for (size_t i = 0; i < events.size(); ++i) { | 4438 for (size_t i = 0; i < events.size(); ++i) { |
4434 if (eventType == CompositeEvent) | 4439 if (eventType == CompositeEvent) |
4435 performance->addCompositeTiming(domWindow->document(), events[i].sou
rceFrame, events[i].startTime); | 4440 performance->addCompositeTiming(domWindow->document(), events[i].sou
rceFrame, events[i].startTime); |
4436 else if (eventType == RenderEvent) | 4441 else if (eventType == RenderEvent) |
4437 performance->addRenderTiming(domWindow->document(), events[i].source
Frame, events[i].startTime, events[i].finishTime); | 4442 performance->addRenderTiming(domWindow->document(), events[i].source
Frame, events[i].startTime, events[i].finishTime); |
4438 } | 4443 } |
4439 } | 4444 } |
4440 | 4445 |
| 4446 void WebViewImpl::applyMutations(const WebCompositorMutations& mutations) |
| 4447 { |
| 4448 TRACE_EVENT0("compositor-worker", "WebViewImpl::applyMutations"); |
| 4449 for (const auto& pair : static_cast<const CompositorMutations&>(mutations).m
ap) { |
| 4450 int elementId = pair.first; |
| 4451 const CompositorMutation& mutation = pair.second; |
| 4452 Node* node = DOMNodeIds::nodeForId(elementId); |
| 4453 if (!node || !toElement(node)) |
| 4454 continue; |
| 4455 toElement(node)->updateFromMutation(mutation); |
| 4456 } |
| 4457 } |
| 4458 |
4441 void WebViewImpl::updateLayerTreeViewport() | 4459 void WebViewImpl::updateLayerTreeViewport() |
4442 { | 4460 { |
4443 if (!page() || !m_layerTreeView) | 4461 if (!page() || !m_layerTreeView) |
4444 return; | 4462 return; |
4445 | 4463 |
4446 m_layerTreeView->setPageScaleFactorAndLimits(pageScaleFactor(), minimumPageS
caleFactor(), maximumPageScaleFactor()); | 4464 m_layerTreeView->setPageScaleFactorAndLimits(pageScaleFactor(), minimumPageS
caleFactor(), maximumPageScaleFactor()); |
4447 } | 4465 } |
4448 | 4466 |
4449 void WebViewImpl::updateLayerTreeBackgroundColor() | 4467 void WebViewImpl::updateLayerTreeBackgroundColor() |
4450 { | 4468 { |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4574 void WebViewImpl::forceNextWebGLContextCreationToFail() | 4592 void WebViewImpl::forceNextWebGLContextCreationToFail() |
4575 { | 4593 { |
4576 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); | 4594 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); |
4577 } | 4595 } |
4578 | 4596 |
4579 void WebViewImpl::forceNextDrawingBufferCreationToFail() | 4597 void WebViewImpl::forceNextDrawingBufferCreationToFail() |
4580 { | 4598 { |
4581 DrawingBuffer::forceNextDrawingBufferCreationToFail(); | 4599 DrawingBuffer::forceNextDrawingBufferCreationToFail(); |
4582 } | 4600 } |
4583 | 4601 |
| 4602 CompositorProxyClient* WebViewImpl::createCompositorProxyClient() |
| 4603 { |
| 4604 if (!m_mutator.get()) { |
| 4605 m_mutator = CompositorMutatorImpl::create(); |
| 4606 m_layerTreeView->setMutatorClient(m_mutator->client()); |
| 4607 } |
| 4608 return m_mutator->createCompositorProxyClient(); |
| 4609 } |
| 4610 |
| 4611 void WebViewImpl::schedulePostCommitTask(PassOwnPtr<Closure> task) |
| 4612 { |
| 4613 TRACE_EVENT0("compositor-worker", "WebViewImpl::schedulePostCommitTask"); |
| 4614 m_postCommitTasks.append(task); |
| 4615 } |
| 4616 |
| 4617 void WebViewImpl::didCommit() |
| 4618 { |
| 4619 TRACE_EVENT1("compositor-worker", "WebViewImpl::didCommit", "num_tasks", sta
tic_cast<int>(m_postCommitTasks.size())); |
| 4620 while (!m_postCommitTasks.isEmpty()) { |
| 4621 (*m_postCommitTasks.last())(); |
| 4622 m_postCommitTasks.removeLast(); |
| 4623 } |
| 4624 } |
| 4625 |
4584 void WebViewImpl::updatePageOverlays() | 4626 void WebViewImpl::updatePageOverlays() |
4585 { | 4627 { |
4586 if (m_pageColorOverlay) | 4628 if (m_pageColorOverlay) |
4587 m_pageColorOverlay->update(); | 4629 m_pageColorOverlay->update(); |
4588 if (InspectorOverlay* overlay = inspectorOverlay()) { | 4630 if (InspectorOverlay* overlay = inspectorOverlay()) { |
4589 PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); | 4631 PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); |
4590 if (inspectorPageOverlay) | 4632 if (inspectorPageOverlay) |
4591 inspectorPageOverlay->update(); | 4633 inspectorPageOverlay->update(); |
4592 } | 4634 } |
4593 } | 4635 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4628 { | 4670 { |
4629 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than | 4671 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than |
4630 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4672 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
4631 if (!page()) | 4673 if (!page()) |
4632 return 1; | 4674 return 1; |
4633 | 4675 |
4634 return page()->deviceScaleFactor(); | 4676 return page()->deviceScaleFactor(); |
4635 } | 4677 } |
4636 | 4678 |
4637 } // namespace blink | 4679 } // namespace blink |
OLD | NEW |