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

Side by Side Diff: Source/bindings/core/v8/V8Binding.h

Issue 1269443002: Introduce FlexibleArrayBufferView and TypedFlexibleArrayBufferView (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Ericsson AB. All rights reserved. 3 * Copyright (C) 2012 Ericsson AB. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 class EventListener; 56 class EventListener;
57 class EventTarget; 57 class EventTarget;
58 class ExceptionState; 58 class ExceptionState;
59 class ExecutionContext; 59 class ExecutionContext;
60 class Frame; 60 class Frame;
61 class LocalDOMWindow; 61 class LocalDOMWindow;
62 class LocalFrame; 62 class LocalFrame;
63 class NodeFilter; 63 class NodeFilter;
64 class WorkerGlobalScope; 64 class WorkerGlobalScope;
65 class XPathNSResolver; 65 class XPathNSResolver;
66 class FlexibleArrayBufferView;
haraken 2015/07/30 14:54:57 Alphabetical order.
Michael Lippautz 2015/07/30 17:06:14 Done.
66 67
67 template <typename T> 68 template <typename T>
68 struct V8TypeOf { 69 struct V8TypeOf {
69 // |Type| provides C++ -> V8 type conversion for DOM wrappers. 70 // |Type| provides C++ -> V8 type conversion for DOM wrappers.
70 // The Blink binding code generator will generate specialized version of 71 // The Blink binding code generator will generate specialized version of
71 // V8TypeOf for each wrapper class. 72 // V8TypeOf for each wrapper class.
72 typedef void Type; 73 typedef void Type;
73 }; 74 };
74 75
75 namespace TraceEvent { 76 namespace TraceEvent {
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 CORE_EXPORT v8::Local<v8::Context> toV8Context(Frame*, DOMWrapperWorld&); 967 CORE_EXPORT v8::Local<v8::Context> toV8Context(Frame*, DOMWrapperWorld&);
967 // Like toV8Context but also returns the context if the frame is already detache d. 968 // Like toV8Context but also returns the context if the frame is already detache d.
968 CORE_EXPORT v8::Local<v8::Context> toV8ContextEvenIfDetached(Frame*, DOMWrapperW orld&); 969 CORE_EXPORT v8::Local<v8::Context> toV8ContextEvenIfDetached(Frame*, DOMWrapperW orld&);
969 970
970 // Returns the frame object of the window object associated with 971 // Returns the frame object of the window object associated with
971 // a context, if the window is currently being displayed in a Frame. 972 // a context, if the window is currently being displayed in a Frame.
972 CORE_EXPORT Frame* toFrameIfNotDetached(v8::Local<v8::Context>); 973 CORE_EXPORT Frame* toFrameIfNotDetached(v8::Local<v8::Context>);
973 974
974 CORE_EXPORT EventTarget* toEventTarget(v8::Isolate*, v8::Local<v8::Value>); 975 CORE_EXPORT EventTarget* toEventTarget(v8::Isolate*, v8::Local<v8::Value>);
975 976
977 // If 'storage' is non-null, it must be large enough to copy all bytes in the
978 // array buffer view into it.
979 // Use SMALL_ARRAY_BUFFER_VIEW_STORAGE(v8Value) to allocate it using alloca() in
980 // the callers stack frame.
981 CORE_EXPORT void toFlexibleArrayBufferView(v8::Isolate*, v8::Handle<v8::Value>, FlexibleArrayBufferView&, void* storage = nullptr);
982
976 // If the current context causes out of memory, JavaScript setting 983 // If the current context causes out of memory, JavaScript setting
977 // is disabled and it returns true. 984 // is disabled and it returns true.
978 bool handleOutOfMemory(); 985 bool handleOutOfMemory();
979 void crashIfV8IsDead(); 986 void crashIfV8IsDead();
980 987
981 inline bool isUndefinedOrNull(v8::Local<v8::Value> value) 988 inline bool isUndefinedOrNull(v8::Local<v8::Value> value)
982 { 989 {
983 return value.IsEmpty() || value->IsNull() || value->IsUndefined(); 990 return value.IsEmpty() || value->IsNull() || value->IsUndefined();
984 } 991 }
985 v8::Local<v8::Function> getBoundFunction(v8::Local<v8::Function>); 992 v8::Local<v8::Function> getBoundFunction(v8::Local<v8::Function>);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol ate*, ExecutionContext*, v8::Local<v8::Function>); 1082 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol ate*, ExecutionContext*, v8::Local<v8::Function>);
1076 1083
1077 // Callback functions used by generated code. 1084 // Callback functions used by generated code.
1078 CORE_EXPORT void v8ConstructorAttributeGetter(v8::Local<v8::Name> propertyName, const v8::PropertyCallbackInfo<v8::Value>&); 1085 CORE_EXPORT void v8ConstructorAttributeGetter(v8::Local<v8::Name> propertyName, const v8::PropertyCallbackInfo<v8::Value>&);
1079 1086
1080 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso late*); 1087 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso late*);
1081 1088
1082 } // namespace blink 1089 } // namespace blink
1083 1090
1084 #endif // V8Binding_h 1091 #endif // V8Binding_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698