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

Side by Side Diff: content/renderer/scheduler/resource_dispatch_throttler.cc

Issue 2101943004: content: Change auto to not deduce raw pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase/update Created 4 years, 5 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/scheduler/resource_dispatch_throttler.h" 5 #include "content/renderer/scheduler/resource_dispatch_throttler.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "components/scheduler/renderer/renderer_scheduler.h" 9 #include "components/scheduler/renderer/renderer_scheduler.h"
10 #include "content/common/resource_messages.h" 10 #include "content/common/resource_messages.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 void ResourceDispatchThrottler::FlushAll() { 126 void ResourceDispatchThrottler::FlushAll() {
127 LogFlush(); 127 LogFlush();
128 if (throttled_messages_.empty()) 128 if (throttled_messages_.empty())
129 return; 129 return;
130 130
131 TRACE_EVENT1("loader", "ResourceDispatchThrottler::FlushAll", 131 TRACE_EVENT1("loader", "ResourceDispatchThrottler::FlushAll",
132 "total_throttled_messages", throttled_messages_.size()); 132 "total_throttled_messages", throttled_messages_.size());
133 std::deque<IPC::Message*> throttled_messages; 133 std::deque<IPC::Message*> throttled_messages;
134 throttled_messages.swap(throttled_messages_); 134 throttled_messages.swap(throttled_messages_);
135 for (auto& message : throttled_messages) 135 for (auto* message : throttled_messages)
136 ForwardMessage(message); 136 ForwardMessage(message);
137 // There shouldn't be re-entrancy issues when forwarding an IPC, but validate 137 // There shouldn't be re-entrancy issues when forwarding an IPC, but validate
138 // as a safeguard. 138 // as a safeguard.
139 DCHECK(throttled_messages_.empty()); 139 DCHECK(throttled_messages_.empty());
140 } 140 }
141 141
142 void ResourceDispatchThrottler::LogFlush() { 142 void ResourceDispatchThrottler::LogFlush() {
143 sent_requests_since_last_flush_ = 0; 143 sent_requests_since_last_flush_ = 0;
144 last_flush_time_ = Now(); 144 last_flush_time_ = Now();
145 } 145 }
146 146
147 bool ResourceDispatchThrottler::ForwardMessage(IPC::Message* msg) { 147 bool ResourceDispatchThrottler::ForwardMessage(IPC::Message* msg) {
148 if (IsResourceRequest(*msg)) 148 if (IsResourceRequest(*msg))
149 ++sent_requests_since_last_flush_; 149 ++sent_requests_since_last_flush_;
150 150
151 return proxied_sender_->Send(msg); 151 return proxied_sender_->Send(msg);
152 } 152 }
153 153
154 } // namespace content 154 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698