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

Side by Side Diff: components/sessions/core/tab_restore_service_helper.cc

Issue 2674203003: [memory-infra] Whitelist TabRestoreService MDP. (Closed)
Patch Set: Fix tests Created 3 years, 10 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 | « base/trace_event/memory_infra_background_whitelist.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "components/sessions/core/tab_restore_service_helper.h" 5 #include "components/sessions/core/tab_restore_service_helper.h"
6 6
7 #include <inttypes.h> 7 #include <inttypes.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 341
342 bool TabRestoreServiceHelper::OnMemoryDump( 342 bool TabRestoreServiceHelper::OnMemoryDump(
343 const base::trace_event::MemoryDumpArgs& args, 343 const base::trace_event::MemoryDumpArgs& args,
344 base::trace_event::ProcessMemoryDump* pmd) { 344 base::trace_event::ProcessMemoryDump* pmd) {
345 using base::trace_event::MemoryAllocatorDump; 345 using base::trace_event::MemoryAllocatorDump;
346 346
347 const char* system_allocator_name = 347 const char* system_allocator_name =
348 base::trace_event::MemoryDumpManager::GetInstance() 348 base::trace_event::MemoryDumpManager::GetInstance()
349 ->system_allocator_pool_name(); 349 ->system_allocator_pool_name();
350 350
351 if (entries_.empty()) {
352 // Nothing to report
353 return true;
354 }
355
351 std::string entries_dump_name = base::StringPrintf( 356 std::string entries_dump_name = base::StringPrintf(
352 "tab_restore/service_helper_0x%" PRIXPTR "/entries", 357 "tab_restore/service_helper_0x%" PRIXPTR "/entries",
353 reinterpret_cast<uintptr_t>(this)); 358 reinterpret_cast<uintptr_t>(this));
354 pmd->CreateAllocatorDump(entries_dump_name) 359 pmd->CreateAllocatorDump(entries_dump_name)
355 ->AddScalar(MemoryAllocatorDump::kNameObjectCount, 360 ->AddScalar(MemoryAllocatorDump::kNameObjectCount,
356 MemoryAllocatorDump::kUnitsObjects, 361 MemoryAllocatorDump::kUnitsObjects,
357 entries_.size()); 362 entries_.size());
358 363
359 for (const auto& entry : entries_) { 364 for (const auto& entry : entries_) {
360 const char* type_string = ""; 365 const char* type_string = "";
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 tab.browser_id = new_id; 556 tab.browser_id = new_id;
552 } 557 }
553 } 558 }
554 } 559 }
555 560
556 base::Time TabRestoreServiceHelper::TimeNow() const { 561 base::Time TabRestoreServiceHelper::TimeNow() const {
557 return time_factory_ ? time_factory_->TimeNow() : base::Time::Now(); 562 return time_factory_ ? time_factory_->TimeNow() : base::Time::Now();
558 } 563 }
559 564
560 } // namespace sessions 565 } // namespace sessions
OLDNEW
« no previous file with comments | « base/trace_event/memory_infra_background_whitelist.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698