| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 26 matching lines...) Expand all Loading... |
| 37 #include "bindings/v8/ActiveDOMCallback.h" | 37 #include "bindings/v8/ActiveDOMCallback.h" |
| 38 #include "bindings/v8/DOMWrapperWorld.h" | 38 #include "bindings/v8/DOMWrapperWorld.h" |
| 39 #include "bindings/v8/ScopedPersistent.h" | 39 #include "bindings/v8/ScopedPersistent.h" |
| 40 | 40 |
| 41 namespace WebCore { | 41 namespace WebCore { |
| 42 | 42 |
| 43 class ExecutionContext; | 43 class ExecutionContext; |
| 44 | 44 |
| 45 class V8TestCallback : public TestCallback, public ActiveDOMCallback { | 45 class V8TestCallback : public TestCallback, public ActiveDOMCallback { |
| 46 public: | 46 public: |
| 47 static PassRefPtr<V8TestCallback> create(v8::Handle<v8::Value> jsValue, Exec
utionContext* context) | 47 static PassOwnPtr<V8TestCallback> create(v8::Handle<v8::Value> jsValue, Exec
utionContext* context) |
| 48 { | 48 { |
| 49 ASSERT(jsValue->IsObject()); | 49 ASSERT(jsValue->IsObject()); |
| 50 ASSERT(context); | 50 ASSERT(context); |
| 51 return adoptRef(new V8TestCallback(v8::Handle<v8::Object>::Cast(jsValue)
, context)); | 51 return adoptPtr(new V8TestCallback(v8::Handle<v8::Object>::Cast(jsValue)
, context)); |
| 52 } | 52 } |
| 53 | 53 |
| 54 virtual ~V8TestCallback(); | 54 virtual ~V8TestCallback(); |
| 55 | 55 |
| 56 virtual bool callbackWithNoArg(); | 56 virtual bool callbackWithNoArg(); |
| 57 virtual bool callbackWithTestInterfaceEmptyArg(TestInterfaceEmpty* class1Arg
); | 57 virtual bool callbackWithTestInterfaceEmptyArg(TestInterfaceEmpty* class1Arg
); |
| 58 virtual bool callbackWithTestInterfaceEmptyArg(TestInterfaceEmpty* class2Arg
, const String& strArg); | 58 virtual bool callbackWithTestInterfaceEmptyArg(TestInterfaceEmpty* class2Arg
, const String& strArg); |
| 59 virtual bool customCallback(TestInterfaceEmpty* testInterfaceEmptyArg, TestI
nterfaceEmpty* testInterfaceEmptyArg); | 59 virtual bool customCallback(TestInterfaceEmpty* testInterfaceEmptyArg, TestI
nterfaceEmpty* testInterfaceEmptyArg); |
| 60 virtual bool callbackWithBooleanArg(bool boolArg); | 60 virtual bool callbackWithBooleanArg(bool boolArg); |
| 61 virtual bool callbackWithSequenceArg(const Vector<RefPtr<TestInterfaceEmpty>
>& sequenceArg); | 61 virtual bool callbackWithSequenceArg(const Vector<RefPtr<TestInterfaceEmpty>
>& sequenceArg); |
| 62 virtual bool callbackWithFloatArg(float floatArg); | 62 virtual bool callbackWithFloatArg(float floatArg); |
| 63 virtual bool callbackWithThisArg(ScriptValue thisValue, int arg); | 63 virtual bool callbackWithThisArg(ScriptValue thisValue, int arg); |
| 64 | 64 |
| 65 virtual ExecutionContext* executionContext() const { return ContextLifecycle
Observer::executionContext(); } | 65 virtual ExecutionContext* executionContext() const { return ContextLifecycle
Observer::executionContext(); } |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 V8TestCallback(v8::Handle<v8::Object>, ExecutionContext*); | 68 V8TestCallback(v8::Handle<v8::Object>, ExecutionContext*); |
| 69 | 69 |
| 70 ScopedPersistent<v8::Object> m_callback; | 70 ScopedPersistent<v8::Object> m_callback; |
| 71 RefPtr<DOMWrapperWorld> m_world; | 71 RefPtr<DOMWrapperWorld> m_world; |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 } | 74 } |
| 75 #endif // V8TestCallback_h | 75 #endif // V8TestCallback_h |
| OLD | NEW |