| 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/tonic/dart_builtin.h" | 8 #include "sky/engine/tonic/dart_builtin.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 DOMDartState::DOMDartState(Document* document, const KURL& url) | 12 DOMDartState::DOMDartState(Document* document, const String& url) |
| 13 : document_(document), url_(url) { | 13 : document_(document), url_(url) { |
| 14 } | 14 } |
| 15 | 15 |
| 16 DOMDartState::~DOMDartState() { | 16 DOMDartState::~DOMDartState() { |
| 17 // 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 |
| 18 // 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 |
| 19 // clean themselves up. | 19 // clean themselves up. |
| 20 weak_factory_.InvalidateWeakPtrs(); | 20 weak_factory_.InvalidateWeakPtrs(); |
| 21 } | 21 } |
| 22 | 22 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 42 DCHECK(Current()->document_); | 42 DCHECK(Current()->document_); |
| 43 return Current()->document_->frame(); | 43 return Current()->document_->frame(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 LocalDOMWindow* DOMDartState::CurrentWindow() { | 46 LocalDOMWindow* DOMDartState::CurrentWindow() { |
| 47 DCHECK(Current()->document_); | 47 DCHECK(Current()->document_); |
| 48 return Current()->document_->domWindow(); | 48 return Current()->document_->domWindow(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 } // namespace blink | 51 } // namespace blink |
| OLD | NEW |