| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CONTENT_RENDERER_MEDIA_IMAGE_CAPTURE_FRAME_GRABBER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_IMAGE_CAPTURE_FRAME_GRABBER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_IMAGE_CAPTURE_FRAME_GRABBER_H_ | 6 #define CONTENT_RENDERER_MEDIA_IMAGE_CAPTURE_FRAME_GRABBER_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 blink::WebImageCaptureGrabFrameCallbacks* callbacks) override; | 39 blink::WebImageCaptureGrabFrameCallbacks* callbacks) override; |
| 40 | 40 |
| 41 private: | 41 private: |
| 42 // Internal class to receive, convert and forward one frame. | 42 // Internal class to receive, convert and forward one frame. |
| 43 class SingleShotFrameHandler; | 43 class SingleShotFrameHandler; |
| 44 | 44 |
| 45 void OnSkImage( | 45 void OnSkImage( |
| 46 ScopedWebCallbacks<blink::WebImageCaptureGrabFrameCallbacks> callbacks, | 46 ScopedWebCallbacks<blink::WebImageCaptureGrabFrameCallbacks> callbacks, |
| 47 sk_sp<SkImage> image); | 47 sk_sp<SkImage> image); |
| 48 | 48 |
| 49 // Flag to indicate that there is a frame grabbing in progress. |
| 50 bool frame_grab_in_progress_; |
| 51 |
| 49 base::ThreadChecker thread_checker_; | 52 base::ThreadChecker thread_checker_; |
| 50 base::WeakPtrFactory<ImageCaptureFrameGrabber> weak_factory_; | 53 base::WeakPtrFactory<ImageCaptureFrameGrabber> weak_factory_; |
| 51 | 54 |
| 52 DISALLOW_COPY_AND_ASSIGN(ImageCaptureFrameGrabber); | 55 DISALLOW_COPY_AND_ASSIGN(ImageCaptureFrameGrabber); |
| 53 }; | 56 }; |
| 54 | 57 |
| 55 } // namespace content | 58 } // namespace content |
| 56 | 59 |
| 57 #endif // CONTENT_RENDERER_MEDIA_IMAGE_CAPTURE_FRAME_GRABBER_H_ | 60 #endif // CONTENT_RENDERER_MEDIA_IMAGE_CAPTURE_FRAME_GRABBER_H_ |
| OLD | NEW |