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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 } | 103 } |
104 | 104 |
105 class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { | 105 class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { |
106 virtual void* Allocate(size_t size) OVERRIDE | 106 virtual void* Allocate(size_t size) OVERRIDE |
107 { | 107 { |
108 void* data; | 108 void* data; |
109 WTF::ArrayBufferContents::allocateMemory(size, WTF::ArrayBufferContents:
:ZeroInitialize, data); | 109 WTF::ArrayBufferContents::allocateMemory(size, WTF::ArrayBufferContents:
:ZeroInitialize, data); |
110 return data; | 110 return data; |
111 } | 111 } |
112 | 112 |
| 113 virtual void* AllocateUninitialized(size_t size) OVERRIDE |
| 114 { |
| 115 void* data; |
| 116 WTF::ArrayBufferContents::allocateMemory(size, WTF::ArrayBufferContents:
:DontInitialize, data); |
| 117 return data; |
| 118 } |
| 119 |
113 virtual void Free(void* data) | 120 virtual void Free(void* data) |
114 { | 121 { |
115 WTF::ArrayBufferContents::freeMemory(data); | 122 WTF::ArrayBufferContents::freeMemory(data); |
116 } | 123 } |
117 | 124 |
118 virtual void Free(void* data, size_t size) | 125 virtual void Free(void* data, size_t size) |
119 { | 126 { |
120 UNUSED_PARAM(size); | 127 UNUSED_PARAM(size); |
121 WTF::ArrayBufferContents::freeMemory(data); | 128 WTF::ArrayBufferContents::freeMemory(data); |
122 } | 129 } |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 return DOMWrapperWorld::isolatedWorld(v8::Context::GetCurrent()); | 573 return DOMWrapperWorld::isolatedWorld(v8::Context::GetCurrent()); |
567 } | 574 } |
568 | 575 |
569 v8::Local<v8::Value> getHiddenValueFromMainWorldWrapper(v8::Isolate* isolate, Sc
riptWrappable* wrappable, v8::Handle<v8::String> key) | 576 v8::Local<v8::Value> getHiddenValueFromMainWorldWrapper(v8::Isolate* isolate, Sc
riptWrappable* wrappable, v8::Handle<v8::String> key) |
570 { | 577 { |
571 v8::Local<v8::Object> wrapper = wrappable->newLocalWrapper(isolate); | 578 v8::Local<v8::Object> wrapper = wrappable->newLocalWrapper(isolate); |
572 return wrapper.IsEmpty() ? v8::Local<v8::Value>() : wrapper->GetHiddenValue(
key); | 579 return wrapper.IsEmpty() ? v8::Local<v8::Value>() : wrapper->GetHiddenValue(
key); |
573 } | 580 } |
574 | 581 |
575 } // namespace WebCore | 582 } // namespace WebCore |
OLD | NEW |