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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_MEMORY_OOM_MEMORY_DETAILS_H_
6 #define CHROME_BROWSER_MEMORY_OOM_MEMORY_DETAILS_H_
10 #include "base/callback.h"
11 #include "base/macros.h"
12 #include "base/time/time.h"
13 #include "chrome/browser/memory_details.h"
17 ////////////////////////////////////////////////////////////////////////////////
18 // OomMemoryDetails logs details about all Chrome processes during an out-of-
19 // memory event in an attempt to identify the culprit.
20 class OomMemoryDetails
: public MemoryDetails
{
22 // Logs the memory details asynchronously and then run |callback|.
23 // The |title| is printed at the beginning of the message.
24 static void Log(const std::string
& title
, const base::Closure
& callback
);
27 OomMemoryDetails(const std::string
& title
, const base::Closure
& callback
);
28 ~OomMemoryDetails() override
;
30 // MemoryDetails overrides:
31 void OnDetailsAvailable() override
;
34 base::TimeTicks start_time_
;
35 base::Closure callback_
;
37 DISALLOW_COPY_AND_ASSIGN(OomMemoryDetails
);
42 #endif // CHROME_BROWSER_MEMORY_OOM_MEMORY_DETAILS_H_