summaryrefslogtreecommitdiffstats
path: root/content/browser/media
diff options
context:
space:
mode:
authorwez <wez@chromium.org>2016-03-23 10:57:54 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-23 18:00:23 +0000
commit0f8f7b79220955722dfdd12af82f37d645351af1 (patch)
tree2929b8711d87e7e78ac0213ce0fa648ff536d45d /content/browser/media
parentff847a1068a3e5872d091af9c673bc715771fa5d (diff)
downloadchromium_src-0f8f7b79220955722dfdd12af82f37d645351af1.zip
chromium_src-0f8f7b79220955722dfdd12af82f37d645351af1.tar.gz
chromium_src-0f8f7b79220955722dfdd12af82f37d645351af1.tar.bz2
Remove .get() on scoped_[ref]ptr<> checks for null-ness.
BUG=396646 Review URL: https://codereview.chromium.org/1822643003 Cr-Commit-Position: refs/heads/master@{#382878}
Diffstat (limited to 'content/browser/media')
-rw-r--r--content/browser/media/capture/aura_window_capture_machine.cc8
-rw-r--r--content/browser/media/capture/desktop_capture_device.cc6
-rw-r--r--content/browser/media/capture/desktop_capture_device_aura_unittest.cc2
-rw-r--r--content/browser/media/capture/desktop_capture_device_unittest.cc2
-rw-r--r--content/browser/media/capture/web_contents_audio_input_stream.cc4
-rw-r--r--content/browser/media/capture/web_contents_tracker.cc6
-rw-r--r--content/browser/media/capture/web_contents_video_capture_device.cc10
-rw-r--r--content/browser/media/capture/web_contents_video_capture_device_unittest.cc2
8 files changed, 20 insertions, 20 deletions
diff --git a/content/browser/media/capture/aura_window_capture_machine.cc b/content/browser/media/capture/aura_window_capture_machine.cc
index f2c4b11..08ad243 100644
--- a/content/browser/media/capture/aura_window_capture_machine.cc
+++ b/content/browser/media/capture/aura_window_capture_machine.cc
@@ -74,7 +74,7 @@ bool AuraWindowCaptureMachine::InternalStart(
if (!layer)
return false;
- DCHECK(oracle_proxy.get());
+ DCHECK(oracle_proxy);
oracle_proxy_ = oracle_proxy;
capture_params_ = params;
@@ -155,7 +155,7 @@ void AuraWindowCaptureMachine::SetWindow(aura::Window* window) {
void AuraWindowCaptureMachine::UpdateCaptureSize() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- if (oracle_proxy_.get() && desktop_window_) {
+ if (oracle_proxy_ && desktop_window_) {
ui::Layer* layer = desktop_window_->layer();
oracle_proxy_->UpdateCaptureSize(ui::ConvertSizeToPixel(
layer, layer->bounds().size()));
@@ -238,7 +238,7 @@ bool AuraWindowCaptureMachine::ProcessCopyOutputResponse(
if (result->IsEmpty() || result->size().IsEmpty() || !desktop_window_)
return false;
- DCHECK(video_frame.get());
+ DCHECK(video_frame);
// Compute the dest size we want after the letterboxing resize. Make the
// coordinates and sizes even because we letterbox in YUV space
@@ -308,7 +308,7 @@ void AuraWindowCaptureMachine::CopyOutputFinishedForVideo(
// Render the cursor and deliver the captured frame if the
// AuraWindowCaptureMachine has not been stopped (i.e., the WeakPtr is
// still valid).
- if (machine.get()) {
+ if (machine) {
if (machine->cursor_renderer_ && result)
machine->cursor_renderer_->RenderOnVideoFrame(target);
capture_frame_cb.Run(target, start_time, result);
diff --git a/content/browser/media/capture/desktop_capture_device.cc b/content/browser/media/capture/desktop_capture_device.cc
index 7da980e..73eafee 100644
--- a/content/browser/media/capture/desktop_capture_device.cc
+++ b/content/browser/media/capture/desktop_capture_device.cc
@@ -160,8 +160,8 @@ void DesktopCaptureDevice::Core::AllocateAndStart(
DCHECK_GT(params.requested_format.frame_size.GetArea(), 0);
DCHECK_GT(params.requested_format.frame_rate, 0);
DCHECK(desktop_capturer_);
- DCHECK(client.get());
- DCHECK(!client_.get());
+ DCHECK(client);
+ DCHECK(!client_);
client_ = std::move(client);
requested_frame_rate_ = params.requested_format.frame_rate;
@@ -247,7 +247,7 @@ void DesktopCaptureDevice::Core::OnCaptureCompleted(
// it with a black frame to avoid the video appearing frozen at the last
// frame.
if (frame->size().width() == 1 || frame->size().height() == 1) {
- if (!black_frame_.get()) {
+ if (!black_frame_) {
black_frame_.reset(new webrtc::BasicDesktopFrame(output_size));
memset(black_frame_->data(),
0,
diff --git a/content/browser/media/capture/desktop_capture_device_aura_unittest.cc b/content/browser/media/capture/desktop_capture_device_aura_unittest.cc
index 43ed2aa..984b661 100644
--- a/content/browser/media/capture/desktop_capture_device_aura_unittest.cc
+++ b/content/browser/media/capture/desktop_capture_device_aura_unittest.cc
@@ -145,7 +145,7 @@ TEST_F(DesktopCaptureDeviceAuraTest, StartAndStop) {
DesktopCaptureDeviceAura::Create(
content::DesktopMediaID::RegisterAuraWindow(
content::DesktopMediaID::TYPE_SCREEN, root_window()));
- ASSERT_TRUE(capture_device.get());
+ ASSERT_TRUE(capture_device);
scoped_ptr<MockDeviceClient> client(new MockDeviceClient());
EXPECT_CALL(*client, OnError(_, _)).Times(0);
diff --git a/content/browser/media/capture/desktop_capture_device_unittest.cc b/content/browser/media/capture/desktop_capture_device_unittest.cc
index c7b7877..ec10e73 100644
--- a/content/browser/media/capture/desktop_capture_device_unittest.cc
+++ b/content/browser/media/capture/desktop_capture_device_unittest.cc
@@ -261,7 +261,7 @@ class DesktopCaptureDeviceTest : public testing::Test {
void CopyFrame(const uint8_t* frame, int size,
const media::VideoCaptureFormat&, int, base::TimeTicks) {
- ASSERT_TRUE(output_frame_.get() != NULL);
+ ASSERT_TRUE(output_frame_);
ASSERT_EQ(output_frame_->stride() * output_frame_->size().height(), size);
memcpy(output_frame_->data(), frame, size);
}
diff --git a/content/browser/media/capture/web_contents_audio_input_stream.cc b/content/browser/media/capture/web_contents_audio_input_stream.cc
index 7dd34e8..a211ebd 100644
--- a/content/browser/media/capture/web_contents_audio_input_stream.cc
+++ b/content/browser/media/capture/web_contents_audio_input_stream.cc
@@ -131,8 +131,8 @@ WebContentsAudioInputStream::Impl::Impl(
is_target_lost_(false),
callback_(NULL) {
DCHECK(mirroring_manager_);
- DCHECK(tracker_.get());
- DCHECK(mixer_stream_.get());
+ DCHECK(tracker_);
+ DCHECK(mixer_stream_);
// WAIS::Impl can be constructed on any thread, but will DCHECK that all
// its methods from here on are called from the same thread.
diff --git a/content/browser/media/capture/web_contents_tracker.cc b/content/browser/media/capture/web_contents_tracker.cc
index 5007a58..01bc9b0 100644
--- a/content/browser/media/capture/web_contents_tracker.cc
+++ b/content/browser/media/capture/web_contents_tracker.cc
@@ -24,10 +24,10 @@ WebContentsTracker::~WebContentsTracker() {
void WebContentsTracker::Start(int render_process_id, int main_render_frame_id,
const ChangeCallback& callback) {
- DCHECK(!task_runner_.get() || task_runner_->BelongsToCurrentThread());
+ DCHECK(!task_runner_ || task_runner_->BelongsToCurrentThread());
task_runner_ = base::ThreadTaskRunnerHandle::Get();
- DCHECK(task_runner_.get());
+ DCHECK(task_runner_);
callback_ = callback;
if (BrowserThread::CurrentlyOn(BrowserThread::UI)) {
@@ -81,7 +81,7 @@ RenderWidgetHost* WebContentsTracker::GetTargetRenderWidgetHost() const {
void WebContentsTracker::SetResizeChangeCallback(
const base::Closure& callback) {
- DCHECK(!task_runner_.get() || task_runner_->BelongsToCurrentThread());
+ DCHECK(!task_runner_ || task_runner_->BelongsToCurrentThread());
resize_callback_ = callback;
}
diff --git a/content/browser/media/capture/web_contents_video_capture_device.cc b/content/browser/media/capture/web_contents_video_capture_device.cc
index bdadcd2..a738b95 100644
--- a/content/browser/media/capture/web_contents_video_capture_device.cc
+++ b/content/browser/media/capture/web_contents_video_capture_device.cc
@@ -407,10 +407,10 @@ void FrameSubscriber::DidCaptureFrame(
bool FrameSubscriber::IsUserInteractingWithContent() {
bool interactive_mode = false;
bool ui_activity = false;
- if (window_activity_tracker_.get()) {
+ if (window_activity_tracker_) {
ui_activity = window_activity_tracker_->IsUiInteractionActive();
}
- if (cursor_renderer_.get()) {
+ if (cursor_renderer_) {
bool animation_active =
(base::TimeTicks::Now() -
oracle_proxy_->last_time_animation_was_detected()) <
@@ -668,7 +668,7 @@ bool WebContentsCaptureMachine::InternalStart(
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!IsStarted());
- DCHECK(oracle_proxy.get());
+ DCHECK(oracle_proxy);
oracle_proxy_ = oracle_proxy;
capture_params_ = params;
@@ -719,7 +719,7 @@ void WebContentsCaptureMachine::InternalStop(const base::Closure& callback) {
// The render thread cannot be stopped on the UI thread, so post a message
// to the thread pool used for blocking operations.
- if (render_thread_.get()) {
+ if (render_thread_) {
BrowserThread::PostBlockingPoolTask(
FROM_HERE,
base::Bind(&DeleteOnWorkerThread, base::Passed(&render_thread_),
@@ -852,7 +852,7 @@ void WebContentsCaptureMachine::DidCopyFromBackingStore(
DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::TimeTicks now = base::TimeTicks::Now();
- DCHECK(render_thread_.get());
+ DCHECK(render_thread_);
if (response == READBACK_SUCCESS) {
UMA_HISTOGRAM_TIMES("TabCapture.CopyTimeBitmap", now - start_time);
TRACE_EVENT_ASYNC_STEP_INTO0("gpu.capture", "Capture", target.get(),
diff --git a/content/browser/media/capture/web_contents_video_capture_device_unittest.cc b/content/browser/media/capture/web_contents_video_capture_device_unittest.cc
index 1fc6a8e..7b6268f 100644
--- a/content/browser/media/capture/web_contents_video_capture_device_unittest.cc
+++ b/content/browser/media/capture/web_contents_video_capture_device_unittest.cc
@@ -436,7 +436,7 @@ class StubClient : public media::VideoCaptureDevice::Client {
: id_(buffer_id),
pool_(pool),
buffer_handle_(std::move(buffer_handle)) {
- DCHECK(pool_.get());
+ DCHECK(pool_);
}
int id() const override { return id_; }
gfx::Size dimensions() const override { return gfx::Size(); }