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

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

Issue 2930013005: [Tab Metrics] Measure FP, FCP and FMP for Foreground Tab during Session Restore (Closed)
Patch Set: Add RemoveFromWebContents() to RestoreOrigin. Created 3 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 "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_coordinator_client_registry.h" 10 #include "base/memory/memory_coordinator_client_registry.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 force_load_delay_multiplier_, 221 force_load_delay_multiplier_,
222 this, &TabLoader::ForceLoadTimerFired); 222 this, &TabLoader::ForceLoadTimerFired);
223 } 223 }
224 224
225 void TabLoader::RemoveTab(NavigationController* controller) { 225 void TabLoader::RemoveTab(NavigationController* controller) {
226 registrar_.Remove(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, 226 registrar_.Remove(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
227 content::Source<WebContents>(controller->GetWebContents())); 227 content::Source<WebContents>(controller->GetWebContents()));
228 registrar_.Remove(this, content::NOTIFICATION_LOAD_STOP, 228 registrar_.Remove(this, content::NOTIFICATION_LOAD_STOP,
229 content::Source<NavigationController>(controller)); 229 content::Source<NavigationController>(controller));
230 230
231 RestoreOrigin::RemoveFromWebContents(controller->GetWebContents());
232
231 TabsLoading::iterator i = tabs_loading_.find(controller); 233 TabsLoading::iterator i = tabs_loading_.find(controller);
232 if (i != tabs_loading_.end()) 234 if (i != tabs_loading_.end())
233 tabs_loading_.erase(i); 235 tabs_loading_.erase(i);
234 236
235 TabsToLoad::iterator j = 237 TabsToLoad::iterator j =
236 find(tabs_to_load_.begin(), tabs_to_load_.end(), controller); 238 find(tabs_to_load_.begin(), tabs_to_load_.end(), controller);
237 if (j != tabs_to_load_.end()) 239 if (j != tabs_to_load_.end())
238 tabs_to_load_.erase(j); 240 tabs_to_load_.erase(j);
239 } 241 }
240 242
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 // memory pressure. 311 // memory pressure.
310 stats_collector_->DeferTab(tab); 312 stats_collector_->DeferTab(tab);
311 } 313 }
312 // By calling |LoadNextTab| explicitly, we make sure that the 314 // By calling |LoadNextTab| explicitly, we make sure that the
313 // |NOTIFICATION_SESSION_RESTORE_DONE| event gets sent. 315 // |NOTIFICATION_SESSION_RESTORE_DONE| event gets sent.
314 LoadNextTab(); 316 LoadNextTab();
315 } 317 }
316 318
317 // static 319 // static
318 TabLoader* TabLoader::shared_tab_loader_ = nullptr; 320 TabLoader* TabLoader::shared_tab_loader_ = nullptr;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698