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

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

Issue 18548003: Rename ExceptionCode constants to use the names in the spec (2/3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, 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 27 matching lines...) Expand all
38 { 38 {
39 // FIXME: add support for workers. 39 // FIXME: add support for workers.
40 if (!context || !context->isDocument()) { 40 if (!context || !context->isDocument()) {
41 ec = NotSupportedError; 41 ec = NotSupportedError;
42 return 0; 42 return 0;
43 } 43 }
44 44
45 Document* document = toDocument(context); 45 Document* document = toDocument(context);
46 46
47 if (numberOfChannels > 10 || !isSampleRateRangeGood(sampleRate)) { 47 if (numberOfChannels > 10 || !isSampleRateRangeGood(sampleRate)) {
48 ec = SYNTAX_ERR; 48 ec = SyntaxError;
49 return 0; 49 return 0;
50 } 50 }
51 51
52 RefPtr<OfflineAudioContext> audioContext(adoptRef(new OfflineAudioContext(do cument, numberOfChannels, numberOfFrames, sampleRate))); 52 RefPtr<OfflineAudioContext> audioContext(adoptRef(new OfflineAudioContext(do cument, numberOfChannels, numberOfFrames, sampleRate)));
53 audioContext->suspendIfNeeded(); 53 audioContext->suspendIfNeeded();
54 return audioContext.release(); 54 return audioContext.release();
55 } 55 }
56 56
57 OfflineAudioContext::OfflineAudioContext(Document* document, unsigned numberOfCh annels, size_t numberOfFrames, float sampleRate) 57 OfflineAudioContext::OfflineAudioContext(Document* document, unsigned numberOfCh annels, size_t numberOfFrames, float sampleRate)
58 : AudioContext(document, numberOfChannels, numberOfFrames, sampleRate) 58 : AudioContext(document, numberOfChannels, numberOfFrames, sampleRate)
59 { 59 {
60 ScriptWrappable::init(this); 60 ScriptWrappable::init(this);
61 } 61 }
62 62
63 OfflineAudioContext::~OfflineAudioContext() 63 OfflineAudioContext::~OfflineAudioContext()
64 { 64 {
65 } 65 }
66 66
67 } // namespace WebCore 67 } // namespace WebCore
68 68
69 #endif // ENABLE(WEB_AUDIO) 69 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/DefaultAudioDestinationNode.cpp ('k') | Source/modules/webaudio/WaveShaperNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698