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

Side by Side Diff: src/api.cc

Issue 23514050: Clean-up v8::ArrayBuffer::Allocator interface (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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
« no previous file with comments | « include/v8.h ('k') | test/cctest/cctest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2970 matching lines...) Expand 10 before | Expand all | Expand 10 after
2981 2981
2982 void v8::ArrayBuffer::CheckCast(Value* that) { 2982 void v8::ArrayBuffer::CheckCast(Value* that) {
2983 if (IsDeadCheck(i::Isolate::Current(), "v8::ArrayBuffer::Cast()")) return; 2983 if (IsDeadCheck(i::Isolate::Current(), "v8::ArrayBuffer::Cast()")) return;
2984 i::Handle<i::Object> obj = Utils::OpenHandle(that); 2984 i::Handle<i::Object> obj = Utils::OpenHandle(that);
2985 ApiCheck(obj->IsJSArrayBuffer(), 2985 ApiCheck(obj->IsJSArrayBuffer(),
2986 "v8::ArrayBuffer::Cast()", 2986 "v8::ArrayBuffer::Cast()",
2987 "Could not convert to ArrayBuffer"); 2987 "Could not convert to ArrayBuffer");
2988 } 2988 }
2989 2989
2990 2990
2991 void v8::ArrayBuffer::Allocator::Free(void* data) {
2992 API_Fatal("v8::ArrayBuffer::Allocator::Free",
2993 "Override Allocator::Free(void*, size_t)");
2994 }
2995
2996
2997 void v8::ArrayBufferView::CheckCast(Value* that) { 2991 void v8::ArrayBufferView::CheckCast(Value* that) {
2998 i::Handle<i::Object> obj = Utils::OpenHandle(that); 2992 i::Handle<i::Object> obj = Utils::OpenHandle(that);
2999 ApiCheck(obj->IsJSArrayBufferView(), 2993 ApiCheck(obj->IsJSArrayBufferView(),
3000 "v8::ArrayBufferView::Cast()", 2994 "v8::ArrayBufferView::Cast()",
3001 "Could not convert to ArrayBufferView"); 2995 "Could not convert to ArrayBufferView");
3002 } 2996 }
3003 2997
3004 2998
3005 void v8::TypedArray::CheckCast(Value* that) { 2999 void v8::TypedArray::CheckCast(Value* that) {
3006 if (IsDeadCheck(i::Isolate::Current(), "v8::TypedArray::Cast()")) return; 3000 if (IsDeadCheck(i::Isolate::Current(), "v8::TypedArray::Cast()")) return;
(...skipping 4886 matching lines...) Expand 10 before | Expand all | Expand 10 after
7893 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7887 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7894 Address callback_address = 7888 Address callback_address =
7895 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7889 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7896 VMState<EXTERNAL> state(isolate); 7890 VMState<EXTERNAL> state(isolate);
7897 ExternalCallbackScope call_scope(isolate, callback_address); 7891 ExternalCallbackScope call_scope(isolate, callback_address);
7898 callback(info); 7892 callback(info);
7899 } 7893 }
7900 7894
7901 7895
7902 } } // namespace v8::internal 7896 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | test/cctest/cctest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698