Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 2580493002: Splitting DidSwap in cc::SwapPromise into WillSwap and DidSwap (Closed)
Patch Set: remove blank line Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 // |DidNotSwapReason::SWAP_FAILS| events. 504 // |DidNotSwapReason::SWAP_FAILS| events.
505 class AlwaysDrawSwapPromise : public cc::SwapPromise { 505 class AlwaysDrawSwapPromise : public cc::SwapPromise {
506 public: 506 public:
507 explicit AlwaysDrawSwapPromise(const ui::LatencyInfo& latency_info) 507 explicit AlwaysDrawSwapPromise(const ui::LatencyInfo& latency_info)
508 : latency_info_(latency_info) {} 508 : latency_info_(latency_info) {}
509 509
510 ~AlwaysDrawSwapPromise() override = default; 510 ~AlwaysDrawSwapPromise() override = default;
511 511
512 void DidActivate() override {} 512 void DidActivate() override {}
513 513
514 void DidSwap(cc::CompositorFrameMetadata* metadata) override { 514 void WillSwap(cc::CompositorFrameMetadata* metadata) override {
515 DCHECK(!latency_info_.terminated()); 515 DCHECK(!latency_info_.terminated());
516 metadata->latency_info.push_back(latency_info_); 516 metadata->latency_info.push_back(latency_info_);
517 } 517 }
518 518
519 void DidSwap() override {}
520
519 DidNotSwapAction DidNotSwap(DidNotSwapReason reason) override { 521 DidNotSwapAction DidNotSwap(DidNotSwapReason reason) override {
520 return reason == DidNotSwapReason::SWAP_FAILS 522 return reason == DidNotSwapReason::SWAP_FAILS
521 ? DidNotSwapAction::KEEP_ACTIVE 523 ? DidNotSwapAction::KEEP_ACTIVE
522 : DidNotSwapAction::BREAK_PROMISE; 524 : DidNotSwapAction::BREAK_PROMISE;
523 } 525 }
524 526
525 void OnCommit() override {} 527 void OnCommit() override {}
526 528
527 int64_t TraceId() const override { return latency_info_.trace_id(); } 529 int64_t TraceId() const override { return latency_info_.trace_id(); }
528 530
(...skipping 2292 matching lines...) Expand 10 before | Expand all | Expand 10 after
2821 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); 2823 INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
2822 } 2824 }
2823 2825
2824 std::unique_ptr<InputEventAck> ack( 2826 std::unique_ptr<InputEventAck> ack(
2825 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type, 2827 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type,
2826 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); 2828 INPUT_EVENT_ACK_STATE_NOT_CONSUMED));
2827 OnInputEventAck(std::move(ack)); 2829 OnInputEventAck(std::move(ack));
2828 } 2830 }
2829 2831
2830 } // namespace content 2832 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698