| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // }; | 52 // }; |
| 53 class CORE_EXPORT ScriptFunction | 53 class CORE_EXPORT ScriptFunction |
| 54 : public GarbageCollectedFinalized<ScriptFunction> { | 54 : public GarbageCollectedFinalized<ScriptFunction> { |
| 55 public: | 55 public: |
| 56 virtual ~ScriptFunction() {} | 56 virtual ~ScriptFunction() {} |
| 57 DEFINE_INLINE_VIRTUAL_TRACE() {} | 57 DEFINE_INLINE_VIRTUAL_TRACE() {} |
| 58 | 58 |
| 59 protected: | 59 protected: |
| 60 explicit ScriptFunction(ScriptState* scriptState) | 60 explicit ScriptFunction(ScriptState* scriptState) |
| 61 : m_scriptState(scriptState) | 61 : m_scriptState(scriptState) |
| 62 #if ENABLE(ASSERT) | |
| 63 , | |
| 64 m_bindToV8FunctionAlreadyCalled(false) | |
| 65 #endif | |
| 66 { | 62 { |
| 67 } | 63 } |
| 68 | 64 |
| 69 ScriptState* getScriptState() const { return m_scriptState.get(); } | 65 ScriptState* getScriptState() const { return m_scriptState.get(); } |
| 70 | 66 |
| 71 v8::Local<v8::Function> bindToV8Function(); | 67 v8::Local<v8::Function> bindToV8Function(); |
| 72 | 68 |
| 73 private: | 69 private: |
| 74 virtual ScriptValue call(ScriptValue) = 0; | 70 virtual ScriptValue call(ScriptValue) = 0; |
| 75 static void callCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 71 static void callCallback(const v8::FunctionCallbackInfo<v8::Value>&); |
| 76 | 72 |
| 77 RefPtr<ScriptState> m_scriptState; | 73 RefPtr<ScriptState> m_scriptState; |
| 78 #if ENABLE(ASSERT) | 74 #if DCHECK_IS_ON() |
| 79 // bindToV8Function must not be called twice. | 75 // bindToV8Function must not be called twice. |
| 80 bool m_bindToV8FunctionAlreadyCalled; | 76 bool m_bindToV8FunctionAlreadyCalled = false; |
| 81 #endif | 77 #endif |
| 82 }; | 78 }; |
| 83 | 79 |
| 84 } // namespace blink | 80 } // namespace blink |
| 85 | 81 |
| 86 #endif | 82 #endif |
| OLD | NEW |