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

Side by Side Diff: chrome/common/profiling/memlog_sender.cc

Issue 2949703002: Add OOP memory logging allocator shim (Closed)
Patch Set: More comments 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 #include "chrome/common/profiling/memlog_sender.h"
6
7 #include "base/command_line.h"
8 #include "chrome/common/chrome_switches.h"
9 #include "chrome/common/profiling/memlog_allocator_shim.h"
10 #include "chrome/common/profiling/memlog_sender_pipe.h"
11 #include "chrome/common/profiling/memlog_stream.h"
12
13 namespace profiling {
14
15 void InitMemlogSenderIfNecessary(const base::CommandLine& cmdline) {
16 base::CommandLine::StringType pipe_id =
17 cmdline.GetSwitchValueNative(switches::kMemlogPipe);
18 if (pipe_id.empty())
19 return; // No pipe, don't run.
20
21 static MemlogSenderPipe pipe(pipe_id);
22 pipe.Connect();
23
24 StreamHeader header;
25 header.signature = kStreamSignature;
26
27 pipe.Send(&header, sizeof(StreamHeader));
28
29 InitAllocatorShim(&pipe);
30 }
31
32 } // namespace profiling
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698