Chromium Code Reviews| Index: Source/modules/webmidi/MIDIErrorCallback.cpp |
| diff --git a/Source/core/dom/StringCallback.cpp b/Source/modules/webmidi/MIDIErrorCallback.cpp |
| similarity index 71% |
| copy from Source/core/dom/StringCallback.cpp |
| copy to Source/modules/webmidi/MIDIErrorCallback.cpp |
| index c6285b1715bc672f5c9d88b1e964d15101012acf..eb38d0820377fc895801cd4743d47df705b3e1de 100644 |
| --- a/Source/core/dom/StringCallback.cpp |
| +++ b/Source/modules/webmidi/MIDIErrorCallback.cpp |
| @@ -1,5 +1,5 @@ |
| /* |
| - * Copyright (C) 2010 Google Inc. All rights reserved. |
| + * Copyright (C) 2013 Google Inc. All rights reserved. |
| * |
| * Redistribution and use in source and binary forms, with or without |
| * modification, are permitted provided that the following conditions are |
| @@ -29,10 +29,11 @@ |
| */ |
| #include "config.h" |
| -#include "StringCallback.h" |
| +#include "MIDIErrorCallback.h" |
|
tkent
2013/04/24 02:08:43
Please specify "modules/webmidi/MIDIErrorCallback.
Takashi Toyoshima
2013/04/24 02:23:12
Done.
|
| + |
| +#include "DOMError.h" |
|
tkent
2013/04/24 02:08:43
Ditto. Use path relative to WebKit/Source/.
Takashi Toyoshima
2013/04/24 02:23:12
Done.
|
| #include "ScriptExecutionContext.h" |
| -#include <wtf/text/WTFString.h> |
| namespace WebCore { |
| @@ -40,32 +41,32 @@ namespace { |
| class DispatchCallbackTask : public ScriptExecutionContext::Task { |
| public: |
| - static PassOwnPtr<DispatchCallbackTask> create(PassRefPtr<StringCallback> callback, const String& data) |
| + static PassOwnPtr<DispatchCallbackTask> create(PassRefPtr<MIDIErrorCallback> callback, PassRefPtr<DOMError> error) |
| { |
| - return adoptPtr(new DispatchCallbackTask(callback, data)); |
| + return adoptPtr(new DispatchCallbackTask(callback, error)); |
| } |
| virtual void performTask(ScriptExecutionContext*) |
| { |
| - m_callback->handleEvent(m_data); |
| + m_callback->handleEvent(m_error.get()); |
| } |
| private: |
| - DispatchCallbackTask(PassRefPtr<StringCallback> callback, const String& data) |
| - : m_callback(callback) |
| - , m_data(data) |
| + DispatchCallbackTask(PassRefPtr<MIDIErrorCallback> callback, PassRefPtr<DOMError> error) |
| + : m_callback(callback) |
| + , m_error(error) |
| { |
| } |
| - RefPtr<StringCallback> m_callback; |
| - const String m_data; |
| + RefPtr<MIDIErrorCallback> m_callback; |
| + RefPtr<DOMError> m_error; |
| }; |
| } // namespace |
| -void StringCallback::scheduleCallback(ScriptExecutionContext* context, const String& data) |
| +void MIDIErrorCallback::scheduleCallback(ScriptExecutionContext* context, PassRefPtr<DOMError> error) |
| { |
| - context->postTask(DispatchCallbackTask::create(this, data)); |
| + context->postTask(DispatchCallbackTask::create(this, error)); |
| } |
| } // namespace WebCore |