OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/desktop_capture_device.h" | 5 #include "content/browser/media/capture/desktop_capture_device.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 : FIRST_SCREEN_CAPTURE_FAILED); | 199 : FIRST_SCREEN_CAPTURE_FAILED); |
200 } else { | 200 } else { |
201 IncrementDesktopCaptureCounter(frame ? FIRST_WINDOW_CAPTURE_SUCCEEDED | 201 IncrementDesktopCaptureCounter(frame ? FIRST_WINDOW_CAPTURE_SUCCEEDED |
202 : FIRST_WINDOW_CAPTURE_FAILED); | 202 : FIRST_WINDOW_CAPTURE_FAILED); |
203 } | 203 } |
204 } | 204 } |
205 | 205 |
206 capture_in_progress_ = false; | 206 capture_in_progress_ = false; |
207 | 207 |
208 if (!frame) { | 208 if (!frame) { |
209 std::string log("Failed to capture a frame."); | 209 client_->OnError(FROM_HERE, "Failed to capture a frame."); |
210 LOG(ERROR) << log; | |
211 client_->OnError(log); | |
212 return; | 210 return; |
213 } | 211 } |
214 | 212 |
215 if (!client_) | 213 if (!client_) |
216 return; | 214 return; |
217 | 215 |
218 base::TimeDelta capture_time( | 216 base::TimeDelta capture_time( |
219 base::TimeDelta::FromMilliseconds(frame->capture_time_ms())); | 217 base::TimeDelta::FromMilliseconds(frame->capture_time_ms())); |
220 | 218 |
221 // The two UMA_ blocks must be put in its own scope since it creates a static | 219 // The two UMA_ blocks must be put in its own scope since it creates a static |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 #else | 449 #else |
452 base::MessageLoop::Type thread_type = base::MessageLoop::TYPE_DEFAULT; | 450 base::MessageLoop::Type thread_type = base::MessageLoop::TYPE_DEFAULT; |
453 #endif | 451 #endif |
454 | 452 |
455 thread_.StartWithOptions(base::Thread::Options(thread_type, 0)); | 453 thread_.StartWithOptions(base::Thread::Options(thread_type, 0)); |
456 | 454 |
457 core_.reset(new Core(thread_.task_runner(), capturer.Pass(), type)); | 455 core_.reset(new Core(thread_.task_runner(), capturer.Pass(), type)); |
458 } | 456 } |
459 | 457 |
460 } // namespace content | 458 } // namespace content |
OLD | NEW |