| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // traversal. Note that child node order may not match DOM node order! | 62 // traversal. Note that child node order may not match DOM node order! |
| 63 // detachFromParent() calls FrameLoaderClient::detachedFromParent(), which calls | 63 // detachFromParent() calls FrameLoaderClient::detachedFromParent(), which calls |
| 64 // WebFrame::frameDetached(). This triggers WebFrame to clear its reference to | 64 // WebFrame::frameDetached(). This triggers WebFrame to clear its reference to |
| 65 // LocalFrame, and also notifies the embedder via WebFrameClient that the frame
is | 65 // LocalFrame, and also notifies the embedder via WebFrameClient that the frame
is |
| 66 // detached. Most embedders will invoke close() on the WebFrame at this point, | 66 // detached. Most embedders will invoke close() on the WebFrame at this point, |
| 67 // triggering its deletion unless something else is still retaining a reference. | 67 // triggering its deletion unless something else is still retaining a reference. |
| 68 // | 68 // |
| 69 // Thie client is expected to be set whenever the WebLocalFrameImpl is attached
to | 69 // Thie client is expected to be set whenever the WebLocalFrameImpl is attached
to |
| 70 // the DOM. | 70 // the DOM. |
| 71 | 71 |
| 72 #include "config.h" | 72 #include "sky/engine/config.h" |
| 73 #include "web/WebLocalFrameImpl.h" | 73 #include "sky/engine/web/WebLocalFrameImpl.h" |
| 74 | 74 |
| 75 #include "bindings/core/v8/DOMWrapperWorld.h" | 75 #include <algorithm> |
| 76 #include "bindings/core/v8/ExceptionState.h" | |
| 77 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | |
| 78 #include "bindings/core/v8/ScriptController.h" | |
| 79 #include "bindings/core/v8/ScriptSourceCode.h" | |
| 80 #include "bindings/core/v8/ScriptValue.h" | |
| 81 #include "bindings/core/v8/V8GCController.h" | |
| 82 #include "bindings/core/v8/V8PerIsolateData.h" | |
| 83 #include "core/dom/Document.h" | |
| 84 #include "core/dom/Node.h" | |
| 85 #include "core/dom/NodeTraversal.h" | |
| 86 #include "core/dom/shadow/ShadowRoot.h" | |
| 87 #include "core/editing/Editor.h" | |
| 88 #include "core/editing/FrameSelection.h" | |
| 89 #include "core/editing/InputMethodController.h" | |
| 90 #include "core/editing/PlainTextRange.h" | |
| 91 #include "core/editing/SpellChecker.h" | |
| 92 #include "core/editing/TextAffinity.h" | |
| 93 #include "core/editing/TextIterator.h" | |
| 94 #include "core/editing/htmlediting.h" | |
| 95 #include "core/editing/markup.h" | |
| 96 #include "core/frame/Console.h" | |
| 97 #include "core/frame/FrameHost.h" | |
| 98 #include "core/frame/FrameView.h" | |
| 99 #include "core/frame/LocalDOMWindow.h" | |
| 100 #include "core/frame/Settings.h" | |
| 101 #include "core/html/HTMLAnchorElement.h" | |
| 102 #include "core/inspector/ConsoleMessage.h" | |
| 103 #include "core/inspector/ScriptCallStack.h" | |
| 104 #include "core/loader/MojoLoader.h" | |
| 105 #include "core/page/Chrome.h" | |
| 106 #include "core/page/EventHandler.h" | |
| 107 #include "core/page/FocusController.h" | |
| 108 #include "core/page/Page.h" | |
| 109 #include "core/rendering/HitTestResult.h" | |
| 110 #include "core/rendering/RenderBox.h" | |
| 111 #include "core/rendering/RenderLayer.h" | |
| 112 #include "core/rendering/RenderObject.h" | |
| 113 #include "core/rendering/RenderTreeAsText.h" | |
| 114 #include "core/rendering/RenderView.h" | |
| 115 #include "core/rendering/style/StyleInheritedData.h" | |
| 116 #include "mojo/public/cpp/system/data_pipe.h" | 76 #include "mojo/public/cpp/system/data_pipe.h" |
| 117 #include "platform/TraceEvent.h" | 77 #include "sky/engine/bindings/core/v8/DOMWrapperWorld.h" |
| 118 #include "platform/UserGestureIndicator.h" | 78 #include "sky/engine/bindings/core/v8/ExceptionState.h" |
| 119 #include "platform/clipboard/ClipboardUtilities.h" | 79 #include "sky/engine/bindings/core/v8/ExceptionStatePlaceholder.h" |
| 120 #include "platform/fonts/FontCache.h" | 80 #include "sky/engine/bindings/core/v8/ScriptController.h" |
| 121 #include "platform/graphics/GraphicsContext.h" | 81 #include "sky/engine/bindings/core/v8/ScriptSourceCode.h" |
| 122 #include "platform/graphics/GraphicsLayerClient.h" | 82 #include "sky/engine/bindings/core/v8/ScriptValue.h" |
| 123 #include "platform/graphics/skia/SkiaUtils.h" | 83 #include "sky/engine/bindings/core/v8/V8GCController.h" |
| 124 #include "platform/heap/Handle.h" | 84 #include "sky/engine/bindings/core/v8/V8PerIsolateData.h" |
| 125 #include "platform/network/ResourceRequest.h" | 85 #include "sky/engine/core/dom/Document.h" |
| 126 #include "platform/scroll/ScrollTypes.h" | 86 #include "sky/engine/core/dom/Node.h" |
| 127 #include "platform/scroll/Scrollbar.h" | 87 #include "sky/engine/core/dom/NodeTraversal.h" |
| 128 #include "platform/weborigin/KURL.h" | 88 #include "sky/engine/core/dom/shadow/ShadowRoot.h" |
| 129 #include "platform/weborigin/SchemeRegistry.h" | 89 #include "sky/engine/core/editing/Editor.h" |
| 130 #include "platform/weborigin/SecurityPolicy.h" | 90 #include "sky/engine/core/editing/FrameSelection.h" |
| 131 #include "public/platform/Platform.h" | 91 #include "sky/engine/core/editing/InputMethodController.h" |
| 132 #include "public/platform/WebFloatPoint.h" | 92 #include "sky/engine/core/editing/PlainTextRange.h" |
| 133 #include "public/platform/WebFloatRect.h" | 93 #include "sky/engine/core/editing/SpellChecker.h" |
| 134 #include "public/platform/WebLayer.h" | 94 #include "sky/engine/core/editing/TextAffinity.h" |
| 135 #include "public/platform/WebPoint.h" | 95 #include "sky/engine/core/editing/TextIterator.h" |
| 136 #include "public/platform/WebRect.h" | 96 #include "sky/engine/core/editing/htmlediting.h" |
| 137 #include "public/platform/WebSize.h" | 97 #include "sky/engine/core/editing/markup.h" |
| 138 #include "public/platform/WebURLError.h" | 98 #include "sky/engine/core/frame/Console.h" |
| 139 #include "public/platform/WebVector.h" | 99 #include "sky/engine/core/frame/FrameHost.h" |
| 140 #include "public/web/WebConsoleMessage.h" | 100 #include "sky/engine/core/frame/FrameView.h" |
| 141 #include "public/web/WebDocument.h" | 101 #include "sky/engine/core/frame/LocalDOMWindow.h" |
| 142 #include "public/web/WebElement.h" | 102 #include "sky/engine/core/frame/Settings.h" |
| 143 #include "public/web/WebFrameClient.h" | 103 #include "sky/engine/core/html/HTMLAnchorElement.h" |
| 144 #include "public/web/WebNode.h" | 104 #include "sky/engine/core/inspector/ConsoleMessage.h" |
| 145 #include "public/web/WebRange.h" | 105 #include "sky/engine/core/inspector/ScriptCallStack.h" |
| 146 #include "public/web/WebScriptSource.h" | 106 #include "sky/engine/core/loader/MojoLoader.h" |
| 147 #include "web/CompositionUnderlineVectorBuilder.h" | 107 #include "sky/engine/core/page/Chrome.h" |
| 148 #include "web/WebViewImpl.h" | 108 #include "sky/engine/core/page/EventHandler.h" |
| 149 #include "wtf/CurrentTime.h" | 109 #include "sky/engine/core/page/FocusController.h" |
| 150 #include "wtf/HashMap.h" | 110 #include "sky/engine/core/page/Page.h" |
| 151 #include <algorithm> | 111 #include "sky/engine/core/rendering/HitTestResult.h" |
| 112 #include "sky/engine/core/rendering/RenderBox.h" |
| 113 #include "sky/engine/core/rendering/RenderLayer.h" |
| 114 #include "sky/engine/core/rendering/RenderObject.h" |
| 115 #include "sky/engine/core/rendering/RenderTreeAsText.h" |
| 116 #include "sky/engine/core/rendering/RenderView.h" |
| 117 #include "sky/engine/core/rendering/style/StyleInheritedData.h" |
| 118 #include "sky/engine/platform/TraceEvent.h" |
| 119 #include "sky/engine/platform/UserGestureIndicator.h" |
| 120 #include "sky/engine/platform/clipboard/ClipboardUtilities.h" |
| 121 #include "sky/engine/platform/fonts/FontCache.h" |
| 122 #include "sky/engine/platform/graphics/GraphicsContext.h" |
| 123 #include "sky/engine/platform/graphics/GraphicsLayerClient.h" |
| 124 #include "sky/engine/platform/graphics/skia/SkiaUtils.h" |
| 125 #include "sky/engine/platform/heap/Handle.h" |
| 126 #include "sky/engine/platform/network/ResourceRequest.h" |
| 127 #include "sky/engine/platform/scroll/ScrollTypes.h" |
| 128 #include "sky/engine/platform/scroll/Scrollbar.h" |
| 129 #include "sky/engine/platform/weborigin/KURL.h" |
| 130 #include "sky/engine/platform/weborigin/SchemeRegistry.h" |
| 131 #include "sky/engine/platform/weborigin/SecurityPolicy.h" |
| 132 #include "sky/engine/public/platform/Platform.h" |
| 133 #include "sky/engine/public/platform/WebFloatPoint.h" |
| 134 #include "sky/engine/public/platform/WebFloatRect.h" |
| 135 #include "sky/engine/public/platform/WebLayer.h" |
| 136 #include "sky/engine/public/platform/WebPoint.h" |
| 137 #include "sky/engine/public/platform/WebRect.h" |
| 138 #include "sky/engine/public/platform/WebSize.h" |
| 139 #include "sky/engine/public/platform/WebURLError.h" |
| 140 #include "sky/engine/public/platform/WebVector.h" |
| 141 #include "sky/engine/public/web/WebConsoleMessage.h" |
| 142 #include "sky/engine/public/web/WebDocument.h" |
| 143 #include "sky/engine/public/web/WebElement.h" |
| 144 #include "sky/engine/public/web/WebFrameClient.h" |
| 145 #include "sky/engine/public/web/WebNode.h" |
| 146 #include "sky/engine/public/web/WebRange.h" |
| 147 #include "sky/engine/public/web/WebScriptSource.h" |
| 148 #include "sky/engine/web/CompositionUnderlineVectorBuilder.h" |
| 149 #include "sky/engine/web/WebViewImpl.h" |
| 150 #include "sky/engine/wtf/CurrentTime.h" |
| 151 #include "sky/engine/wtf/HashMap.h" |
| 152 | 152 |
| 153 namespace blink { | 153 namespace blink { |
| 154 | 154 |
| 155 static int frameCount = 0; | 155 static int frameCount = 0; |
| 156 | 156 |
| 157 // Key for a StatsCounter tracking how many WebFrames are active. | 157 // Key for a StatsCounter tracking how many WebFrames are active. |
| 158 static const char webFrameActiveCount[] = "WebFrameActiveCount"; | 158 static const char webFrameActiveCount[] = "WebFrameActiveCount"; |
| 159 | 159 |
| 160 static void frameContentAsPlainText(size_t maxChars, LocalFrame* frame, StringBu
ilder& output) | 160 static void frameContentAsPlainText(size_t maxChars, LocalFrame* frame, StringBu
ilder& output) |
| 161 { | 161 { |
| (...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 } | 783 } |
| 784 | 784 |
| 785 void WebLocalFrameImpl::invalidateAll() const | 785 void WebLocalFrameImpl::invalidateAll() const |
| 786 { | 786 { |
| 787 ASSERT(frame() && frame()->view()); | 787 ASSERT(frame() && frame()->view()); |
| 788 FrameView* view = frame()->view(); | 788 FrameView* view = frame()->view(); |
| 789 view->invalidateRect(view->frameRect()); | 789 view->invalidateRect(view->frameRect()); |
| 790 } | 790 } |
| 791 | 791 |
| 792 } // namespace blink | 792 } // namespace blink |
| OLD | NEW |