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

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

Issue 85263006: Make IDL Callbacks non-refcounted by default (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 7 years 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
« no previous file with comments | « Source/modules/webmidi/MIDIAccessPromise.h ('k') | Source/modules/webmidi/MIDIErrorCallback.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 m_state = Invoked; 92 m_state = Invoked;
93 m_errorCallback->handleEvent(error.get()); 93 m_errorCallback->handleEvent(error.get());
94 clear(); 94 clear();
95 } else { 95 } else {
96 m_state = Rejected; 96 m_state = Rejected;
97 m_error = error; 97 m_error = error;
98 } 98 }
99 } 99 }
100 } 100 }
101 101
102 void MIDIAccessPromise::then(PassRefPtr<MIDISuccessCallback> successCallback, Pa ssRefPtr<MIDIErrorCallback> errorCallback) 102 void MIDIAccessPromise::then(PassOwnPtr<MIDISuccessCallback> successCallback, Pa ssOwnPtr<MIDIErrorCallback> errorCallback)
103 { 103 {
104 // Lazily request access. 104 // Lazily request access.
105 if (!m_access) 105 if (!m_access)
106 m_access = MIDIAccess::create(executionContext(), this); 106 m_access = MIDIAccess::create(executionContext(), this);
107 107
108 switch (m_state) { 108 switch (m_state) {
109 case Accepted: 109 case Accepted:
110 m_state = Invoked; 110 m_state = Invoked;
111 successCallback->handleEvent(m_access.get(), m_options->sysex); 111 successCallback->handleEvent(m_access.get(), m_options->sysex);
112 clear(); 112 clear();
(...skipping 18 matching lines...) Expand all
131 { 131 {
132 ASSERT(m_state == Invoked); 132 ASSERT(m_state == Invoked);
133 m_access.clear(); 133 m_access.clear();
134 m_error.clear(); 134 m_error.clear();
135 m_options.clear(); 135 m_options.clear();
136 m_successCallback.clear(); 136 m_successCallback.clear();
137 m_errorCallback.clear(); 137 m_errorCallback.clear();
138 } 138 }
139 139
140 } // namespace WebCore 140 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/webmidi/MIDIAccessPromise.h ('k') | Source/modules/webmidi/MIDIErrorCallback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698