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

Side by Side Diff: Source/modules/webaudio/AudioContext.cpp

Issue 692213004: Use better error message for an HTMLMediaElement that has already been connected. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 | « LayoutTests/webaudio/mediaelementaudiosourcenode-expected.txt ('k') | no next file » | 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) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 exceptionState.throwDOMException( 257 exceptionState.throwDOMException(
258 InvalidStateError, 258 InvalidStateError,
259 "invalid HTMLMedialElement."); 259 "invalid HTMLMedialElement.");
260 return 0; 260 return 0;
261 } 261 }
262 262
263 // First check if this media element already has a source node. 263 // First check if this media element already has a source node.
264 if (mediaElement->audioSourceNode()) { 264 if (mediaElement->audioSourceNode()) {
265 exceptionState.throwDOMException( 265 exceptionState.throwDOMException(
266 InvalidStateError, 266 InvalidStateError,
267 "invalid HTMLMediaElement."); 267 "HTMLMediaElement already connected previously to a different MediaE lementSourceNode.");
268 return 0; 268 return 0;
269 } 269 }
270 270
271 MediaElementAudioSourceNode* node = MediaElementAudioSourceNode::create(this , mediaElement); 271 MediaElementAudioSourceNode* node = MediaElementAudioSourceNode::create(this , mediaElement);
272 272
273 mediaElement->setAudioSourceNode(node); 273 mediaElement->setAudioSourceNode(node);
274 274
275 refNode(node); // context keeps reference until node is disconnected 275 refNode(node); // context keeps reference until node is disconnected
276 return node; 276 return node;
277 } 277 }
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 865
866 for (HashSet<AudioNode*>::iterator k = m_deferredCountModeChange.begin(); k != m_deferredCountModeChange.end(); ++k) 866 for (HashSet<AudioNode*>::iterator k = m_deferredCountModeChange.begin(); k != m_deferredCountModeChange.end(); ++k)
867 (*k)->updateChannelCountMode(); 867 (*k)->updateChannelCountMode();
868 868
869 m_deferredCountModeChange.clear(); 869 m_deferredCountModeChange.clear();
870 } 870 }
871 871
872 } // namespace blink 872 } // namespace blink
873 873
874 #endif // ENABLE(WEB_AUDIO) 874 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « LayoutTests/webaudio/mediaelementaudiosourcenode-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698