OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/aura_window_capture_machine.h" | 5 #include "content/browser/media/capture/aura_window_capture_machine.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
117 window_host->compositor()->RemoveObserver(this); | 117 window_host->compositor()->RemoveObserver(this); |
118 desktop_window_->RemoveObserver(this); | 118 desktop_window_->RemoveObserver(this); |
119 desktop_window_ = NULL; | 119 desktop_window_ = NULL; |
120 cursor_renderer_.reset(); | 120 cursor_renderer_.reset(); |
121 } | 121 } |
122 | 122 |
123 callback.Run(); | 123 callback.Run(); |
124 } | 124 } |
125 | 125 |
126 void AuraWindowCaptureMachine::MaybeCaptureForRefresh() { | 126 void AuraWindowCaptureMachine::MaybeCaptureForRefresh() { |
127 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 127 BrowserThread::PostTask( |
128 Capture(false); | 128 BrowserThread::UI, FROM_HERE, |
129 base::Bind(&AuraWindowCaptureMachine::Capture, | |
130 // Use of Unretained() is safe here since this task must run | |
131 // before InternalStop(). | |
132 base::Unretained(this), | |
mcasas
2016/04/07 19:12:57
Actually, since |this| pointer would be used
on UI
miu
2016/04/07 19:55:31
tl;dr: It doesn't really matter, but the raw point
| |
133 false)); | |
129 } | 134 } |
130 | 135 |
131 void AuraWindowCaptureMachine::SetWindow(aura::Window* window) { | 136 void AuraWindowCaptureMachine::SetWindow(aura::Window* window) { |
132 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 137 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
133 | 138 |
134 DCHECK(!desktop_window_); | 139 DCHECK(!desktop_window_); |
135 desktop_window_ = window; | 140 desktop_window_ = window; |
136 cursor_renderer_.reset(new CursorRendererAura(window, kCursorAlwaysEnabled)); | 141 cursor_renderer_.reset(new CursorRendererAura(window, kCursorAlwaysEnabled)); |
137 | 142 |
138 // Start observing window events. | 143 // Start observing window events. |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
352 // TODO(miu): The CopyOutputRequest should be made earlier, at WillCommit(). | 357 // TODO(miu): The CopyOutputRequest should be made earlier, at WillCommit(). |
353 // http://crbug.com/492839 | 358 // http://crbug.com/492839 |
354 BrowserThread::PostTask( | 359 BrowserThread::PostTask( |
355 BrowserThread::UI, | 360 BrowserThread::UI, |
356 FROM_HERE, | 361 FROM_HERE, |
357 base::Bind(&AuraWindowCaptureMachine::Capture, weak_factory_.GetWeakPtr(), | 362 base::Bind(&AuraWindowCaptureMachine::Capture, weak_factory_.GetWeakPtr(), |
358 true)); | 363 true)); |
359 } | 364 } |
360 | 365 |
361 } // namespace content | 366 } // namespace content |
OLD | NEW |