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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/lib/native_helper.dart

Issue 15755017: Switch from DRT to content shell. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of _js_helper; 5 part of _js_helper;
6 6
7 String typeNameInChrome(obj) { 7 String typeNameInChrome(obj) {
8 String name = JS('String', "#.constructor.name", obj); 8 String name = JS('String', "#.constructor.name", obj);
9 return typeNameInWebKitCommon(name); 9 return typeNameInWebKitCommon(name);
10 } 10 }
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 } 156 }
157 157
158 /** 158 /**
159 * Returns the function to use to get the type name of an object. 159 * Returns the function to use to get the type name of an object.
160 */ 160 */
161 Function getFunctionForTypeNameOf() { 161 Function getFunctionForTypeNameOf() {
162 // If we're not in the browser, we're almost certainly running on v8. 162 // If we're not in the browser, we're almost certainly running on v8.
163 if (!identical(JS('String', 'typeof(navigator)'), 'object')) return typeNameIn Chrome; 163 if (!identical(JS('String', 'typeof(navigator)'), 'object')) return typeNameIn Chrome;
164 164
165 String userAgent = JS('String', "navigator.userAgent"); 165 String userAgent = JS('String', "navigator.userAgent");
166 // TODO(antonm): remove a reference to DumpRenderTree.
166 if (contains(userAgent, 'Chrome') || contains(userAgent, 'DumpRenderTree')) { 167 if (contains(userAgent, 'Chrome') || contains(userAgent, 'DumpRenderTree')) {
167 return typeNameInChrome; 168 return typeNameInChrome;
168 } else if (contains(userAgent, 'Firefox')) { 169 } else if (contains(userAgent, 'Firefox')) {
169 return typeNameInFirefox; 170 return typeNameInFirefox;
170 } else if (contains(userAgent, 'MSIE')) { 171 } else if (contains(userAgent, 'MSIE')) {
171 return typeNameInIE; 172 return typeNameInIE;
172 } else if (contains(userAgent, 'Opera')) { 173 } else if (contains(userAgent, 'Opera')) {
173 return typeNameInOpera; 174 return typeNameInOpera;
174 } else if (contains(userAgent, 'AppleWebKit')) { 175 } else if (contains(userAgent, 'AppleWebKit')) {
175 // Chrome matches 'AppleWebKit' too, but we test for Chrome first, so this 176 // Chrome matches 'AppleWebKit' too, but we test for Chrome first, so this
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 } 302 }
302 var isLeaf = 303 var isLeaf =
303 (leafTags != null) && JS('bool', '(#[#]) === true', leafTags, tag); 304 (leafTags != null) && JS('bool', '(#[#]) === true', leafTags, tag);
304 if (isLeaf) { 305 if (isLeaf) {
305 return makeDispatchRecord(interceptor, false, null); 306 return makeDispatchRecord(interceptor, false, null);
306 } else { 307 } else {
307 var proto = JS('', 'Object.getPrototypeOf(#)', obj); 308 var proto = JS('', 'Object.getPrototypeOf(#)', obj);
308 return makeDispatchRecord(interceptor, proto, null); 309 return makeDispatchRecord(interceptor, proto, null);
309 } 310 }
310 } 311 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698