Replace scoped_ptr With std::unique_ptr
(This is a merge of http://go/wvgerrit/65782) We have had our own scoped_ptr implementation that is used throughout the codebase. Now that we support C++11, we can replace these with std::unique_ptr. Doing this replacement exposed a few places where the two were not interchangeable. OEMCrypto Ref was doing some unsafe things with passing scoped_ptrs to functions and has been updated to use move semantics. And a few constructors were explicitly constructing a scoped_ptr with NULL, which is ambiguous with std::unique_ptr. These have been replaced with default constructor calls. Bug: 111851141 Test: CE CDM Unit Tests Test: Android Unit Tests Change-Id: I37d6d7aad4906709381c74f0c5439f826d2be768
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#ifndef WVCDM_CORE_CDM_SESSION_H_
|
||||
#define WVCDM_CORE_CDM_SESSION_H_
|
||||
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -18,7 +19,6 @@
|
||||
#include "metrics_collections.h"
|
||||
#include "oemcrypto_adapter.h"
|
||||
#include "policy_engine.h"
|
||||
#include "scoped_ptr.h"
|
||||
#include "timer_metric.h"
|
||||
#include "wv_cdm_types.h"
|
||||
|
||||
@@ -228,10 +228,10 @@ class CdmSession {
|
||||
bool closed_; // Session closed, but final shared_ptr has not been released.
|
||||
CdmSessionId session_id_;
|
||||
FileSystem* file_system_;
|
||||
scoped_ptr<CdmLicense> license_parser_;
|
||||
scoped_ptr<CryptoSession> crypto_session_;
|
||||
scoped_ptr<PolicyEngine> policy_engine_;
|
||||
scoped_ptr<DeviceFiles> file_handle_;
|
||||
std::unique_ptr<CdmLicense> license_parser_;
|
||||
std::unique_ptr<CryptoSession> crypto_session_;
|
||||
std::unique_ptr<PolicyEngine> policy_engine_;
|
||||
std::unique_ptr<DeviceFiles> file_handle_;
|
||||
bool license_received_;
|
||||
bool is_offline_;
|
||||
bool is_release_;
|
||||
|
||||
Reference in New Issue
Block a user