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

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

Issue 2233763002: blimp: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased 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/client/app/blimp_discardable_memory_allocator.cc ('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"
(...skipping 13 matching lines...) Expand all
24 24
25 std::vector<BlobChannelSender::CacheStateEntry> 25 std::vector<BlobChannelSender::CacheStateEntry>
26 BlobChannelSenderImpl::GetCachedBlobIds() const { 26 BlobChannelSenderImpl::GetCachedBlobIds() const {
27 const auto cache_state = cache_->GetCachedBlobIds(); 27 const auto cache_state = cache_->GetCachedBlobIds();
28 std::vector<CacheStateEntry> output; 28 std::vector<CacheStateEntry> output;
29 output.reserve(cache_state.size()); 29 output.reserve(cache_state.size());
30 for (const std::string& cached_id : cache_state) { 30 for (const std::string& cached_id : cache_state) {
31 CacheStateEntry next_output; 31 CacheStateEntry next_output;
32 next_output.id = cached_id; 32 next_output.id = cached_id;
33 next_output.was_delivered = 33 next_output.was_delivered =
34 ContainsKey(receiver_cache_contents_, cached_id); 34 base::ContainsKey(receiver_cache_contents_, cached_id);
35 output.push_back(next_output); 35 output.push_back(next_output);
36 } 36 }
37 return output; 37 return output;
38 } 38 }
39 39
40 void BlobChannelSenderImpl::PutBlob(const BlobId& id, BlobDataPtr data) { 40 void BlobChannelSenderImpl::PutBlob(const BlobId& id, BlobDataPtr data) {
41 DCHECK(data); 41 DCHECK(data);
42 DCHECK(!id.empty()); 42 DCHECK(!id.empty());
43 43
44 if (cache_->Contains(id)) { 44 if (cache_->Contains(id)) {
(...skipping 14 matching lines...) Expand all
59 DVLOG(3) << "Suppressed redundant push: " << BlobIdToString(id); 59 DVLOG(3) << "Suppressed redundant push: " << BlobIdToString(id);
60 return; 60 return;
61 } 61 }
62 receiver_cache_contents_.insert(id); 62 receiver_cache_contents_.insert(id);
63 63
64 VLOG(2) << "Deliver blob: " << BlobIdToString(id); 64 VLOG(2) << "Deliver blob: " << BlobIdToString(id);
65 delegate_->DeliverBlob(id, cache_->Get(id)); 65 delegate_->DeliverBlob(id, cache_->Get(id));
66 } 66 }
67 67
68 } // namespace blimp 68 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/client/app/blimp_discardable_memory_allocator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698