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

Side by Side Diff: blimp/net/blob_channel/blob_channel_sender_impl.cc

Issue 2256363003: Clean up thread handling in Blimp browser tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wez feedback Created 4 years, 4 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
« no previous file with comments | « blimp/net/blob_channel/blob_channel_sender_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 "blimp/net/blob_channel/blob_channel_sender_impl.h" 5 #include "blimp/net/blob_channel/blob_channel_sender_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
11 #include "blimp/common/blob_cache/blob_cache.h" 11 #include "blimp/common/blob_cache/blob_cache.h"
12 #include "blimp/common/blob_cache/id_util.h" 12 #include "blimp/common/blob_cache/id_util.h"
13 13
14 namespace blimp { 14 namespace blimp {
15 15
16 BlobChannelSenderImpl::BlobChannelSenderImpl(std::unique_ptr<BlobCache> cache, 16 BlobChannelSenderImpl::BlobChannelSenderImpl(std::unique_ptr<BlobCache> cache,
17 std::unique_ptr<Delegate> delegate) 17 std::unique_ptr<Delegate> delegate)
18 : cache_(std::move(cache)), delegate_(std::move(delegate)) { 18 : cache_(std::move(cache)),
19 delegate_(std::move(delegate)),
20 weak_factory_(this) {
19 DCHECK(cache_); 21 DCHECK(cache_);
20 DCHECK(delegate_); 22 DCHECK(delegate_);
21 } 23 }
22 24
23 BlobChannelSenderImpl::~BlobChannelSenderImpl() {} 25 BlobChannelSenderImpl::~BlobChannelSenderImpl() {}
24 26
25 std::vector<BlobChannelSender::CacheStateEntry> 27 std::vector<BlobChannelSender::CacheStateEntry>
26 BlobChannelSenderImpl::GetCachedBlobIds() const { 28 BlobChannelSenderImpl::GetCachedBlobIds() const {
27 const auto cache_state = cache_->GetCachedBlobIds(); 29 const auto cache_state = cache_->GetCachedBlobIds();
28 std::vector<CacheStateEntry> output; 30 std::vector<CacheStateEntry> output;
(...skipping 30 matching lines...) Expand all
59 DVLOG(3) << "Suppressed redundant push: " << BlobIdToString(id); 61 DVLOG(3) << "Suppressed redundant push: " << BlobIdToString(id);
60 return; 62 return;
61 } 63 }
62 receiver_cache_contents_.insert(id); 64 receiver_cache_contents_.insert(id);
63 65
64 VLOG(2) << "Deliver blob: " << BlobIdToString(id); 66 VLOG(2) << "Deliver blob: " << BlobIdToString(id);
65 delegate_->DeliverBlob(id, cache_->Get(id)); 67 delegate_->DeliverBlob(id, cache_->Get(id));
66 } 68 }
67 69
68 } // namespace blimp 70 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/net/blob_channel/blob_channel_sender_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698