 Chromium Code Reviews
 Chromium Code Reviews Issue 2836933002:
  memory-infra: Never kill memory-infra background thread  (Closed)
    
  
    Issue 2836933002:
  memory-infra: Never kill memory-infra background thread  (Closed) 
  | OLD | NEW | 
|---|---|
| 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 #ifndef BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ | 5 #ifndef BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ | 
| 6 #define BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ | 6 #define BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ | 
| 7 | 7 | 
| 8 #include <stdint.h> | 8 #include <stdint.h> | 
| 9 | 9 | 
| 10 #include <map> | 10 #include <map> | 
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 | 238 | 
| 239 MemoryDumpManager(); | 239 MemoryDumpManager(); | 
| 240 virtual ~MemoryDumpManager(); | 240 virtual ~MemoryDumpManager(); | 
| 241 | 241 | 
| 242 static void SetInstanceForTesting(MemoryDumpManager* instance); | 242 static void SetInstanceForTesting(MemoryDumpManager* instance); | 
| 243 static uint32_t GetDumpsSumKb(const std::string&, const ProcessMemoryDump*); | 243 static uint32_t GetDumpsSumKb(const std::string&, const ProcessMemoryDump*); | 
| 244 | 244 | 
| 245 void FinalizeDumpAndAddToTrace( | 245 void FinalizeDumpAndAddToTrace( | 
| 246 std::unique_ptr<ProcessMemoryDumpAsyncState> pmd_async_state); | 246 std::unique_ptr<ProcessMemoryDumpAsyncState> pmd_async_state); | 
| 247 | 247 | 
| 248 // Lazily initializes dump_thread_ and returns its TaskRunner. | |
| 249 scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner(); | |
| 
Primiano Tucci (use gerrit)
2017/04/24 15:30:58
I'd call this GetOrCreateBgTaskRunnerLocked()
"Get
 
hjd
2017/04/24 16:27:59
Done.
 | |
| 250 | |
| 248 // Internal, used only by MemoryDumpManagerDelegate. | 251 // Internal, used only by MemoryDumpManagerDelegate. | 
| 249 // Creates a memory dump for the current process and appends it to the trace. | 252 // Creates a memory dump for the current process and appends it to the trace. | 
| 250 // |callback| will be invoked asynchronously upon completion on the same | 253 // |callback| will be invoked asynchronously upon completion on the same | 
| 251 // thread on which CreateProcessDump() was called. | 254 // thread on which CreateProcessDump() was called. | 
| 252 void CreateProcessDump(const MemoryDumpRequestArgs& args, | 255 void CreateProcessDump(const MemoryDumpRequestArgs& args, | 
| 253 const ProcessMemoryDumpCallback& callback); | 256 const ProcessMemoryDumpCallback& callback); | 
| 254 | 257 | 
| 255 // Calls InvokeOnMemoryDump() for the next MDP on the task runner specified by | 258 // Calls InvokeOnMemoryDump() for the next MDP on the task runner specified by | 
| 256 // the MDP while registration. On failure to do so, skips and continues to | 259 // the MDP while registration. On failure to do so, skips and continues to | 
| 257 // next MDP. | 260 // next MDP. | 
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 339 } | 342 } | 
| 340 | 343 | 
| 341 private: | 344 private: | 
| 342 DISALLOW_COPY_AND_ASSIGN(MemoryDumpManagerDelegate); | 345 DISALLOW_COPY_AND_ASSIGN(MemoryDumpManagerDelegate); | 
| 343 }; | 346 }; | 
| 344 | 347 | 
| 345 } // namespace trace_event | 348 } // namespace trace_event | 
| 346 } // namespace base | 349 } // namespace base | 
| 347 | 350 | 
| 348 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ | 351 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ | 
| OLD | NEW |