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

Side by Side Diff: content/common/content_ipc_logging.cc

Issue 2847003005: Reland "Add enable_ipc_logging build argument" (Closed)
Patch Set: Reland "Add enable_ipc_logging build argument" Created 3 years, 7 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
« no previous file with comments | « content/common/child_process_messages.h ('k') | content/public/browser/browser_ipc_logging.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED.
6
7 #include <stdint.h> 5 #include <stdint.h>
8 6
9 #if defined(IPC_MESSAGE_LOG_ENABLED) 7 #include "ipc/ipc_features.h"
8
9 #if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED)
10 #define IPC_MESSAGE_MACROS_LOG_ENABLED 10 #define IPC_MESSAGE_MACROS_LOG_ENABLED
11 #include "content/public/common/content_ipc_logging.h" 11 #include "content/public/common/content_ipc_logging.h"
12 #define IPC_LOG_TABLE_ADD_ENTRY(msg_id, logger) \ 12 #define IPC_LOG_TABLE_ADD_ENTRY(msg_id, logger) \
13 content::RegisterIPCLogger(msg_id, logger) 13 content::RegisterIPCLogger(msg_id, logger)
14 #include "content/common/all_messages.h" 14 #include "content/common/all_messages.h"
15 #endif
16 15
17 #if defined(IPC_MESSAGE_LOG_ENABLED)
18 16
19 #include "base/containers/hash_tables.h" 17 #include "base/containers/hash_tables.h"
20 #include "base/lazy_instance.h" 18 #include "base/lazy_instance.h"
21 19
22 namespace content { 20 namespace content {
23 21
24 namespace { 22 namespace {
25 23
26 base::LazyInstance<base::hash_map<uint32_t, LogFunction>>::Leaky 24 base::LazyInstance<base::hash_map<uint32_t, LogFunction>>::Leaky
27 g_log_function_mapping = LAZY_INSTANCE_INITIALIZER; 25 g_log_function_mapping = LAZY_INSTANCE_INITIALIZER;
28 26
29 } // namespace 27 } // namespace
30 28
31 void RegisterIPCLogger(uint32_t msg_id, LogFunction logger) { 29 void RegisterIPCLogger(uint32_t msg_id, LogFunction logger) {
32 if (g_log_function_mapping == NULL) 30 if (g_log_function_mapping == NULL)
33 IPC::Logging::set_log_function_map(g_log_function_mapping.Pointer()); 31 IPC::Logging::set_log_function_map(g_log_function_mapping.Pointer());
34 g_log_function_mapping.Get()[msg_id] = logger; 32 g_log_function_mapping.Get()[msg_id] = logger;
35 } 33 }
36 34
37 } // content 35 } // content
38 36
39 #endif 37 #endif // BUILDFLAG(IPC_MESSAGE_LOG_ENABLED)
OLDNEW
« no previous file with comments | « content/common/child_process_messages.h ('k') | content/public/browser/browser_ipc_logging.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698