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

Side by Side Diff: Source/modules/webmidi/MIDIAccessPromise.h

Issue 17619003: Fulfill or reject MIDIAccessPromise from MIDIAccessor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 30 matching lines...) Expand all
41 namespace WebCore { 41 namespace WebCore {
42 42
43 class DOMError; 43 class DOMError;
44 class MIDIAccess; 44 class MIDIAccess;
45 class MIDIErrorCallback; 45 class MIDIErrorCallback;
46 class MIDISuccessCallback; 46 class MIDISuccessCallback;
47 class ScriptExecutionContext; 47 class ScriptExecutionContext;
48 48
49 struct MIDIOptions; 49 struct MIDIOptions;
50 50
51 class MIDIAccessPromise : public RefCounted<MIDIAccessPromise>, public ScriptWra ppable, public ActiveDOMObject { 51 class MIDIAccessPromise : public RefCounted<MIDIAccessPromise>, public ScriptWra ppable, public ActiveDOMObject {
abarth-chromium 2013/06/24 20:50:43 What is a MIDIAccessPromise? We haven't implement
Chris Rogers 2013/06/24 21:00:32 Takashi has implemented the part of promises that
Takashi Toyoshima 2013/06/25 07:48:58 Yes, we have a comment on that at MIDIAccessPromis
52 public: 52 public:
53 static PassRefPtr<MIDIAccessPromise> create(ScriptExecutionContext*, const D ictionary&); 53 static PassRefPtr<MIDIAccessPromise> create(ScriptExecutionContext*, const D ictionary&);
54 virtual ~MIDIAccessPromise(); 54 virtual ~MIDIAccessPromise();
55 55
56 void then(PassRefPtr<MIDISuccessCallback>, PassRefPtr<MIDIErrorCallback>); 56 void then(PassRefPtr<MIDISuccessCallback>, PassRefPtr<MIDIErrorCallback>);
57 57
58 // ActiveDOMObject 58 // ActiveDOMObject
59 virtual bool canSuspend() const OVERRIDE { return true; } 59 virtual bool canSuspend() const OVERRIDE { return true; }
60 60
61 MIDIOptions* options() { return m_options.get(); }
62
61 void fulfill(); 63 void fulfill();
62 void reject(DOMError*); 64 void reject(PassRefPtr<DOMError>);
63 65
64 private: 66 private:
65 enum State { 67 enum State {
66 Pending, 68 Pending,
67 Accepted, 69 Accepted,
68 Rejected, 70 Rejected,
69 Invoked, 71 Invoked,
70 }; 72 };
71 73
72 MIDIAccessPromise(ScriptExecutionContext*, const Dictionary&); 74 MIDIAccessPromise(ScriptExecutionContext*, const Dictionary&);
73 75
74 State m_state; 76 State m_state;
75 RefPtr<MIDISuccessCallback> m_successCallback; 77 RefPtr<MIDISuccessCallback> m_successCallback;
76 RefPtr<MIDIErrorCallback> m_errorCallback; 78 RefPtr<MIDIErrorCallback> m_errorCallback;
77 OwnPtr<MIDIOptions> m_options; 79 OwnPtr<MIDIOptions> m_options;
78 RefPtr<DOMError> m_error; 80 RefPtr<DOMError> m_error;
79 RefPtr<MIDIAccess> m_access; 81 RefPtr<MIDIAccess> m_access;
80 }; 82 };
81 83
82 } // namespace WebCore 84 } // namespace WebCore
83 85
84 #endif // MIDIAccessPromise_h 86 #endif // MIDIAccessPromise_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698