| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 v8::Handle<v8::Value> throwError(v8::Handle<v8::Value> exception, v8::Isolate* i
solate) | 75 v8::Handle<v8::Value> throwError(v8::Handle<v8::Value> exception, v8::Isolate* i
solate) |
| 76 { | 76 { |
| 77 return V8ThrowException::throwError(exception, isolate); | 77 return V8ThrowException::throwError(exception, isolate); |
| 78 } | 78 } |
| 79 | 79 |
| 80 v8::Handle<v8::Value> throwTypeError(const String& message, v8::Isolate* isolate
) | 80 v8::Handle<v8::Value> throwTypeError(const String& message, v8::Isolate* isolate
) |
| 81 { | 81 { |
| 82 return V8ThrowException::throwTypeError(message, isolate); | 82 return V8ThrowException::throwTypeError(message, isolate); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void throwArityTypeErrorForMethod(const char* method, const char* type, unsigned
expected, unsigned providedLeastNumMandatoryParams, v8::Isolate* isolate) |
| 86 { |
| 87 throwTypeError(ExceptionMessages::failedToExecute(method, type, ExceptionMes
sages::notEnoughArguments(expected, providedLeastNumMandatoryParams)), isolate); |
| 88 } |
| 89 |
| 90 void throwArityTypeErrorForConstructor(const char* type, unsigned expected, unsi
gned providedLeastNumMandatoryParams, v8::Isolate* isolate) |
| 91 { |
| 92 throwTypeError(ExceptionMessages::failedToConstruct(type, ExceptionMessages:
:notEnoughArguments(expected, providedLeastNumMandatoryParams)), isolate); |
| 93 } |
| 94 |
| 95 void throwArityTypeError(ExceptionState& exceptionState, unsigned expected, unsi
gned providedLeastNumMandatoryParams) |
| 96 { |
| 97 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(expected
, providedLeastNumMandatoryParams)); |
| 98 exceptionState.throwIfNeeded(); |
| 99 } |
| 100 |
| 85 class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { | 101 class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { |
| 86 virtual void* Allocate(size_t size) OVERRIDE | 102 virtual void* Allocate(size_t size) OVERRIDE |
| 87 { | 103 { |
| 88 void* data; | 104 void* data; |
| 89 WTF::ArrayBufferContents::allocateMemory(size, WTF::ArrayBufferContents:
:ZeroInitialize, data); | 105 WTF::ArrayBufferContents::allocateMemory(size, WTF::ArrayBufferContents:
:ZeroInitialize, data); |
| 90 return data; | 106 return data; |
| 91 } | 107 } |
| 92 | 108 |
| 93 virtual void* AllocateUninitialized(size_t size) OVERRIDE | 109 virtual void* AllocateUninitialized(size_t size) OVERRIDE |
| 94 { | 110 { |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 V8ExecutionScope::V8ExecutionScope(v8::Isolate* isolate) | 673 V8ExecutionScope::V8ExecutionScope(v8::Isolate* isolate) |
| 658 : m_handleScope(isolate) | 674 : m_handleScope(isolate) |
| 659 , m_context(v8::Context::New(isolate)) | 675 , m_context(v8::Context::New(isolate)) |
| 660 , m_contextScope(m_context) | 676 , m_contextScope(m_context) |
| 661 , m_world(DOMWrapperWorld::create()) | 677 , m_world(DOMWrapperWorld::create()) |
| 662 , m_perContextData(V8PerContextData::create(m_context, m_world)) | 678 , m_perContextData(V8PerContextData::create(m_context, m_world)) |
| 663 { | 679 { |
| 664 } | 680 } |
| 665 | 681 |
| 666 } // namespace WebCore | 682 } // namespace WebCore |
| OLD | NEW |