| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "sky/engine/core/script/dom_dart_state.h" | 5 #include "sky/engine/core/script/dom_dart_state.h" |
| 6 | 6 |
| 7 #include "sky/engine/core/dom/Document.h" | 7 #include "sky/engine/core/dom/Document.h" |
| 8 #include "sky/engine/core/script/dart_loader.h" | |
| 9 #include "sky/engine/tonic/dart_builtin.h" | 8 #include "sky/engine/tonic/dart_builtin.h" |
| 10 | 9 |
| 11 namespace blink { | 10 namespace blink { |
| 12 | 11 |
| 13 DOMDartState::DOMDartState(Document* document, const KURL& url) | 12 DOMDartState::DOMDartState(Document* document, const KURL& url) |
| 14 : document_(document), url_(url), loader_(adoptPtr(new DartLoader(this))) { | 13 : document_(document), url_(url) { |
| 15 } | 14 } |
| 16 | 15 |
| 17 DOMDartState::~DOMDartState() { | 16 DOMDartState::~DOMDartState() { |
| 18 // We've already destroyed the isolate. Revoke any weak ptrs held by | 17 // We've already destroyed the isolate. Revoke any weak ptrs held by |
| 19 // DartPersistentValues so they don't try to enter the destroyed isolate to | 18 // DartPersistentValues so they don't try to enter the destroyed isolate to |
| 20 // clean themselves up. | 19 // clean themselves up. |
| 21 weak_factory_.InvalidateWeakPtrs(); | 20 weak_factory_.InvalidateWeakPtrs(); |
| 22 } | 21 } |
| 23 | 22 |
| 24 void DOMDartState::DidSetIsolate() { | 23 void DOMDartState::DidSetIsolate() { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 43 DCHECK(Current()->document_); | 42 DCHECK(Current()->document_); |
| 44 return Current()->document_->frame(); | 43 return Current()->document_->frame(); |
| 45 } | 44 } |
| 46 | 45 |
| 47 LocalDOMWindow* DOMDartState::CurrentWindow() { | 46 LocalDOMWindow* DOMDartState::CurrentWindow() { |
| 48 DCHECK(Current()->document_); | 47 DCHECK(Current()->document_); |
| 49 return Current()->document_->domWindow(); | 48 return Current()->document_->domWindow(); |
| 50 } | 49 } |
| 51 | 50 |
| 52 } // namespace blink | 51 } // namespace blink |
| OLD | NEW |