Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1772)

Unified Diff: Source/modules/webmidi/MIDIErrorCallback.cpp

Issue 14423002: Web MIDI: implement MIDIErrorCallback (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/modules/webmidi/MIDIErrorCallback.cpp
diff --git a/Source/core/dom/StringCallback.cpp b/Source/modules/webmidi/MIDIErrorCallback.cpp
similarity index 76%
copy from Source/core/dom/StringCallback.cpp
copy to Source/modules/webmidi/MIDIErrorCallback.cpp
index c6285b1715bc672f5c9d88b1e964d15101012acf..a66a80011bfa84585a88f401563d2689587bd56f 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"
+
+#include "DOMError.h"
#include "ScriptExecutionContext.h"
-#include <wtf/text/WTFString.h>
namespace WebCore {
@@ -40,30 +41,30 @@ 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> data)
Chris Rogers 2013/04/23 20:35:23 "data" should be named "error"
Takashi Toyoshima 2013/04/24 01:31:51 Done.
{
return adoptPtr(new DispatchCallbackTask(callback, data));
}
virtual void performTask(ScriptExecutionContext*)
{
- m_callback->handleEvent(m_data);
+ m_callback->handleEvent(m_data.get());
}
private:
- DispatchCallbackTask(PassRefPtr<StringCallback> callback, const String& data)
- : m_callback(callback)
- , m_data(data)
+ DispatchCallbackTask(PassRefPtr<MIDIErrorCallback> callback, PassRefPtr<DOMError> data)
+ : m_callback(callback)
+ , m_data(data)
{
}
- RefPtr<StringCallback> m_callback;
- const String m_data;
+ RefPtr<MIDIErrorCallback> m_callback;
+ RefPtr<DOMError> m_data;
Chris Rogers 2013/04/23 20:35:23 should be named "m_error"
Takashi Toyoshima 2013/04/24 01:31:51 Done.
};
} // namespace
-void StringCallback::scheduleCallback(ScriptExecutionContext* context, const String& data)
+void MIDIErrorCallback::scheduleCallback(ScriptExecutionContext* context, PassRefPtr<DOMError> data)
Chris Rogers 2013/04/23 20:35:23 "data" should be named "error"
Takashi Toyoshima 2013/04/24 01:31:51 Done.
{
context->postTask(DispatchCallbackTask::create(this, data));
}

Powered by Google App Engine
This is Rietveld 408576698