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

Side by Side Diff: public/web/WebBindings.h

Issue 449683002: Blink API to convert v8::Object to WebNode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/WebBindings.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 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 19 matching lines...) Expand all
30 30
31 #ifndef WebBindings_h 31 #ifndef WebBindings_h
32 #define WebBindings_h 32 #define WebBindings_h
33 33
34 #include "../platform/WebCommon.h" 34 #include "../platform/WebCommon.h"
35 #include "../platform/WebString.h" 35 #include "../platform/WebString.h"
36 #include "../platform/WebVector.h" 36 #include "../platform/WebVector.h"
37 #include <bindings/npruntime.h> 37 #include <bindings/npruntime.h>
38 38
39 namespace v8 { 39 namespace v8 {
40 class Object;
40 class Value; 41 class Value;
41 template <class T> class Handle; 42 template <class T> class Handle;
42 template <class T> class Local; 43 template <class T> class Local;
43 } 44 }
44 45
45 namespace blink { 46 namespace blink {
46 47
47 class WebArrayBuffer; 48 class WebArrayBuffer;
48 class WebArrayBufferView; 49 class WebArrayBufferView;
49 class WebDragData; 50 class WebDragData;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 BLINK_EXPORT static bool getArrayBuffer(NPObject* arrayBuffer, WebArrayBuffe r*); 162 BLINK_EXPORT static bool getArrayBuffer(NPObject* arrayBuffer, WebArrayBuffe r*);
162 163
163 // Return true (success) if the given npobj is an ArrayBufferView object. 164 // Return true (success) if the given npobj is an ArrayBufferView object.
164 // If so, return it as a WebArrayBufferView object. 165 // If so, return it as a WebArrayBufferView object.
165 BLINK_EXPORT static bool getArrayBufferView(NPObject* arrayBufferView, WebAr rayBufferView*); 166 BLINK_EXPORT static bool getArrayBufferView(NPObject* arrayBufferView, WebAr rayBufferView*);
166 167
167 // Return true (success) if the given npobj is a node. 168 // Return true (success) if the given npobj is a node.
168 // If so, return that node as a WebNode object. 169 // If so, return that node as a WebNode object.
169 BLINK_EXPORT static bool getNode(NPObject* element, WebNode*); 170 BLINK_EXPORT static bool getNode(NPObject* element, WebNode*);
170 171
172 BLINK_EXPORT static bool getNodeFromV8Object(v8::Handle<v8::Object>, WebNode *);
173
171 // Return true (success) if the given npobj is an element. 174 // Return true (success) if the given npobj is an element.
172 // If so, return that element as a WebElement object. 175 // If so, return that element as a WebElement object.
173 BLINK_EXPORT static bool getElement(NPObject* element, WebElement*); 176 BLINK_EXPORT static bool getElement(NPObject* element, WebElement*);
174 177
175 BLINK_EXPORT static NPObject* makeIntArray(const WebVector<int>&); 178 BLINK_EXPORT static NPObject* makeIntArray(const WebVector<int>&);
176 BLINK_EXPORT static NPObject* makeStringArray(const WebVector<WebString>&); 179 BLINK_EXPORT static NPObject* makeStringArray(const WebVector<WebString>&);
177 180
178 // Exceptions ------------------------------------------------------------- 181 // Exceptions -------------------------------------------------------------
179 182
180 typedef void (ExceptionHandler)(void* data, const NPUTF8* message); 183 typedef void (ExceptionHandler)(void* data, const NPUTF8* message);
181 184
182 // The exception handler will be notified of any exceptions thrown while 185 // The exception handler will be notified of any exceptions thrown while
183 // operating on a NPObject. 186 // operating on a NPObject.
184 BLINK_EXPORT static void pushExceptionHandler(ExceptionHandler, void* data); 187 BLINK_EXPORT static void pushExceptionHandler(ExceptionHandler, void* data);
185 BLINK_EXPORT static void popExceptionHandler(); 188 BLINK_EXPORT static void popExceptionHandler();
186 189
187 // Conversion utilities to/from V8 native objects and NPVariant wrappers. 190 // Conversion utilities to/from V8 native objects and NPVariant wrappers.
188 BLINK_EXPORT static void toNPVariant(v8::Local<v8::Value>, NPObject* root, N PVariant* result); 191 BLINK_EXPORT static void toNPVariant(v8::Local<v8::Value>, NPObject* root, N PVariant* result);
189 BLINK_EXPORT static v8::Handle<v8::Value> toV8Value(const NPVariant*); 192 BLINK_EXPORT static v8::Handle<v8::Value> toV8Value(const NPVariant*);
190 }; 193 };
191 194
192 } // namespace blink 195 } // namespace blink
193 196
194 #endif 197 #endif
OLDNEW
« no previous file with comments | « Source/web/WebBindings.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698