| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/devtools/protocol/page_handler.h" | 5 #include "content/browser/devtools/protocol/page_handler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 --capture_retry_count_; | 510 --capture_retry_count_; |
| 511 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 511 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 512 FROM_HERE, base::Bind(&PageHandler::InnerSwapCompositorFrame, | 512 FROM_HERE, base::Bind(&PageHandler::InnerSwapCompositorFrame, |
| 513 weak_factory_.GetWeakPtr()), | 513 weak_factory_.GetWeakPtr()), |
| 514 base::TimeDelta::FromMilliseconds(kFrameRetryDelayMs)); | 514 base::TimeDelta::FromMilliseconds(kFrameRetryDelayMs)); |
| 515 } | 515 } |
| 516 --frames_in_flight_; | 516 --frames_in_flight_; |
| 517 return; | 517 return; |
| 518 } | 518 } |
| 519 base::PostTaskWithTraitsAndReplyWithResult( | 519 base::PostTaskWithTraitsAndReplyWithResult( |
| 520 FROM_HERE, base::TaskTraits().WithShutdownBehavior( | 520 FROM_HERE, {base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, |
| 521 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN), | |
| 522 base::Bind(&EncodeImage, gfx::Image::CreateFrom1xBitmap(bitmap), | 521 base::Bind(&EncodeImage, gfx::Image::CreateFrom1xBitmap(bitmap), |
| 523 screencast_format_, screencast_quality_), | 522 screencast_format_, screencast_quality_), |
| 524 base::Bind(&PageHandler::ScreencastFrameEncoded, | 523 base::Bind(&PageHandler::ScreencastFrameEncoded, |
| 525 weak_factory_.GetWeakPtr(), base::Passed(&metadata), | 524 weak_factory_.GetWeakPtr(), base::Passed(&metadata), |
| 526 base::Time::Now())); | 525 base::Time::Now())); |
| 527 } | 526 } |
| 528 | 527 |
| 529 void PageHandler::ScreencastFrameEncoded(cc::CompositorFrameMetadata metadata, | 528 void PageHandler::ScreencastFrameEncoded(cc::CompositorFrameMetadata metadata, |
| 530 const base::Time& timestamp, | 529 const base::Time& timestamp, |
| 531 const std::string& data) { | 530 const std::string& data) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 Response PageHandler::StopLoading() { | 574 Response PageHandler::StopLoading() { |
| 576 WebContentsImpl* web_contents = GetWebContents(); | 575 WebContentsImpl* web_contents = GetWebContents(); |
| 577 if (!web_contents) | 576 if (!web_contents) |
| 578 return Response::InternalError(); | 577 return Response::InternalError(); |
| 579 web_contents->Stop(); | 578 web_contents->Stop(); |
| 580 return Response::OK(); | 579 return Response::OK(); |
| 581 } | 580 } |
| 582 | 581 |
| 583 } // namespace protocol | 582 } // namespace protocol |
| 584 } // namespace content | 583 } // namespace content |
| OLD | NEW |