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

Side by Side Diff: blimp/engine/browser_tests/blimp_contents_view_readback_helper.cc

Issue 2320923002: Add a full Blimp integration test. (Closed)
Patch Set: Fix build break with chrome embedder Created 4 years, 3 months 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "blimp/engine/browser_tests/blimp_contents_view_readback_helper.h"
6
7 #include "base/bind.h"
8 #include "third_party/skia/include/core/SkBitmap.h"
9
10 namespace blimp {
11
12 BlimpContentsViewReadbackHelper::BlimpContentsViewReadbackHelper()
13 : event_(base::WaitableEvent::ResetPolicy::MANUAL,
14 base::WaitableEvent::InitialState::NOT_SIGNALED),
15 weak_ptr_factory_(this) {}
16
17 BlimpContentsViewReadbackHelper::~BlimpContentsViewReadbackHelper() = default;
18
19 client::BlimpContentsView::ReadbackRequestCallback
20 BlimpContentsViewReadbackHelper::GetCallback() {
21 return base::Bind(&BlimpContentsViewReadbackHelper::OnReadbackComplete,
22 weak_ptr_factory_.GetWeakPtr());
23 }
24
25 SkBitmap* BlimpContentsViewReadbackHelper::GetBitmap() const {
26 return bitmap_.get();
27 }
28
29 void BlimpContentsViewReadbackHelper::OnReadbackComplete(
30 std::unique_ptr<SkBitmap> bitmap) {
31 bitmap_ = std::move(bitmap);
32 event_.Signal();
33 }
34
35 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/engine/browser_tests/blimp_contents_view_readback_helper.h ('k') | blimp/engine/browser_tests/integration_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698