Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: sky/engine/core/script/dom_dart_state.cc

Issue 1145103005: Add DartHandleCache and use it to cache strings used when converting Rect and (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: simplify Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/core/script/dom_dart_state.h ('k') | sky/engine/tonic/dart_state.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/config.h" 5 #include "sky/engine/config.h"
6 #include "sky/engine/core/script/dom_dart_state.h" 6 #include "sky/engine/core/script/dom_dart_state.h"
7 7
8 #include "sky/engine/core/dom/Document.h" 8 #include "sky/engine/core/dom/Document.h"
9 #include "sky/engine/core/script/dart_loader.h" 9 #include "sky/engine/core/script/dart_loader.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 DOMDartState::DOMDartState(Document* document) 13 DOMDartState::DOMDartState(Document* document)
14 : document_(document), loader_(adoptPtr(new DartLoader(this))) { 14 : document_(document),
15 loader_(adoptPtr(new DartLoader(this))) {
15 } 16 }
16 17
17 DOMDartState::~DOMDartState() { 18 DOMDartState::~DOMDartState() {
18 } 19 }
19 20
21 void DOMDartState::DidSetIsolate() {
22 Scope dart_scope(this);
23 x_handle_.Set(this, Dart_NewStringFromCString("x"));
24 y_handle_.Set(this, Dart_NewStringFromCString("y"));
25 value_handle_.Set(this, Dart_NewStringFromCString("_value"));
26 }
27
20 DOMDartState* DOMDartState::Current() { 28 DOMDartState* DOMDartState::Current() {
21 return static_cast<DOMDartState*>(DartState::Current()); 29 return static_cast<DOMDartState*>(DartState::Current());
22 } 30 }
23 31
24 Document* DOMDartState::CurrentDocument() { 32 Document* DOMDartState::CurrentDocument() {
25 return Current()->document_.get(); 33 return Current()->document_.get();
26 } 34 }
27 35
28 LocalFrame* DOMDartState::CurrentFrame() { 36 LocalFrame* DOMDartState::CurrentFrame() {
29 DCHECK(Current()->document_); 37 DCHECK(Current()->document_);
30 return Current()->document_->frame(); 38 return Current()->document_->frame();
31 } 39 }
32 40
33 LocalDOMWindow* DOMDartState::CurrentWindow() { 41 LocalDOMWindow* DOMDartState::CurrentWindow() {
34 DCHECK(Current()->document_); 42 DCHECK(Current()->document_);
35 return Current()->document_->domWindow(); 43 return Current()->document_->domWindow();
36 } 44 }
37 45
38 } 46 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/script/dom_dart_state.h ('k') | sky/engine/tonic/dart_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698