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

Unified Diff: Source/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp

Issue 22038002: Get rid of the tryFast*alloc API. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review item. Created 7 years, 4 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 | « Source/bindings/v8/WrapperTypeInfo.h ('k') | Source/core/loader/NavigationPolicy.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
diff --git a/Source/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp b/Source/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
index 8b0783ec05e16c11cfe163c83eaccb2415a6437e..18ec9cec83c26fdf25c9b3797a6a0521ead3b328 100644
--- a/Source/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
+++ b/Source/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
@@ -80,15 +80,15 @@
namespace WebCore {
-// Allocates new storage via tryFastMalloc.
+// Allocates new storage via fastMalloc.
// Returns NULL if array failed to convert for any reason.
static float* jsArrayToFloatArray(v8::Handle<v8::Array> array, uint32_t len)
{
// Convert the data element-by-element.
- float* data = 0;
- if (len > std::numeric_limits<uint32_t>::max() / sizeof(float)
- || !tryFastMalloc(len * sizeof(float)).getValue(data))
+ if (len > std::numeric_limits<uint32_t>::max() / sizeof(float))
return 0;
+ float* data = static_cast<float*>(fastMalloc(len * sizeof(float)));
+
for (uint32_t i = 0; i < len; i++) {
v8::Local<v8::Value> val = array->Get(i);
if (!val->IsNumber()) {
@@ -100,15 +100,15 @@ static float* jsArrayToFloatArray(v8::Handle<v8::Array> array, uint32_t len)
return data;
}
-// Allocates new storage via tryFastMalloc.
+// Allocates new storage via fastMalloc.
// Returns NULL if array failed to convert for any reason.
static int* jsArrayToIntArray(v8::Handle<v8::Array> array, uint32_t len)
{
// Convert the data element-by-element.
- int* data = 0;
- if (len > std::numeric_limits<uint32_t>::max() / sizeof(int)
- || !tryFastMalloc(len * sizeof(int)).getValue(data))
+ if (len > std::numeric_limits<uint32_t>::max() / sizeof(int))
return 0;
+ int* data = static_cast<int*>(fastMalloc(len * sizeof(int)));
+
for (uint32_t i = 0; i < len; i++) {
v8::Local<v8::Value> val = array->Get(i);
bool ok;
« no previous file with comments | « Source/bindings/v8/WrapperTypeInfo.h ('k') | Source/core/loader/NavigationPolicy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698