OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 15 matching lines...) Expand all Loading... |
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 */ | 30 */ |
31 | 31 |
32 #include "sky/engine/config.h" | 32 #include "sky/engine/config.h" |
33 #include "sky/engine/web/FrameLoaderClientImpl.h" | 33 #include "sky/engine/web/FrameLoaderClientImpl.h" |
34 | 34 |
35 #include "gen/sky/platform/RuntimeEnabledFeatures.h" | 35 #include "gen/sky/platform/RuntimeEnabledFeatures.h" |
36 #include "sky/engine/bindings/core/v8/ScriptController.h" | |
37 #include "sky/engine/core/dom/Document.h" | 36 #include "sky/engine/core/dom/Document.h" |
38 #include "sky/engine/core/frame/FrameView.h" | 37 #include "sky/engine/core/frame/FrameView.h" |
39 #include "sky/engine/core/frame/Settings.h" | 38 #include "sky/engine/core/frame/Settings.h" |
40 #include "sky/engine/core/html/HTMLIFrameElement.h" | 39 #include "sky/engine/core/html/HTMLIFrameElement.h" |
41 #include "sky/engine/core/page/EventHandler.h" | 40 #include "sky/engine/core/page/EventHandler.h" |
42 #include "sky/engine/core/page/Page.h" | 41 #include "sky/engine/core/page/Page.h" |
43 #include "sky/engine/core/rendering/HitTestResult.h" | 42 #include "sky/engine/core/rendering/HitTestResult.h" |
44 #include "sky/engine/platform/MIMETypeRegistry.h" | 43 #include "sky/engine/platform/MIMETypeRegistry.h" |
45 #include "sky/engine/platform/exported/WrappedResourceRequest.h" | 44 #include "sky/engine/platform/exported/WrappedResourceRequest.h" |
46 #include "sky/engine/platform/exported/WrappedResourceResponse.h" | 45 #include "sky/engine/platform/exported/WrappedResourceResponse.h" |
47 #include "sky/engine/platform/network/HTTPParsers.h" | 46 #include "sky/engine/platform/network/HTTPParsers.h" |
48 #include "sky/engine/public/platform/Platform.h" | 47 #include "sky/engine/public/platform/Platform.h" |
49 #include "sky/engine/public/platform/WebURL.h" | 48 #include "sky/engine/public/platform/WebURL.h" |
50 #include "sky/engine/public/platform/WebURLError.h" | 49 #include "sky/engine/public/platform/WebURLError.h" |
51 #include "sky/engine/public/platform/WebVector.h" | 50 #include "sky/engine/public/platform/WebVector.h" |
52 #include "sky/engine/public/web/WebCachedURLRequest.h" | 51 #include "sky/engine/public/web/WebCachedURLRequest.h" |
53 #include "sky/engine/public/web/WebDocument.h" | 52 #include "sky/engine/public/web/WebDocument.h" |
54 #include "sky/engine/public/web/WebFrameClient.h" | 53 #include "sky/engine/public/web/WebFrameClient.h" |
55 #include "sky/engine/public/web/WebNode.h" | 54 #include "sky/engine/public/web/WebNode.h" |
56 #include "sky/engine/public/web/WebViewClient.h" | 55 #include "sky/engine/public/web/WebViewClient.h" |
57 #include "sky/engine/web/WebLocalFrameImpl.h" | 56 #include "sky/engine/web/WebLocalFrameImpl.h" |
58 #include "sky/engine/web/WebViewImpl.h" | 57 #include "sky/engine/web/WebViewImpl.h" |
59 #include "sky/engine/wtf/StringExtras.h" | 58 #include "sky/engine/wtf/StringExtras.h" |
60 #include "sky/engine/wtf/text/CString.h" | 59 #include "sky/engine/wtf/text/CString.h" |
61 #include "sky/engine/wtf/text/WTFString.h" | 60 #include "sky/engine/wtf/text/WTFString.h" |
62 #include "v8/include/v8.h" | |
63 | 61 |
64 namespace blink { | 62 namespace blink { |
65 | 63 |
66 FrameLoaderClientImpl::FrameLoaderClientImpl(WebLocalFrameImpl* frame) | 64 FrameLoaderClientImpl::FrameLoaderClientImpl(WebLocalFrameImpl* frame) |
67 : m_webFrame(frame) | 65 : m_webFrame(frame) |
68 { | 66 { |
69 } | 67 } |
70 | 68 |
71 FrameLoaderClientImpl::~FrameLoaderClientImpl() | 69 FrameLoaderClientImpl::~FrameLoaderClientImpl() |
72 { | 70 { |
73 } | 71 } |
74 | 72 |
75 void FrameLoaderClientImpl::documentElementAvailable() | 73 void FrameLoaderClientImpl::documentElementAvailable() |
76 { | 74 { |
77 if (m_webFrame->client()) | 75 if (m_webFrame->client()) |
78 m_webFrame->client()->didCreateDocumentElement(m_webFrame); | 76 m_webFrame->client()->didCreateDocumentElement(m_webFrame); |
79 } | 77 } |
80 | 78 |
81 void FrameLoaderClientImpl::didCreateScriptContext(v8::Handle<v8::Context> conte
xt) | |
82 { | |
83 // FIXME: We shouldn't need separate debugger ids in sky since | |
84 // we should have at most one DocumentView per process, no? | |
85 m_webFrame->frame()->script().setWorldDebugId(1); | |
86 | |
87 if (m_webFrame->client()) | |
88 m_webFrame->client()->didCreateScriptContext(m_webFrame, context); | |
89 } | |
90 | |
91 void FrameLoaderClientImpl::willReleaseScriptContext(v8::Handle<v8::Context> con
text) | |
92 { | |
93 if (m_webFrame->client()) | |
94 m_webFrame->client()->willReleaseScriptContext(m_webFrame, context); | |
95 } | |
96 | |
97 void FrameLoaderClientImpl::detachedFromParent() | 79 void FrameLoaderClientImpl::detachedFromParent() |
98 { | 80 { |
99 // Alert the client that the frame is being detached. This is the last | 81 // Alert the client that the frame is being detached. This is the last |
100 // chance we have to communicate with the client. | 82 // chance we have to communicate with the client. |
101 RefPtr<WebLocalFrameImpl> protector(m_webFrame); | 83 RefPtr<WebLocalFrameImpl> protector(m_webFrame); |
102 | 84 |
103 WebFrameClient* client = m_webFrame->client(); | 85 WebFrameClient* client = m_webFrame->client(); |
104 if (!client) | 86 if (!client) |
105 return; | 87 return; |
106 | 88 |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 if (m_webFrame->client()) | 245 if (m_webFrame->client()) |
264 m_webFrame->client()->didLoseWebGLContext(m_webFrame, arbRobustnessConte
xtLostReason); | 246 m_webFrame->client()->didLoseWebGLContext(m_webFrame, arbRobustnessConte
xtLostReason); |
265 } | 247 } |
266 | 248 |
267 void FrameLoaderClientImpl::dispatchDidChangeManifest() | 249 void FrameLoaderClientImpl::dispatchDidChangeManifest() |
268 { | 250 { |
269 if (m_webFrame->client()) | 251 if (m_webFrame->client()) |
270 m_webFrame->client()->didChangeManifest(m_webFrame); | 252 m_webFrame->client()->didChangeManifest(m_webFrame); |
271 } | 253 } |
272 | 254 |
| 255 void FrameLoaderClientImpl::didCreateIsolate(Dart_Isolate isolate) { |
| 256 if (m_webFrame->client()) |
| 257 m_webFrame->client()->didCreateIsolate(m_webFrame, isolate); |
| 258 } |
| 259 |
273 } // namespace blink | 260 } // namespace blink |
OLD | NEW |