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

Unified Diff: remoting/host/capturer_win.cc

Issue 8493020: Move code in src/remoting to the new callbacks. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: - Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/capturer_mac_unittest.cc ('k') | remoting/host/chromoting_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/capturer_win.cc
diff --git a/remoting/host/capturer_win.cc b/remoting/host/capturer_win.cc
index cdb84cb6b69431b891c17eae241e1b709987298b..9d8b860fd6e283d28c4e1687c53ff33a75a07fa6 100644
--- a/remoting/host/capturer_win.cc
+++ b/remoting/host/capturer_win.cc
@@ -30,8 +30,8 @@ class CapturerGdi : public Capturer {
virtual void InvalidateRegion(const SkRegion& invalid_region) OVERRIDE;
virtual void InvalidateScreen(const SkISize& size) OVERRIDE;
virtual void InvalidateFullScreen() OVERRIDE;
- virtual void CaptureInvalidRegion(CaptureCompletedCallback* callback)
- OVERRIDE;
+ virtual void CaptureInvalidRegion(
+ const CaptureCompletedCallback& callback) OVERRIDE;
virtual const SkISize& size_most_recent() const OVERRIDE;
private:
@@ -62,7 +62,7 @@ class CapturerGdi : public Capturer {
void CalculateInvalidRegion();
void CaptureRegion(const SkRegion& region,
- CaptureCompletedCallback* callback);
+ const CaptureCompletedCallback& callback);
void ReleaseBuffers();
// Generates an image in the current buffer.
@@ -144,7 +144,8 @@ void CapturerGdi::InvalidateFullScreen() {
helper_.InvalidateFullScreen();
}
-void CapturerGdi::CaptureInvalidRegion(CaptureCompletedCallback* callback) {
+void CapturerGdi::CaptureInvalidRegion(
+ const CaptureCompletedCallback& callback) {
CalculateInvalidRegion();
SkRegion invalid_region;
helper_.SwapInvalidRegion(&invalid_region);
@@ -277,9 +278,7 @@ void CapturerGdi::CalculateInvalidRegion() {
}
void CapturerGdi::CaptureRegion(const SkRegion& region,
- CaptureCompletedCallback* callback) {
- scoped_ptr<CaptureCompletedCallback> callback_deleter(callback);
-
+ const CaptureCompletedCallback& callback) {
const VideoFrameBuffer& buffer = buffers_[current_buffer_];
current_buffer_ = (current_buffer_ + 1) % kNumBuffers;
@@ -294,7 +293,7 @@ void CapturerGdi::CaptureRegion(const SkRegion& region,
helper_.set_size_most_recent(data->size());
- callback->Run(data);
+ callback.Run(data);
}
void CapturerGdi::CaptureImage() {
« no previous file with comments | « remoting/host/capturer_mac_unittest.cc ('k') | remoting/host/chromoting_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698