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

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 1433603004: Add ProcessMetrics::CreateCurrentProcessMetrics() method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@a_counter_with_ts
Patch Set: Remove patch dependency Created 5 years, 1 month 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 (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 "content/browser/browser_main_loop.h" 5 #include "content/browser/browser_main_loop.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/feature_list.h" 9 #include "base/feature_list.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 class BrowserMainLoop::MemoryObserver : public base::MessageLoop::TaskObserver { 367 class BrowserMainLoop::MemoryObserver : public base::MessageLoop::TaskObserver {
368 public: 368 public:
369 MemoryObserver() {} 369 MemoryObserver() {}
370 ~MemoryObserver() override {} 370 ~MemoryObserver() override {}
371 371
372 void WillProcessTask(const base::PendingTask& pending_task) override {} 372 void WillProcessTask(const base::PendingTask& pending_task) override {}
373 373
374 void DidProcessTask(const base::PendingTask& pending_task) override { 374 void DidProcessTask(const base::PendingTask& pending_task) override {
375 #if !defined(OS_IOS) // No ProcessMetrics on IOS. 375 #if !defined(OS_IOS) // No ProcessMetrics on IOS.
376 scoped_ptr<base::ProcessMetrics> process_metrics( 376 scoped_ptr<base::ProcessMetrics> process_metrics(
377 base::ProcessMetrics::CreateProcessMetrics( 377 base::ProcessMetrics::CreateCurrentProcessMetrics());
378 #if defined(OS_MACOSX)
379 base::GetCurrentProcessHandle(), NULL));
380 #else
381 base::GetCurrentProcessHandle()));
382 #endif
383 size_t private_bytes; 378 size_t private_bytes;
384 process_metrics->GetMemoryBytes(&private_bytes, NULL); 379 process_metrics->GetMemoryBytes(&private_bytes, NULL);
385 LOCAL_HISTOGRAM_MEMORY_KB("Memory.BrowserUsed", private_bytes >> 10); 380 LOCAL_HISTOGRAM_MEMORY_KB("Memory.BrowserUsed", private_bytes >> 10);
386 #endif 381 #endif
387 } 382 }
388 private: 383 private:
389 DISALLOW_COPY_AND_ASSIGN(MemoryObserver); 384 DISALLOW_COPY_AND_ASSIGN(MemoryObserver);
390 }; 385 };
391 386
392 387
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after
1431 DCHECK(is_tracing_startup_for_duration_); 1426 DCHECK(is_tracing_startup_for_duration_);
1432 1427
1433 is_tracing_startup_for_duration_ = false; 1428 is_tracing_startup_for_duration_ = false;
1434 TracingController::GetInstance()->DisableRecording( 1429 TracingController::GetInstance()->DisableRecording(
1435 TracingController::CreateFileSink( 1430 TracingController::CreateFileSink(
1436 startup_trace_file_, 1431 startup_trace_file_,
1437 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); 1432 base::Bind(OnStoppedStartupTracing, startup_trace_file_)));
1438 } 1433 }
1439 1434
1440 } // namespace content 1435 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_database.cc ('k') | content/child/blink_platform_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698