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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/PannerNode.cpp

Issue 1952793002: Move the exception logic to the AudioNode creator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move more things to Node::create() Created 4 years, 7 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
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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 // Do nothing for other invalid values. 487 // Do nothing for other invalid values.
488 m_newChannelCountMode = oldMode; 488 m_newChannelCountMode = oldMode;
489 } 489 }
490 490
491 if (m_newChannelCountMode != oldMode) 491 if (m_newChannelCountMode != oldMode)
492 context()->deferredTaskHandler().addChangedChannelCountMode(this); 492 context()->deferredTaskHandler().addChangedChannelCountMode(this);
493 } 493 }
494 494
495 // ---------------------------------------------------------------- 495 // ----------------------------------------------------------------
496 496
497 PannerNode::PannerNode(AbstractAudioContext& context, float sampelRate) 497 PannerNode::PannerNode(AbstractAudioContext& context)
498 : AudioNode(context) 498 : AudioNode(context)
499 { 499 {
500 setHandler(PannerHandler::create(*this, sampelRate)); 500 setHandler(PannerHandler::create(*this, context.sampleRate()));
501 } 501 }
502 502
503 PannerNode* PannerNode::create(AbstractAudioContext& context, float sampleRate) 503 PannerNode* PannerNode::create(AbstractAudioContext& context, ExceptionState& ex ceptionState)
hongchan 2016/05/13 01:20:12 Over 80 cols.
504 { 504 {
505 return new PannerNode(context, sampleRate); 505 ASSERT(isMainThread());
hongchan 2016/05/13 01:20:12 DCHECK.
Raymond Toy 2016/05/20 23:12:01 Done.
506
507 if (context.isContextClosed()) {
508 context.throwExceptionForClosedState(exceptionState);
509 return nullptr;
510 }
511
512 return new PannerNode(context);
506 } 513 }
507 514
508 PannerHandler& PannerNode::pannerHandler() const 515 PannerHandler& PannerNode::pannerHandler() const
509 { 516 {
510 return static_cast<PannerHandler&>(handler()); 517 return static_cast<PannerHandler&>(handler());
511 } 518 }
512 519
513 String PannerNode::panningModel() const 520 String PannerNode::panningModel() const
514 { 521 {
515 return pannerHandler().panningModel(); 522 return pannerHandler().panningModel();
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 { 607 {
601 return pannerHandler().coneOuterGain(); 608 return pannerHandler().coneOuterGain();
602 } 609 }
603 610
604 void PannerNode::setConeOuterGain(double gain) 611 void PannerNode::setConeOuterGain(double gain)
605 { 612 {
606 pannerHandler().setConeOuterGain(gain); 613 pannerHandler().setConeOuterGain(gain);
607 } 614 }
608 615
609 } // namespace blink 616 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698