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

Unified Diff: remoting/host/capturer_mac.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_linux.cc ('k') | remoting/host/capturer_mac_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/capturer_mac.cc
diff --git a/remoting/host/capturer_mac.cc b/remoting/host/capturer_mac.cc
index a4ee518a57d1e661c8f6898b1eb79464948de699..394c8b1b4a0d524198089de79431412ea18a9469 100644
--- a/remoting/host/capturer_mac.cc
+++ b/remoting/host/capturer_mac.cc
@@ -153,8 +153,8 @@ class CapturerMac : 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:
@@ -163,12 +163,12 @@ class CapturerMac : public Capturer {
void CgBlitPreLion(const VideoFrameBuffer& buffer, const SkRegion& region);
void CgBlitPostLion(const VideoFrameBuffer& buffer, const SkRegion& region);
void CaptureRegion(const SkRegion& region,
- CaptureCompletedCallback* callback);
+ const CaptureCompletedCallback& callback);
void ScreenRefresh(CGRectCount count, const CGRect *rect_array);
void ScreenUpdateMove(CGScreenUpdateMoveDelta delta,
- size_t count,
- const CGRect *rect_array);
+ size_t count,
+ const CGRect *rect_array);
void DisplaysReconfigured(CGDirectDisplayID display,
CGDisplayChangeSummaryFlags flags);
static void ScreenRefreshCallback(CGRectCount count,
@@ -346,7 +346,8 @@ void CapturerMac::InvalidateFullScreen() {
helper_.InvalidateFullScreen();
}
-void CapturerMac::CaptureInvalidRegion(CaptureCompletedCallback* callback) {
+void CapturerMac::CaptureInvalidRegion(
+ const CaptureCompletedCallback& callback) {
// Only allow captures when the display configuration is not occurring.
scoped_refptr<CaptureData> data;
@@ -391,8 +392,7 @@ void CapturerMac::CaptureInvalidRegion(CaptureCompletedCallback* callback) {
helper_.set_size_most_recent(data->size());
display_configuration_capture_event_.Signal();
- callback->Run(data);
- delete callback;
+ callback.Run(data);
}
void CapturerMac::GlBlitFast(const VideoFrameBuffer& buffer,
« no previous file with comments | « remoting/host/capturer_linux.cc ('k') | remoting/host/capturer_mac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698