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

Side by Side Diff: chrome/browser/net/predictor_browsertest.cc

Issue 1395103003: Don't use base::MessageLoop::{Quit,QuitClosure} in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « chrome/browser/net/dns_probe_browsertest.cc ('k') | chrome/browser/net/predictor_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/json/json_string_value_serializer.h" 9 #include "base/json/json_string_value_serializer.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 private: 175 private:
176 ~HostResolutionRequestRecorder() override {} 176 ~HostResolutionRequestRecorder() override {}
177 177
178 void AddToHistory(const std::string& hostname) { 178 void AddToHistory(const std::string& hostname) {
179 DCHECK_CURRENTLY_ON(BrowserThread::UI); 179 DCHECK_CURRENTLY_ON(BrowserThread::UI);
180 requested_hostnames_.push_back(hostname); 180 requested_hostnames_.push_back(hostname);
181 if (is_waiting_for_hostname_ && waiting_for_hostname_ == hostname) { 181 if (is_waiting_for_hostname_ && waiting_for_hostname_ == hostname) {
182 is_waiting_for_hostname_ = false; 182 is_waiting_for_hostname_ = false;
183 waiting_for_hostname_.clear(); 183 waiting_for_hostname_.clear();
184 base::MessageLoop::current()->Quit(); 184 base::MessageLoop::current()->QuitWhenIdle();
185 } 185 }
186 } 186 }
187 187
188 // The hostname which WaitUntilHostHasBeenRequested is currently waiting for 188 // The hostname which WaitUntilHostHasBeenRequested is currently waiting for
189 // to be requested. 189 // to be requested.
190 std::string waiting_for_hostname_; 190 std::string waiting_for_hostname_;
191 191
192 // Whether WaitUntilHostHasBeenRequested is waiting for a hostname to be 192 // Whether WaitUntilHostHasBeenRequested is waiting for a hostname to be
193 // requested and thus is running a nested message loop. 193 // requested and thus is running a nested message loop.
194 bool is_waiting_for_hostname_; 194 bool is_waiting_for_hostname_;
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 // Second navigation to content with an img. 454 // Second navigation to content with an img.
455 std::string img_content = 455 std::string img_content =
456 "<img src=\"" + preconnect_url.spec() + "test.gif\">"; 456 "<img src=\"" + preconnect_url.spec() + "test.gif\">";
457 NavigateToDataURLWithContent(img_content); 457 NavigateToDataURLWithContent(img_content);
458 connection_listener_->WaitUntilFirstConnectionRead(); 458 connection_listener_->WaitUntilFirstConnectionRead();
459 EXPECT_EQ(2u, connection_listener_->GetAcceptedSocketCount()); 459 EXPECT_EQ(2u, connection_listener_->GetAcceptedSocketCount());
460 EXPECT_EQ(1u, connection_listener_->GetReadSocketCount()); 460 EXPECT_EQ(1u, connection_listener_->GetReadSocketCount());
461 } 461 }
462 462
463 } // namespace chrome_browser_net 463 } // namespace chrome_browser_net
OLDNEW
« no previous file with comments | « chrome/browser/net/dns_probe_browsertest.cc ('k') | chrome/browser/net/predictor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698