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

Unified Diff: content/renderer/pepper/pepper_device_enumeration_host_helper_unittest.cc

Issue 653243003: Pepper: Access PepperMediaDeviceManager through a WeakPtr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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: content/renderer/pepper/pepper_device_enumeration_host_helper_unittest.cc
diff --git a/content/renderer/pepper/pepper_device_enumeration_host_helper_unittest.cc b/content/renderer/pepper/pepper_device_enumeration_host_helper_unittest.cc
index 69c7a31860b45852c87b30f90d6e72667cbbe46a..d9944d45d0f3755340308df86bd173b03cf50811 100644
--- a/content/renderer/pepper/pepper_device_enumeration_host_helper_unittest.cc
+++ b/content/renderer/pepper/pepper_device_enumeration_host_helper_unittest.cc
@@ -7,6 +7,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
+#include "base/memory/weak_ptr.h"
#include "content/renderer/pepper/pepper_device_enumeration_host_helper.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/host/host_message_context.h"
@@ -24,7 +25,8 @@ namespace content {
namespace {
-class TestDelegate : public PepperDeviceEnumerationHostHelper::Delegate {
+class TestDelegate : public PepperDeviceEnumerationHostHelper::Delegate,
+ public base::SupportsWeakPtr<TestDelegate> {
public:
TestDelegate() : last_used_id_(0) {}
@@ -76,7 +78,7 @@ class PepperDeviceEnumerationHostHelperTest : public testing::Test {
: ppapi_host_(&sink_, ppapi::PpapiPermissions()),
resource_host_(&ppapi_host_, 12345, 67890),
device_enumeration_(&resource_host_,
- &delegate_,
+ delegate_.AsWeakPtr(),
PP_DEVICETYPE_DEV_AUDIOCAPTURE,
GURL("http://example.com")) {}

Powered by Google App Engine
This is Rietveld 408576698