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

Side by Side Diff: Source/bindings/core/dart/DartHandleProxy.cpp

Issue 1663753002: Apply all blink changes between @202695 and tip of trunk (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/2454_1
Patch Set: Created 4 years, 10 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 v8::Local<v8::Array> propertyNames = commandLineApi->GetOwnPropertyN ames(); 1194 v8::Local<v8::Array> propertyNames = commandLineApi->GetOwnPropertyN ames();
1195 uint32_t length = propertyNames->Length(); 1195 uint32_t length = propertyNames->Length();
1196 ASSERT(length > 0); 1196 ASSERT(length > 0);
1197 for (uint32_t i = 0; i < length; i++) { 1197 for (uint32_t i = 0; i < length; i++) {
1198 v8::Handle<v8::String> propertyName = propertyNames->Get(i).As<v 8::String>(); 1198 v8::Handle<v8::String> propertyName = propertyNames->Get(i).As<v 8::String>();
1199 ASSERT(!propertyNames.IsEmpty()); 1199 ASSERT(!propertyNames.IsEmpty());
1200 v8::Handle<v8::Value> propertyValue = commandLineApi->Get(proper tyName); 1200 v8::Handle<v8::Value> propertyValue = commandLineApi->Get(proper tyName);
1201 1201
1202 Dart_Handle dartValue; 1202 Dart_Handle dartValue;
1203 if (propertyValue->IsFunction()) { 1203 if (propertyValue->IsFunction()) {
1204 dartValue = JsInterop::toDart(propertyValue); 1204 dartValue = JsInterop::toDart(propertyValue, true);
1205 // We need to wrap the JsFunction object we get back 1205 // We need to wrap the JsFunction object we get back
1206 // from the vanila JsInterop library so that users can 1206 // from the vanila JsInterop library so that users can
1207 // call it like a normal Dart function instead of 1207 // call it like a normal Dart function instead of
1208 // having to use the apply method. 1208 // having to use the apply method.
1209 dartValue = Dart_Invoke(domData->jsLibrary(), Dart_NewString FromCString("_wrapAsDebuggerVarArgsFunction"), 1, &dartValue); 1209 dartValue = Dart_Invoke(domData->jsLibrary(), Dart_NewString FromCString("_wrapAsDebuggerVarArgsFunction"), 1, &dartValue);
1210 } else { 1210 } else {
1211 dartValue = JsInterop::toDart(propertyValue); 1211 dartValue = JsInterop::toDart(propertyValue, true);
1212 } 1212 }
1213 locals.append(V8Converter::stringToDart(propertyName)); 1213 locals.append(V8Converter::stringToDart(propertyName));
1214 locals.append(dartValue); 1214 locals.append(dartValue);
1215 } 1215 }
1216 } 1216 }
1217 localVariables = DartUtilities::toList(locals, exception); 1217 localVariables = DartUtilities::toList(locals, exception);
1218 ASSERT(!exception); 1218 ASSERT(!exception);
1219 } 1219 }
1220 1220
1221 Dart_Handle wrapExpressionArgs[2] = { expression, localVariables }; 1221 Dart_Handle wrapExpressionArgs[2] = { expression, localVariables };
(...skipping 19 matching lines...) Expand all
1241 for (intptr_t i = 0; i < length; i ++) 1241 for (intptr_t i = 0; i < length; i ++)
1242 dartFunctionArgs.append(Dart_ListGetAt(wrappedExpressionArgs, i)); 1242 dartFunctionArgs.append(Dart_ListGetAt(wrappedExpressionArgs, i));
1243 1243
1244 Dart_Handle result = Dart_InvokeClosure(closure, dartFunctionArgs.size(), da rtFunctionArgs.data()); 1244 Dart_Handle result = Dart_InvokeClosure(closure, dartFunctionArgs.size(), da rtFunctionArgs.data());
1245 if (Dart_IsError(result)) 1245 if (Dart_IsError(result))
1246 return V8ThrowException::throwException(v8::String::NewFromUtf8(v8Isolat e, Dart_GetError(result)), v8::Isolate::GetCurrent()); 1246 return V8ThrowException::throwException(v8::String::NewFromUtf8(v8Isolat e, Dart_GetError(result)), v8::Isolate::GetCurrent());
1247 return DartHandleProxy::create(result); 1247 return DartHandleProxy::create(result);
1248 } 1248 }
1249 1249
1250 } 1250 }
OLDNEW
« no previous file with comments | « Source/bindings/core/dart/DartEventListener.cpp ('k') | Source/bindings/core/dart/DartInjectedScript.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698