| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 { | 87 { |
| 88 return V8ThrowException::createTypeError(ExceptionMessages::failedToConstruc
t(type, ExceptionMessages::notEnoughArguments(expected, provided)), isolate); | 88 return V8ThrowException::createTypeError(ExceptionMessages::failedToConstruc
t(type, ExceptionMessages::notEnoughArguments(expected, provided)), isolate); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void setMinimumArityTypeError(ExceptionState& exceptionState, unsigned expected,
unsigned provided) | 91 void setMinimumArityTypeError(ExceptionState& exceptionState, unsigned expected,
unsigned provided) |
| 92 { | 92 { |
| 93 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(expected
, provided)); | 93 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(expected
, provided)); |
| 94 } | 94 } |
| 95 | 95 |
| 96 class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { | 96 class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { |
| 97 virtual void* Allocate(size_t size) OVERRIDE | 97 virtual void* Allocate(size_t size) override |
| 98 { | 98 { |
| 99 void* data; | 99 void* data; |
| 100 WTF::ArrayBufferContents::allocateMemory(size, WTF::ArrayBufferContents:
:ZeroInitialize, data); | 100 WTF::ArrayBufferContents::allocateMemory(size, WTF::ArrayBufferContents:
:ZeroInitialize, data); |
| 101 return data; | 101 return data; |
| 102 } | 102 } |
| 103 | 103 |
| 104 virtual void* AllocateUninitialized(size_t size) OVERRIDE | 104 virtual void* AllocateUninitialized(size_t size) override |
| 105 { | 105 { |
| 106 void* data; | 106 void* data; |
| 107 WTF::ArrayBufferContents::allocateMemory(size, WTF::ArrayBufferContents:
:DontInitialize, data); | 107 WTF::ArrayBufferContents::allocateMemory(size, WTF::ArrayBufferContents:
:DontInitialize, data); |
| 108 return data; | 108 return data; |
| 109 } | 109 } |
| 110 | 110 |
| 111 virtual void Free(void* data, size_t size) OVERRIDE | 111 virtual void Free(void* data, size_t size) override |
| 112 { | 112 { |
| 113 WTF::ArrayBufferContents::freeMemory(data, size); | 113 WTF::ArrayBufferContents::freeMemory(data, size); |
| 114 } | 114 } |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 v8::ArrayBuffer::Allocator* v8ArrayBufferAllocator() | 117 v8::ArrayBuffer::Allocator* v8ArrayBufferAllocator() |
| 118 { | 118 { |
| 119 DEFINE_STATIC_LOCAL(ArrayBufferAllocator, arrayBufferAllocator, ()); | 119 DEFINE_STATIC_LOCAL(ArrayBufferAllocator, arrayBufferAllocator, ()); |
| 120 return &arrayBufferAllocator; | 120 return &arrayBufferAllocator; |
| 121 } | 121 } |
| (...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 | 994 |
| 995 v8::Local<v8::Value> v8IteratorResult(v8::Isolate* isolate, v8::Handle<v8::Value
> value) | 995 v8::Local<v8::Value> v8IteratorResult(v8::Isolate* isolate, v8::Handle<v8::Value
> value) |
| 996 { | 996 { |
| 997 v8::Local<v8::Object> result = v8::Object::New(isolate); | 997 v8::Local<v8::Object> result = v8::Object::New(isolate); |
| 998 result->Set(v8String(isolate, "value"), value); | 998 result->Set(v8String(isolate, "value"), value); |
| 999 result->Set(v8String(isolate, "done"), v8Boolean(false, isolate)); | 999 result->Set(v8String(isolate, "done"), v8Boolean(false, isolate)); |
| 1000 return result; | 1000 return result; |
| 1001 } | 1001 } |
| 1002 | 1002 |
| 1003 } // namespace blink | 1003 } // namespace blink |
| OLD | NEW |