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

Side by Side Diff: content/browser/media/capture/web_contents_video_capture_device_unittest.cc

Issue 1418263006: Extend VideoCaptureDevice::Client::OnError() to have a tracked_objects::Location param. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/media/capture/web_contents_video_capture_device.h" 5 #include "content/browser/media/capture/web_contents_video_capture_device.h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/debug/debugger.h" 8 #include "base/debug/debugger.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/test/test_timeouts.h" 10 #include "base/test/test_timeouts.h"
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 const int center_offset_uv = 400 const int center_offset_uv =
401 (frame->stride(VideoFrame::kUPlane) * (center.y() / 2)) + 401 (frame->stride(VideoFrame::kUPlane) * (center.y() / 2)) +
402 (center.x() / 2); 402 (center.x() / 2);
403 report_callback_.Run( 403 report_callback_.Run(
404 SkColorSetRGB(frame->data(VideoFrame::kYPlane)[center_offset_y], 404 SkColorSetRGB(frame->data(VideoFrame::kYPlane)[center_offset_y],
405 frame->data(VideoFrame::kUPlane)[center_offset_uv], 405 frame->data(VideoFrame::kUPlane)[center_offset_uv],
406 frame->data(VideoFrame::kVPlane)[center_offset_uv]), 406 frame->data(VideoFrame::kVPlane)[center_offset_uv]),
407 frame->visible_rect().size()); 407 frame->visible_rect().size());
408 } 408 }
409 409
410 void OnError(const std::string& reason) override { error_callback_.Run(); } 410 void OnError(const tracked_objects::Location& from_here,
411 const std::string& reason) override {
412 error_callback_.Run();
413 }
411 414
412 double GetBufferPoolUtilization() const override { return 0.0; } 415 double GetBufferPoolUtilization() const override { return 0.0; }
413 416
414 private: 417 private:
415 class AutoReleaseBuffer : public media::VideoCaptureDevice::Client::Buffer { 418 class AutoReleaseBuffer : public media::VideoCaptureDevice::Client::Buffer {
416 public: 419 public:
417 AutoReleaseBuffer( 420 AutoReleaseBuffer(
418 const scoped_refptr<VideoCaptureBufferPool>& pool, 421 const scoped_refptr<VideoCaptureBufferPool>& pool,
419 scoped_ptr<VideoCaptureBufferPool::BufferHandle> buffer_handle, 422 scoped_ptr<VideoCaptureBufferPool::BufferHandle> buffer_handle,
420 int buffer_id) 423 int buffer_id)
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 policies[i], gfx::Size(1000, 1000), gfx::Size(1000, 1000)); 1137 policies[i], gfx::Size(1000, 1000), gfx::Size(1000, 1000));
1135 RunTestForPreferredSize( 1138 RunTestForPreferredSize(
1136 policies[i], gfx::Size(1600, 1000), gfx::Size(1600, 1000)); 1139 policies[i], gfx::Size(1600, 1000), gfx::Size(1600, 1000));
1137 RunTestForPreferredSize( 1140 RunTestForPreferredSize(
1138 policies[i], gfx::Size(837, 999), gfx::Size(837, 999)); 1141 policies[i], gfx::Size(837, 999), gfx::Size(837, 999));
1139 } 1142 }
1140 } 1143 }
1141 1144
1142 } // namespace 1145 } // namespace
1143 } // namespace content 1146 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698