OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MessageCallback_h | 5 #ifndef MessageCallback_h |
6 #define MessageCallback_h | 6 #define MessageCallback_h |
7 | 7 |
8 #include "platform/heap/Handle.h" | 8 #include "platform/heap/Handle.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 class NFCMessage; | 12 class NFCMessage; |
| 13 class ScriptState; |
13 | 14 |
14 class MessageCallback : public GarbageCollectedFinalized<MessageCallback> { | 15 class MessageCallback : public GarbageCollectedFinalized<MessageCallback> { |
15 public: | 16 public: |
16 virtual ~MessageCallback() {} | 17 virtual ~MessageCallback() {} |
17 DEFINE_INLINE_VIRTUAL_TRACE() {} | 18 DEFINE_INLINE_VIRTUAL_TRACE() {} |
18 virtual void handleMessage(const NFCMessage&) = 0; | 19 virtual void handleMessage(const NFCMessage&) = 0; |
| 20 |
| 21 void setScriptState(ScriptState* scriptState) { m_scriptState = scriptState; } |
| 22 ScriptState* getScriptState() const { return m_scriptState.get(); } |
| 23 |
| 24 private: |
| 25 RefPtr<ScriptState> m_scriptState; |
19 }; | 26 }; |
20 | 27 |
21 } // namespace blink | 28 } // namespace blink |
22 | 29 |
23 #endif // MessageCallback_h | 30 #endif // MessageCallback_h |
OLD | NEW |