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

Unified Diff: sky/engine/core/painting/Point.cpp

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/core.gni ('k') | sky/engine/core/painting/Rect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/painting/Point.cpp
diff --git a/sky/engine/core/painting/Point.cpp b/sky/engine/core/painting/Point.cpp
index aff2fdcb7b9869d768cd1b50710e8a8c983c66c1..b2a7711f70ad534845929a8fa0e38d24bfaea994 100644
--- a/sky/engine/core/painting/Point.cpp
+++ b/sky/engine/core/painting/Point.cpp
@@ -5,8 +5,8 @@
#include "sky/engine/config.h"
#include "sky/engine/core/painting/Point.h"
+#include "sky/engine/core/script/dom_dart_state.h"
#include "sky/engine/tonic/dart_error.h"
-#include "sky/engine/tonic/dart_state.h"
#include "base/logging.h"
namespace blink {
@@ -22,13 +22,15 @@ Point DartConverter<Point, void>::FromArgumentsWithNullCheck(
Dart_Handle dartPoint = Dart_GetNativeArgument(args, index);
DCHECK(!LogIfError(dartPoint));
- Dart_Handle xValue = Dart_GetField(dartPoint, Dart_NewStringFromCString("x"));
- Dart_Handle yValue = Dart_GetField(dartPoint, Dart_NewStringFromCString("y"));
+ Dart_Handle x_value = Dart_GetField(dartPoint,
+ DOMDartState::Current()->x_handle());
+ Dart_Handle y_value = Dart_GetField(dartPoint,
+ DOMDartState::Current()->y_handle());
double x = 0.0, y = 0.0;
- Dart_Handle err = Dart_DoubleValue(xValue, &x);
+ Dart_Handle err = Dart_DoubleValue(x_value, &x);
DCHECK(!LogIfError(err));
- err = Dart_DoubleValue(xValue, &y);
+ err = Dart_DoubleValue(y_value, &y);
DCHECK(!LogIfError(err));
result.sk_point.set(x, y);
result.is_null = false;
« no previous file with comments | « sky/engine/core/core.gni ('k') | sky/engine/core/painting/Rect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698