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

Side by Side Diff: chrome/profiling/memlog_connection_manager.h

Issue 2943733002: Add out-of-process memory logging stream parsing. (Closed)
Patch Set: Remove version Created 3 years, 6 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
OLDNEW
(Empty)
1 // Copyright 2017 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.
4
5 #ifndef CHROME_PROFILING_MEMLOG_CONNECTION_MANAGER_H_
6 #define CHROME_PROFILING_MEMLOG_CONNECTION_MANAGER_H_
7
8 #include <string>
9
10 #include "base/containers/flat_map.h"
11 #include "base/macros.h"
12 #include "build/build_config.h"
13 #include "chrome/profiling/memlog_receiver_pipe_server.h"
14 #include "chrome/profiling/stack_storage.h"
15
16 namespace base {
17 class SingleThreadTaskRunner;
18 }
19
20 namespace profiling {
21
22 // Manages all connections and logging for each process. Pipes are supplied by
23 // the pipe server and this class will connect them to a parser and logger.
24 class MemlogConnectionManager {
25 public:
26 MemlogConnectionManager();
27 ~MemlogConnectionManager();
28
29 // Starts listening for connections.
30 void StartConnections(const std::string& pipe_id);
31
32 private:
33 struct Connection;
34
35 // Called by the pipe server when a new pipe is created.
36 void OnNewConnection(scoped_refptr<MemlogReceiverPipe> new_pipe);
37
38 // Notification that a connection is complete. Unlike OnNewConnection which
39 // is signaled by the pipe server, this is signaled by the allocation tracker
40 // to ensure that the pipeline for this process has been flushed of all
41 // messages.
42 void OnConnectionComplete(int process_id);
43
44 void OnConnectionCompleteThunk(
45 scoped_refptr<base::SingleThreadTaskRunner> main_loop,
46 int process_id);
47
48 scoped_refptr<MemlogReceiverPipeServer> server_;
49
50 // Maps process ID to the connection information for it.
51 base::flat_map<int, std::unique_ptr<Connection>> connections_;
52
53 DISALLOW_COPY_AND_ASSIGN(MemlogConnectionManager);
54 };
55
56 } // namespace profiling
57
58 #endif // CHROME_PROFILING_MEMLOG_CONNECTION_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698