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

Unified Diff: third_party/WebKit/Source/modules/webaudio/AudioContextTest.cpp

Issue 2846843002: [blink] Unique pointers in Platform.h (Closed)
Patch Set: fix compilation (and again) Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/webaudio/AudioContextTest.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioContextTest.cpp b/third_party/WebKit/Source/modules/webaudio/AudioContextTest.cpp
index 9389f7f20b2fd1c824e7c1164629dd3da8eb1df3..cf0a3c82e149cf3cff1a0fe6e4efc64e7ec6c840 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioContextTest.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/AudioContextTest.cpp
@@ -7,6 +7,7 @@
#include "core/dom/Document.h"
#include "core/testing/DummyPageHolder.h"
#include "platform/testing/TestingPlatformSupport.h"
+#include "platform/wtf/PtrUtil.h"
#include "public/platform/WebAudioDevice.h"
#include "public/platform/WebAudioLatencyHint.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -33,12 +34,13 @@ class MockWebAudioDevice : public WebAudioDevice {
class AudioContextTestPlatform : public TestingPlatformSupport {
public:
- WebAudioDevice* CreateAudioDevice(unsigned number_of_input_channels,
- unsigned number_of_channels,
- const WebAudioLatencyHint& latency_hint,
- WebAudioDevice::RenderCallback*,
- const WebString& device_id,
- const WebSecurityOrigin&) override {
+ std::unique_ptr<WebAudioDevice> CreateAudioDevice(
+ unsigned number_of_input_channels,
+ unsigned number_of_channels,
+ const WebAudioLatencyHint& latency_hint,
+ WebAudioDevice::RenderCallback*,
+ const WebString& device_id,
+ const WebSecurityOrigin&) override {
double buffer_size = 0;
const double interactive_size = AudioHardwareBufferSize();
const double balanced_size = AudioHardwareBufferSize() * 2;
@@ -64,7 +66,8 @@ class AudioContextTestPlatform : public TestingPlatformSupport {
break;
}
- return new MockWebAudioDevice(AudioHardwareSampleRate(), buffer_size);
+ return WTF::MakeUnique<MockWebAudioDevice>(AudioHardwareSampleRate(),
+ buffer_size);
}
double AudioHardwareSampleRate() override { return 44100; }

Powered by Google App Engine
This is Rietveld 408576698