Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 REMOTING_HOST_CAPTURER_H_ | 5 #ifndef REMOTING_HOST_CAPTURER_H_ |
| 6 #define REMOTING_HOST_CAPTURER_H_ | 6 #define REMOTING_HOST_CAPTURER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/lock.h" | 10 #include "base/lock.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 // | 76 // |
| 77 // If |inval_rects_| is empty, then this does nothing except | 77 // If |inval_rects_| is empty, then this does nothing except |
| 78 // call the |callback| routine. | 78 // call the |callback| routine. |
| 79 // | 79 // |
| 80 // It is OK to call this method while another thread is reading | 80 // It is OK to call this method while another thread is reading |
| 81 // data of the last capture. | 81 // data of the last capture. |
| 82 // There can be at most one concurrent read going on when this | 82 // There can be at most one concurrent read going on when this |
| 83 // method is called. | 83 // method is called. |
| 84 virtual void CaptureInvalidRects(CaptureCompletedCallback* callback); | 84 virtual void CaptureInvalidRects(CaptureCompletedCallback* callback); |
| 85 | 85 |
| 86 static Capturer* Create(MessageLoop* message_loop); | |
|
dmac
2010/11/23 01:14:57
Can you add a comment on this method? Also, should
Sergey Ulanov
2010/11/23 01:59:18
Done.
| |
| 87 | |
| 86 protected: | 88 protected: |
| 87 // Update the list of |invalid_rects| to prepare for capturing the | 89 // Update the list of |invalid_rects| to prepare for capturing the |
| 88 // screen data. | 90 // screen data. |
| 89 // Depending on the platform implementation, this routine might: | 91 // Depending on the platform implementation, this routine might: |
| 90 // (a) Analyze screen and calculate the list of rects that have changed | 92 // (a) Analyze screen and calculate the list of rects that have changed |
| 91 // since the last capture. | 93 // since the last capture. |
| 92 // (b) Merge already-acculumated rects into a more optimal list (for | 94 // (b) Merge already-acculumated rects into a more optimal list (for |
| 93 // example, by combining or removing rects). | 95 // example, by combining or removing rects). |
| 94 virtual void CalculateInvalidRects() = 0; | 96 virtual void CalculateInvalidRects() = 0; |
| 95 | 97 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 133 // capture. | 135 // capture. |
| 134 InvalidRects inval_rects_; | 136 InvalidRects inval_rects_; |
| 135 | 137 |
| 136 // A lock protecting |inval_rects_| across threads. | 138 // A lock protecting |inval_rects_| across threads. |
| 137 Lock inval_rects_lock_; | 139 Lock inval_rects_lock_; |
| 138 }; | 140 }; |
| 139 | 141 |
| 140 } // namespace remoting | 142 } // namespace remoting |
| 141 | 143 |
| 142 #endif // REMOTING_HOST_CAPTURER_H_ | 144 #endif // REMOTING_HOST_CAPTURER_H_ |
| OLD | NEW |