OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
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 | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 #include "sky/engine/core/frame/Screen.h" | 58 #include "sky/engine/core/frame/Screen.h" |
59 #include "sky/engine/core/frame/Settings.h" | 59 #include "sky/engine/core/frame/Settings.h" |
60 #include "sky/engine/core/frame/Tracing.h" | 60 #include "sky/engine/core/frame/Tracing.h" |
61 #include "sky/engine/core/inspector/ConsoleMessage.h" | 61 #include "sky/engine/core/inspector/ConsoleMessage.h" |
62 #include "sky/engine/core/loader/FrameLoaderClient.h" | 62 #include "sky/engine/core/loader/FrameLoaderClient.h" |
63 #include "sky/engine/core/page/ChromeClient.h" | 63 #include "sky/engine/core/page/ChromeClient.h" |
64 #include "sky/engine/core/page/EventHandler.h" | 64 #include "sky/engine/core/page/EventHandler.h" |
65 #include "sky/engine/core/page/Page.h" | 65 #include "sky/engine/core/page/Page.h" |
66 #include "sky/engine/core/rendering/style/RenderStyle.h" | 66 #include "sky/engine/core/rendering/style/RenderStyle.h" |
67 #include "sky/engine/core/script/dart_controller.h" | 67 #include "sky/engine/core/script/dart_controller.h" |
| 68 #include "sky/engine/core/script/dom_dart_state.h" |
68 #include "sky/engine/platform/EventDispatchForbiddenScope.h" | 69 #include "sky/engine/platform/EventDispatchForbiddenScope.h" |
69 #include "sky/engine/platform/PlatformScreen.h" | 70 #include "sky/engine/platform/PlatformScreen.h" |
70 #include "sky/engine/platform/geometry/FloatRect.h" | 71 #include "sky/engine/platform/geometry/FloatRect.h" |
71 #include "sky/engine/platform/weborigin/KURL.h" | 72 #include "sky/engine/platform/weborigin/KURL.h" |
72 #include "sky/engine/platform/weborigin/SecurityPolicy.h" | 73 #include "sky/engine/platform/weborigin/SecurityPolicy.h" |
73 #include "sky/engine/public/platform/Platform.h" | 74 #include "sky/engine/public/platform/Platform.h" |
74 #include "sky/engine/public/platform/ServiceProvider.h" | 75 #include "sky/engine/public/platform/ServiceProvider.h" |
75 #include "sky/engine/tonic/dart_gc_visitor.h" | 76 #include "sky/engine/tonic/dart_gc_visitor.h" |
76 #include "sky/engine/wtf/MainThread.h" | 77 #include "sky/engine/wtf/MainThread.h" |
77 #include "sky/engine/wtf/MathExtras.h" | 78 #include "sky/engine/wtf/MathExtras.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 | 220 |
220 PassRefPtr<Document> LocalDOMWindow::installNewDocument(const DocumentInit& init
) | 221 PassRefPtr<Document> LocalDOMWindow::installNewDocument(const DocumentInit& init
) |
221 { | 222 { |
222 ASSERT(init.frame() == m_frame); | 223 ASSERT(init.frame() == m_frame); |
223 | 224 |
224 clearDocument(); | 225 clearDocument(); |
225 | 226 |
226 m_document = Document::create(init); | 227 m_document = Document::create(init); |
227 m_application = Application::create(m_document.get(), m_document.get(), m_do
cument->url().string()); | 228 m_application = Application::create(m_document.get(), m_document.get(), m_do
cument->url().string()); |
228 m_eventQueue = DOMWindowEventQueue::create(m_document.get()); | 229 m_eventQueue = DOMWindowEventQueue::create(m_document.get()); |
229 m_frame->dart().CreateIsolateFor(m_document.get()); | 230 m_frame->dart().CreateIsolateFor(adoptPtr(new DOMDartState(m_document.get())
), m_document->url()); |
| 231 |
| 232 { |
| 233 Dart_Isolate isolate = m_frame->dart().dart_state()->isolate(); |
| 234 DartIsolateScope scope(isolate); |
| 235 DartApiScope api_scope; |
| 236 m_document->frame()->loaderClient()->didCreateIsolate(isolate); |
| 237 } |
| 238 |
230 m_document->attach(); | 239 m_document->attach(); |
231 | |
232 return m_document; | 240 return m_document; |
233 } | 241 } |
234 | 242 |
235 EventQueue* LocalDOMWindow::eventQueue() const | 243 EventQueue* LocalDOMWindow::eventQueue() const |
236 { | 244 { |
237 return m_eventQueue.get(); | 245 return m_eventQueue.get(); |
238 } | 246 } |
239 | 247 |
240 void LocalDOMWindow::enqueueWindowEvent(PassRefPtr<Event> event) | 248 void LocalDOMWindow::enqueueWindowEvent(PassRefPtr<Event> event) |
241 { | 249 { |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 { | 735 { |
728 return static_cast<DOMWindowLifecycleNotifier&>(LifecycleContext<LocalDOMWin
dow>::lifecycleNotifier()); | 736 return static_cast<DOMWindowLifecycleNotifier&>(LifecycleContext<LocalDOMWin
dow>::lifecycleNotifier()); |
729 } | 737 } |
730 | 738 |
731 PassOwnPtr<LifecycleNotifier<LocalDOMWindow> > LocalDOMWindow::createLifecycleNo
tifier() | 739 PassOwnPtr<LifecycleNotifier<LocalDOMWindow> > LocalDOMWindow::createLifecycleNo
tifier() |
732 { | 740 { |
733 return DOMWindowLifecycleNotifier::create(this); | 741 return DOMWindowLifecycleNotifier::create(this); |
734 } | 742 } |
735 | 743 |
736 } // namespace blink | 744 } // namespace blink |
OLD | NEW |