Add ICU message format support
[chromium-blink-merge.git] / chrome / browser / memory / oom_memory_details.h
blob99f9829aea1c087bf6cdccab44604c8e016fa89e
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_
8 #include <string>
10 #include "base/callback.h"
11 #include "base/macros.h"
12 #include "base/time/time.h"
13 #include "chrome/browser/memory_details.h"
15 namespace memory {
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 {
21 public:
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);
26 private:
27 OomMemoryDetails(const std::string& title, const base::Closure& callback);
28 ~OomMemoryDetails() override;
30 // MemoryDetails overrides:
31 void OnDetailsAvailable() override;
33 std::string title_;
34 base::TimeTicks start_time_;
35 base::Closure callback_;
37 DISALLOW_COPY_AND_ASSIGN(OomMemoryDetails);
40 } // namespace memory
42 #endif // CHROME_BROWSER_MEMORY_OOM_MEMORY_DETAILS_H_