| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 #include "bindings/v8/V8Binding.h" | 34 #include "bindings/v8/V8Binding.h" |
| 35 #include "bindings/v8/V8Utilities.h" | 35 #include "bindings/v8/V8Utilities.h" |
| 36 #include "core/dom/ExceptionCode.h" | 36 #include "core/dom/ExceptionCode.h" |
| 37 #include <v8.h> | 37 #include <v8.h> |
| 38 | 38 |
| 39 namespace WebCore { | 39 namespace WebCore { |
| 40 | 40 |
| 41 class ScriptExecutionContext; | 41 class ScriptExecutionContext; |
| 42 | 42 |
| 43 bool invokeCallback(v8::Handle<v8::Object> callback, int argc, v8::Handle<v8::Va
lue> argv[], bool& callbackReturnValue, ScriptExecutionContext*); | 43 bool invokeCallback(v8::Handle<v8::Object> callback, int argc, v8::Handle<v8::Va
lue> argv[], bool& callbackReturnValue, ScriptExecutionContext*, v8::Isolate*); |
| 44 bool invokeCallback(v8::Handle<v8::Object> callback, v8::Handle<v8::Object> this
Object, int argc, v8::Handle<v8::Value> argv[], bool& callbackReturnValue, Scrip
tExecutionContext*); | 44 bool invokeCallback(v8::Handle<v8::Object> callback, v8::Handle<v8::Object> this
Object, int argc, v8::Handle<v8::Value> argv[], bool& callbackReturnValue, Scrip
tExecutionContext*, v8::Isolate*); |
| 45 | 45 |
| 46 enum CallbackAllowedValueFlag { | 46 enum CallbackAllowedValueFlag { |
| 47 CallbackAllowUndefined = 1, | 47 CallbackAllowUndefined = 1, |
| 48 CallbackAllowNull = 1 << 1 | 48 CallbackAllowNull = 1 << 1 |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 typedef unsigned CallbackAllowedValueFlags; | 51 typedef unsigned CallbackAllowedValueFlags; |
| 52 | 52 |
| 53 // 'FunctionOnly' is assumed for the created callback. | 53 // 'FunctionOnly' is assumed for the created callback. |
| 54 template <typename V8CallbackType> | 54 template <typename V8CallbackType> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 67 setDOMException(TypeMismatchError, isolate); | 67 setDOMException(TypeMismatchError, isolate); |
| 68 return 0; | 68 return 0; |
| 69 } | 69 } |
| 70 | 70 |
| 71 return V8CallbackType::create(value, getScriptExecutionContext()); | 71 return V8CallbackType::create(value, getScriptExecutionContext()); |
| 72 } | 72 } |
| 73 | 73 |
| 74 } // namespace WebCore | 74 } // namespace WebCore |
| 75 | 75 |
| 76 #endif // V8Callback_h | 76 #endif // V8Callback_h |
| OLD | NEW |