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

Side by Side Diff: chrome/browser/sessions/tab_loader.cc

Issue 2334613003: Re-write many calls to WrapUnique() with MakeUnique() (Closed)
Patch Set: Changes from review by sky Created 4 years, 3 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 "chrome/browser/sessions/tab_loader.h" 5 #include "chrome/browser/sessions/tab_loader.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/memory_pressure_monitor.h" 10 #include "base/memory/memory_pressure_monitor.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 77 }
78 78
79 TabLoader::TabLoader(base::TimeTicks restore_started) 79 TabLoader::TabLoader(base::TimeTicks restore_started)
80 : memory_pressure_listener_( 80 : memory_pressure_listener_(
81 base::Bind(&TabLoader::OnMemoryPressure, base::Unretained(this))), 81 base::Bind(&TabLoader::OnMemoryPressure, base::Unretained(this))),
82 force_load_delay_multiplier_(1), 82 force_load_delay_multiplier_(1),
83 loading_enabled_(true), 83 loading_enabled_(true),
84 restore_started_(restore_started) { 84 restore_started_(restore_started) {
85 stats_collector_ = new SessionRestoreStatsCollector( 85 stats_collector_ = new SessionRestoreStatsCollector(
86 restore_started, 86 restore_started,
87 base::WrapUnique( 87 base::MakeUnique<
88 new SessionRestoreStatsCollector::UmaStatsReportingDelegate())); 88 SessionRestoreStatsCollector::UmaStatsReportingDelegate>());
89 shared_tab_loader_ = this; 89 shared_tab_loader_ = this;
90 this_retainer_ = this; 90 this_retainer_ = this;
91 } 91 }
92 92
93 TabLoader::~TabLoader() { 93 TabLoader::~TabLoader() {
94 DCHECK(tabs_loading_.empty() && tabs_to_load_.empty()); 94 DCHECK(tabs_loading_.empty() && tabs_to_load_.empty());
95 DCHECK(shared_tab_loader_ == this); 95 DCHECK(shared_tab_loader_ == this);
96 shared_tab_loader_ = nullptr; 96 shared_tab_loader_ = nullptr;
97 } 97 }
98 98
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 // memory pressure. 268 // memory pressure.
269 stats_collector_->DeferTab(tab); 269 stats_collector_->DeferTab(tab);
270 } 270 }
271 // By calling |LoadNextTab| explicitly, we make sure that the 271 // By calling |LoadNextTab| explicitly, we make sure that the
272 // |NOTIFICATION_SESSION_RESTORE_DONE| event gets sent. 272 // |NOTIFICATION_SESSION_RESTORE_DONE| event gets sent.
273 LoadNextTab(); 273 LoadNextTab();
274 } 274 }
275 275
276 // static 276 // static
277 TabLoader* TabLoader::shared_tab_loader_ = nullptr; 277 TabLoader* TabLoader::shared_tab_loader_ = nullptr;
OLDNEW
« no previous file with comments | « chrome/browser/sessions/persistent_tab_restore_service_unittest.cc ('k') | chrome/browser/shell_integration_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698