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

Unified Diff: tools/dom/templates/html/dartium/_blink_dartium.darttemplate

Issue 318723005: Modify getType to ensure that it does not result in initialization of (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/dartium/_blink_dartium.darttemplate
===================================================================
--- tools/dom/templates/html/dartium/_blink_dartium.darttemplate (revision 37108)
+++ tools/dom/templates/html/dartium/_blink_dartium.darttemplate (working copy)
@@ -43,18 +43,88 @@
// TODO(vsm): This should be moved out of this library. Into dart:html?
Type _getType(String key) {
+ var result;
+
// TODO(vsm): Add Cross Frame and JS types here as well.
- if (htmlBlinkMap.containsKey(key))
- return htmlBlinkMap[key];
- if (indexed_dbBlinkMap.containsKey(key))
- return indexed_dbBlinkMap[key];
- if (web_audioBlinkMap.containsKey(key))
- return web_audioBlinkMap[key];
- if (web_glBlinkMap.containsKey(key))
- return web_glBlinkMap[key];
- if (web_sqlBlinkMap.containsKey(key))
- return web_sqlBlinkMap[key];
- if (svgBlinkMap.containsKey(key))
- return svgBlinkMap[key];
+
+ // Check the html library.
+ result = _getHtmlType(key);
+ if (result != null) {
+ return result;
+ }
+
+ // Check the web gl library.
+ result = _getWebGlType(key);
+ if (result != null) {
+ return result;
+ }
+
+ // Check the indexed db library.
+ result = _getIndexDbType(key);
+ if (result != null) {
+ return result;
+ }
+
+ // Check the web audio library.
+ result = _getWebAudioType(key);
+ if (result != null) {
+ return result;
+ }
+
+ // Check the web sql library.
+ result = _getWebSqlType(key);
+ if (result != null) {
+ return result;
+ }
+
+ // Check the svg library.
+ result = _getSvgType(key);
+ if (result != null) {
+ return result;
+ }
+
return null;
-}
+}
+
+Type _getHtmlType(String key) {
+ if (htmlBlinkMap.containsKey(key)) {
+ return htmlBlinkMap[key]();
rmacnak 2014/06/09 17:07:18 Why are we calling the values in the map? It looks
siva 2014/06/09 17:10:02 There is a CL by Vijay where he converted the Type
+ }
+ return null;
+}
+
+Type _getWebGlType(String key) {
+ if (web_glBlinkMap.containsKey(key)) {
+ return web_glBlinkMap[key]();
+ }
+ return null;
+}
+
+Type _getIndexDbType(String key) {
+ if (indexed_dbBlinkMap.containsKey(key)) {
+ return indexed_dbBlinkMap[key]();
+ }
+ return null;
+}
+
+Type _getWebAudioType(String key) {
+ if (web_audioBlinkMap.containsKey(key)) {
+ return web_audioBlinkMap[key]();
+ }
+ return null;
+}
+
+Type _getWebSqlType(String key) {
+ if (web_sqlBlinkMap.containsKey(key)) {
+ return web_sqlBlinkMap[key]();
+ }
+ return null;
+}
+
+Type _getSvgType(String key) {
+ if (svgBlinkMap.containsKey(key)) {
+ return svgBlinkMap[key]();
+ }
+ return null;
+}
+
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698