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

Unified Diff: sky/engine/core/script/dom_dart_state.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/painting/Rect.cpp ('k') | sky/engine/core/script/dom_dart_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/script/dom_dart_state.h
diff --git a/sky/engine/core/script/dom_dart_state.h b/sky/engine/core/script/dom_dart_state.h
index f10aedee3c437c55f92f505d49192b7d4ef8eba9..776b1f250a6ecba06eb0aa29382161f3d716abc2 100644
--- a/sky/engine/core/script/dom_dart_state.h
+++ b/sky/engine/core/script/dom_dart_state.h
@@ -20,6 +20,8 @@ class DOMDartState : public DartState {
explicit DOMDartState(Document* document);
~DOMDartState() override;
+ virtual void DidSetIsolate();
+
static DOMDartState* Current();
static Document* CurrentDocument();
@@ -29,11 +31,20 @@ class DOMDartState : public DartState {
Document* document() const { return document_.get(); }
DartLoader& loader() const { return *loader_; }
+ // Cached handles to strings used in Dart/C++ conversions.
+ Dart_Handle x_handle() { return x_handle_.value(); }
+ Dart_Handle y_handle() { return y_handle_.value(); }
+ Dart_Handle value_handle() { return value_handle_.value(); }
+
private:
RefPtr<Document> document_;
OwnPtr<DartLoader> loader_;
+
+ DartPersistentValue x_handle_;
+ DartPersistentValue y_handle_;
+ DartPersistentValue value_handle_;
};
-}
+} // namespace blink
#endif // SKY_ENGINE_CORE_SCRIPT_DOM_DART_STATE_H_
« no previous file with comments | « sky/engine/core/painting/Rect.cpp ('k') | sky/engine/core/script/dom_dart_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698