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

Side by Side Diff: content/test/content_browser_test_utils_internal.cc

Issue 1874903002: Convert //content from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix indent Created 4 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/test/content_browser_test_utils_internal.h" 5 #include "content/test/content_browser_test_utils_internal.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 loop_runner_ = new MessageLoopRunner(); 390 loop_runner_ = new MessageLoopRunner();
391 loop_runner_->Run(); 391 loop_runner_->Run();
392 loop_runner_ = nullptr; 392 loop_runner_ = nullptr;
393 } 393 }
394 394
395 void TestNavigationManager::DidStartNavigation(NavigationHandle* handle) { 395 void TestNavigationManager::DidStartNavigation(NavigationHandle* handle) {
396 if (handle_ || handle->GetURL() != url_) 396 if (handle_ || handle->GetURL() != url_)
397 return; 397 return;
398 398
399 handle_ = handle; 399 handle_ = handle;
400 scoped_ptr<NavigationThrottle> throttle(new TestNavigationManagerThrottle( 400 std::unique_ptr<NavigationThrottle> throttle(
401 handle_, base::Bind(&TestNavigationManager::OnWillStartRequest, 401 new TestNavigationManagerThrottle(
402 weak_factory_.GetWeakPtr()))); 402 handle_, base::Bind(&TestNavigationManager::OnWillStartRequest,
403 weak_factory_.GetWeakPtr())));
403 handle_->RegisterThrottleForTesting(std::move(throttle)); 404 handle_->RegisterThrottleForTesting(std::move(throttle));
404 } 405 }
405 406
406 void TestNavigationManager::DidFinishNavigation(NavigationHandle* handle) { 407 void TestNavigationManager::DidFinishNavigation(NavigationHandle* handle) {
407 if (handle != handle_) 408 if (handle != handle_)
408 return; 409 return;
409 handle_ = nullptr; 410 handle_ = nullptr;
410 navigation_paused_ = false; 411 navigation_paused_ = false;
411 if (loop_runner_) 412 if (loop_runner_)
412 loop_runner_->Quit(); 413 loop_runner_->Quit();
413 } 414 }
414 415
415 void TestNavigationManager::OnWillStartRequest() { 416 void TestNavigationManager::OnWillStartRequest() {
416 navigation_paused_ = true; 417 navigation_paused_ = true;
417 if (loop_runner_) 418 if (loop_runner_)
418 loop_runner_->Quit(); 419 loop_runner_->Quit();
419 } 420 }
420 421
421 } // namespace content 422 } // namespace content
OLDNEW
« no previous file with comments | « content/test/browser_side_navigation_test_utils.cc ('k') | content/test/content_test_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698