diff --git a/AUTHORS b/AUTHORS index a7aea3e2e9724d..cba672250fc51f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -701,7 +701,6 @@ Suvanjan Mukherjee Swati Jaiswal Sylvain Zimmer Sylvestre Ledru -Szabolcs David Szymon Piechowicz Taehoon Lee Takeshi Kurosawa diff --git a/chrome/common/logging_chrome.cc b/chrome/common/logging_chrome.cc index 8d04bc7cc827e9..e9e51b130ea2b8 100644 --- a/chrome/common/logging_chrome.cc +++ b/chrome/common/logging_chrome.cc @@ -8,13 +8,13 @@ // IPC_MESSAGE_LOG_ENABLED. We need to use it to define // IPC_MESSAGE_MACROS_LOG_ENABLED so render_messages.h will generate the // ViewMsgLog et al. functions. -#include "ipc/ipc_features.h" +#include "ipc/ipc_message.h" // On Windows, the about:ipc dialog shows IPCs; on POSIX, we hook up a // logger in this file. (We implement about:ipc on Mac but implement // the loggers here anyway). We need to do this real early to be sure // IPC_MESSAGE_MACROS_LOG_ENABLED doesn't get undefined. -#if defined(OS_POSIX) && BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#if defined(OS_POSIX) && defined(IPC_MESSAGE_LOG_ENABLED) #define IPC_MESSAGE_MACROS_LOG_ENABLED #include "content/public/common/content_ipc_logging.h" #define IPC_LOG_TABLE_ADD_ENTRY(msg_id, logger) \ diff --git a/chrome/service/service_ipc_server.cc b/chrome/service/service_ipc_server.cc index 872dc60f718e02..bcd3726080471a 100644 --- a/chrome/service/service_ipc_server.cc +++ b/chrome/service/service_ipc_server.cc @@ -22,7 +22,7 @@ ServiceIPCServer::ServiceIPCServer( } bool ServiceIPCServer::Init() { -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#ifdef IPC_MESSAGE_LOG_ENABLED IPC::Logging::GetInstance()->SetIPCSender(this); #endif CreateChannel(); @@ -39,7 +39,7 @@ void ServiceIPCServer::CreateChannel() { } ServiceIPCServer::~ServiceIPCServer() { -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#ifdef IPC_MESSAGE_LOG_ENABLED IPC::Logging::GetInstance()->SetIPCSender(NULL); #endif } diff --git a/content/browser/browser_ipc_logging.cc b/content/browser/browser_ipc_logging.cc index ad323632980ebb..7e7f05e1b70a5b 100644 --- a/content/browser/browser_ipc_logging.cc +++ b/content/browser/browser_ipc_logging.cc @@ -13,7 +13,7 @@ namespace content { -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#if defined(IPC_MESSAGE_LOG_ENABLED) void EnableIPCLoggingForChildProcesses(bool enabled) { DCHECK_CURRENTLY_ON(BrowserThread::IO); @@ -46,6 +46,6 @@ void EnableIPCLogging(bool enable) { i.GetCurrentValue()->Send(new ChildProcessMsg_SetIPCLoggingEnabled(enable)); } -#endif // BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#endif // IPC_MESSAGE_LOG_ENABLED } // namespace content diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 229480dff97ee0..039085c60f5bbc 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -2104,7 +2104,7 @@ void RenderProcessHostImpl::OnChannelConnected(int32_t peer_pid) { observer.RenderProcessReady(this); } -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#if defined(IPC_MESSAGE_LOG_ENABLED) Send(new ChildProcessMsg_SetIPCLoggingEnabled( IPC::Logging::GetInstance()->Enabled())); #endif diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc index a3a73543115d76..f91f11f74e38de 100644 --- a/content/child/child_thread_impl.cc +++ b/content/child/child_thread_impl.cc @@ -414,7 +414,7 @@ void ChildThreadImpl::Init(const Options& options) { g_lazy_tls.Pointer()->Set(this); on_channel_error_called_ = false; message_loop_ = base::MessageLoop::current(); -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#ifdef IPC_MESSAGE_LOG_ENABLED // We must make sure to instantiate the IPC Logger *before* we create the // channel, otherwise we can get a callback on the IO thread which creates // the logger, and the logger does not like being created on the IO thread. @@ -424,7 +424,7 @@ void ChildThreadImpl::Init(const Options& options) { channel_ = IPC::SyncChannel::Create(this, ChildProcess::current()->io_task_runner(), ChildProcess::current()->GetShutDownEvent()); -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#ifdef IPC_MESSAGE_LOG_ENABLED if (!IsInBrowserProcess()) IPC::Logging::GetInstance()->SetIPCSender(this); #endif @@ -570,7 +570,7 @@ void ChildThreadImpl::Init(const Options& options) { } ChildThreadImpl::~ChildThreadImpl() { -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#ifdef IPC_MESSAGE_LOG_ENABLED IPC::Logging::GetInstance()->SetIPCSender(NULL); #endif @@ -720,7 +720,7 @@ bool ChildThreadImpl::OnMessageReceived(const IPC::Message& msg) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(ChildThreadImpl, msg) IPC_MESSAGE_HANDLER(ChildProcessMsg_Shutdown, OnShutdown) -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#if defined(IPC_MESSAGE_LOG_ENABLED) IPC_MESSAGE_HANDLER(ChildProcessMsg_SetIPCLoggingEnabled, OnSetIPCLoggingEnabled) #endif @@ -791,7 +791,7 @@ void ChildThreadImpl::OnShutdown() { base::MessageLoop::current()->QuitWhenIdle(); } -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#if defined(IPC_MESSAGE_LOG_ENABLED) void ChildThreadImpl::OnSetIPCLoggingEnabled(bool enable) { if (enable) IPC::Logging::GetInstance()->Enable(); diff --git a/content/child/child_thread_impl.h b/content/child/child_thread_impl.h index 4b562297ec6b47..a52add3432d813 100644 --- a/content/child/child_thread_impl.h +++ b/content/child/child_thread_impl.h @@ -22,7 +22,7 @@ #include "content/common/content_export.h" #include "content/public/child/child_thread.h" #include "ipc/ipc.mojom.h" -#include "ipc/ipc_features.h" // For BUILDFLAG(IPC_MESSAGE_LOG_ENABLED). +#include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. #include "ipc/ipc_platform_file.h" #include "ipc/message_router.h" #include "mojo/public/cpp/bindings/associated_binding.h" @@ -228,7 +228,7 @@ class CONTENT_EXPORT ChildThreadImpl void OnSetProfilerStatus(tracked_objects::ThreadData::Status status); void OnGetChildProfilerData(int sequence_number, int current_profiling_phase); void OnProfilingPhaseCompleted(int profiling_phase); -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#ifdef IPC_MESSAGE_LOG_ENABLED void OnSetIPCLoggingEnabled(bool enable); #endif diff --git a/content/common/child_process_host_impl.cc b/content/common/child_process_host_impl.cc index 3ea245b13dc24a..7e8e4203ad32da 100644 --- a/content/common/child_process_host_impl.cc +++ b/content/common/child_process_host_impl.cc @@ -158,7 +158,7 @@ bool ChildProcessHostImpl::InitChannel() { delegate_->OnChannelInitialized(channel_.get()); // Make sure these messages get sent first. -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#if defined(IPC_MESSAGE_LOG_ENABLED) bool enabled = IPC::Logging::GetInstance()->Enabled(); Send(new ChildProcessMsg_SetIPCLoggingEnabled(enabled)); #endif @@ -214,7 +214,7 @@ uint64_t ChildProcessHostImpl::ChildProcessUniqueIdToTracingProcessId( } bool ChildProcessHostImpl::OnMessageReceived(const IPC::Message& msg) { -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#ifdef IPC_MESSAGE_LOG_ENABLED IPC::Logging* logger = IPC::Logging::GetInstance(); if (msg.type() == IPC_LOGGING_ID) { logger->OnReceivedLoggingMessage(msg); @@ -245,7 +245,7 @@ bool ChildProcessHostImpl::OnMessageReceived(const IPC::Message& msg) { handled = delegate_->OnMessageReceived(msg); } -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#ifdef IPC_MESSAGE_LOG_ENABLED if (logger->Enabled()) logger->OnPostDispatchMessage(msg); #endif diff --git a/content/common/child_process_messages.h b/content/common/child_process_messages.h index ea71aa7696000e..8c7151c567dddc 100644 --- a/content/common/child_process_messages.h +++ b/content/common/child_process_messages.h @@ -20,7 +20,6 @@ #include "gpu/command_buffer/common/sync_token.h" #include "gpu/ipc/common/gpu_param_traits_macros.h" #include "ipc/ipc_channel_handle.h" -#include "ipc/ipc_features.h" #include "ipc/ipc_message_macros.h" #include "ipc/ipc_platform_file.h" #include "ui/gfx/gpu_memory_buffer.h" @@ -92,7 +91,7 @@ IPC_ENUM_TRAITS_MAX_VALUE(base::ThreadPriority, // process that it's safe to shutdown. IPC_MESSAGE_CONTROL0(ChildProcessMsg_Shutdown) -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#if defined(IPC_MESSAGE_LOG_ENABLED) // Tell the child process to begin or end IPC message logging. IPC_MESSAGE_CONTROL1(ChildProcessMsg_SetIPCLoggingEnabled, bool /* on or off */) diff --git a/content/common/content_ipc_logging.cc b/content/common/content_ipc_logging.cc index 50788e358bcb57..2012f07c3ac667 100644 --- a/content/common/content_ipc_logging.cc +++ b/content/common/content_ipc_logging.cc @@ -2,17 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include +#include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. -#include "ipc/ipc_features.h" +#include -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#if defined(IPC_MESSAGE_LOG_ENABLED) #define IPC_MESSAGE_MACROS_LOG_ENABLED #include "content/public/common/content_ipc_logging.h" #define IPC_LOG_TABLE_ADD_ENTRY(msg_id, logger) \ content::RegisterIPCLogger(msg_id, logger) #include "content/common/all_messages.h" +#endif +#if defined(IPC_MESSAGE_LOG_ENABLED) #include "base/containers/hash_tables.h" #include "base/lazy_instance.h" @@ -34,4 +36,4 @@ void RegisterIPCLogger(uint32_t msg_id, LogFunction logger) { } // content -#endif // BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#endif diff --git a/content/public/browser/browser_ipc_logging.h b/content/public/browser/browser_ipc_logging.h index bcbd0b171ad2c3..f05af129f6b115 100644 --- a/content/public/browser/browser_ipc_logging.h +++ b/content/public/browser/browser_ipc_logging.h @@ -6,11 +6,11 @@ #define CONTENT_PUBLIC_BROWSER_BROWSER_IPC_LOGGING_H_ #include "content/common/content_export.h" -#include "ipc/ipc_features.h" +#include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. namespace content { -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#if defined(IPC_MESSAGE_LOG_ENABLED) // Enable or disable IPC logging for the browser, all processes // derived from ChildProcess (plugin etc), and all diff --git a/content/public/common/content_ipc_logging.h b/content/public/common/content_ipc_logging.h index e92d672ad734e7..4508428a8b3901 100644 --- a/content/public/common/content_ipc_logging.h +++ b/content/public/common/content_ipc_logging.h @@ -5,6 +5,8 @@ #ifndef CONTENT_PUBLIC_COMMON_CONTENT_IPC_LOGGING_H_ #define CONTENT_PUBLIC_COMMON_CONTENT_IPC_LOGGING_H_ +#include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. + #include #include "content/common/content_export.h" @@ -12,7 +14,7 @@ namespace content { -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#if defined(IPC_MESSAGE_LOG_ENABLED) // Register a logger for the given IPC message. Use // diff --git a/content/shell/app/shell_main_delegate.cc b/content/shell/app/shell_main_delegate.cc index f850c4e5beb416..b3efdc1ec5c0de 100644 --- a/content/shell/app/shell_main_delegate.cc +++ b/content/shell/app/shell_main_delegate.cc @@ -12,7 +12,6 @@ #include "base/lazy_instance.h" #include "base/logging.h" #include "base/path_service.h" -#include "base/trace_event/trace_log.h" #include "build/build_config.h" #include "cc/base/switches.h" #include "content/common/content_constants_internal.h" @@ -35,7 +34,6 @@ #include "content/shell/renderer/shell_content_renderer_client.h" #include "content/shell/utility/shell_content_utility_client.h" #include "gpu/config/gpu_switches.h" -#include "ipc/ipc_features.h" #include "media/base/media_switches.h" #include "media/base/mime_util.h" #include "net/cookies/cookie_monster.h" @@ -47,7 +45,9 @@ #include "ui/gl/gl_implementation.h" #include "ui/gl/gl_switches.h" -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. + +#if defined(IPC_MESSAGE_LOG_ENABLED) #define IPC_MESSAGE_MACROS_LOG_ENABLED #include "content/public/common/content_ipc_logging.h" #define IPC_LOG_TABLE_ADD_ENTRY(msg_id, logger) \ diff --git a/ipc/BUILD.gn b/ipc/BUILD.gn index b0a00acf2d4d18..7c60bb18dd12e4 100644 --- a/ipc/BUILD.gn +++ b/ipc/BUILD.gn @@ -2,23 +2,11 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/buildflag_header.gni") import("//build/config/nacl/config.gni") import("//mojo/public/tools/bindings/mojom.gni") import("//testing/test.gni") import("//tools/ipc_fuzzer/ipc_fuzzer.gni") -declare_args() { - # Enabling debug builds automatically sets enable_ipc_logging to true. - enable_ipc_logging = is_debug -} - -buildflag_header("ipc_features") { - header = "ipc_features.h" - - flags = [ "IPC_MESSAGE_LOG_ENABLED=$enable_ipc_logging" ] -} - component("ipc") { sources = [ "export_template.h", @@ -108,7 +96,6 @@ component("ipc") { defines = [ "IPC_IMPLEMENTATION" ] public_deps = [ - ":ipc_features", ":mojom", ":param_traits", "//mojo/public/cpp/bindings", diff --git a/ipc/ipc_channel_nacl.cc b/ipc/ipc_channel_nacl.cc index b95f8cb5453f74..17b680ed37afcd 100644 --- a/ipc/ipc_channel_nacl.cc +++ b/ipc/ipc_channel_nacl.cc @@ -199,9 +199,9 @@ bool ChannelNacl::Send(Message* message) { << " with type " << message->type(); std::unique_ptr message_ptr(message); -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#ifdef IPC_MESSAGE_LOG_ENABLED Logging::GetInstance()->OnSendMessage(message_ptr.get()); -#endif // BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#endif // IPC_MESSAGE_LOG_ENABLED TRACE_EVENT_WITH_FLOW0(TRACE_DISABLED_BY_DEFAULT("ipc.flow"), "ChannelNacl::Send", diff --git a/ipc/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc index 1c3de84cdd1e5f..ef1c0b2272511d 100644 --- a/ipc/ipc_channel_proxy.cc +++ b/ipc/ipc_channel_proxy.cc @@ -78,7 +78,7 @@ void ChannelProxy::Context::CreateChannel( bool ChannelProxy::Context::TryFilters(const Message& message) { DCHECK(message_filter_router_); -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#ifdef IPC_MESSAGE_LOG_ENABLED Logging* logger = Logging::GetInstance(); if (logger->Enabled()) logger->OnPreDispatchMessage(message); @@ -89,7 +89,7 @@ bool ChannelProxy::Context::TryFilters(const Message& message) { listener_task_runner_->PostTask( FROM_HERE, base::Bind(&Context::OnDispatchBadMessage, this, message)); } -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#ifdef IPC_MESSAGE_LOG_ENABLED if (logger->Enabled()) logger->OnPostDispatchMessage(message); #endif @@ -315,7 +315,7 @@ void ChannelProxy::Context::OnDispatchMessage(const Message& message) { OnDispatchConnected(); -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#ifdef IPC_MESSAGE_LOG_ENABLED Logging* logger = Logging::GetInstance(); if (message.type() == IPC_LOGGING_ID) { logger->OnReceivedLoggingMessage(message); @@ -330,7 +330,7 @@ void ChannelProxy::Context::OnDispatchMessage(const Message& message) { if (message.dispatch_error()) listener_->OnBadMessageReceived(message); -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#ifdef IPC_MESSAGE_LOG_ENABLED if (logger->Enabled()) logger->OnPostDispatchMessage(message); #endif @@ -530,7 +530,7 @@ bool ChannelProxy::Send(Message* message) { message = outgoing_message_filter()->Rewrite(message); #endif -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#ifdef IPC_MESSAGE_LOG_ENABLED Logging::GetInstance()->OnSendMessage(message); #endif diff --git a/ipc/ipc_channel_reader.cc b/ipc/ipc_channel_reader.cc index e999028a6f3b6e..fa26734c314c8a 100644 --- a/ipc/ipc_channel_reader.cc +++ b/ipc/ipc_channel_reader.cc @@ -20,7 +20,7 @@ namespace IPC { namespace internal { -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#ifdef IPC_MESSAGE_LOG_ENABLED namespace { std::string GetMessageText(const Message& message) { @@ -42,7 +42,7 @@ std::string GetMessageText(const Message& message) { (message).flags(), TRACE_EVENT_FLAG_FLOW_IN, "class", \ IPC_MESSAGE_ID_CLASS((message).type()), "line", \ IPC_MESSAGE_ID_LINE((message).type())); -#endif // BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#endif // IPC_MESSAGE_LOG_ENABLED ChannelReader::ChannelReader(Listener* listener) : listener_(listener), diff --git a/ipc/ipc_logging.cc b/ipc/ipc_logging.cc index aad1b73326ae32..af532cd318e7b8 100644 --- a/ipc/ipc_logging.cc +++ b/ipc/ipc_logging.cc @@ -4,7 +4,7 @@ #include "ipc/ipc_logging.h" -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#ifdef IPC_MESSAGE_LOG_ENABLED #define IPC_MESSAGE_MACROS_LOG_ENABLED #endif @@ -31,7 +31,7 @@ #include #endif -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#ifdef IPC_MESSAGE_LOG_ENABLED using base::Time; @@ -310,4 +310,4 @@ void GenerateLogData(const Message& message, LogData* data, bool get_params) { } -#endif // BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#endif // IPC_MESSAGE_LOG_ENABLED diff --git a/ipc/ipc_logging.h b/ipc/ipc_logging.h index 929f55e50a9c8e..af490f0c91e7fc 100644 --- a/ipc/ipc_logging.h +++ b/ipc/ipc_logging.h @@ -5,11 +5,12 @@ #ifndef IPC_IPC_LOGGING_H_ #define IPC_IPC_LOGGING_H_ -#include "ipc/ipc_features.h" +#include -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. + +#ifdef IPC_MESSAGE_LOG_ENABLED -#include #include #include "base/containers/hash_tables.h" @@ -17,7 +18,6 @@ #include "base/memory/singleton.h" #include "base/single_thread_task_runner.h" #include "ipc/ipc_export.h" -#include "ipc/ipc_message.h" // Logging function. |name| is a string in ASCII and |params| is a string in // UTF-8. @@ -123,6 +123,6 @@ class IPC_EXPORT Logging { } // namespace IPC -#endif // BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#endif // IPC_MESSAGE_LOG_ENABLED #endif // IPC_IPC_LOGGING_H_ diff --git a/ipc/ipc_message.cc b/ipc/ipc_message.cc index f66b4fe882c60a..f5e9ac7a8b807c 100644 --- a/ipc/ipc_message.cc +++ b/ipc/ipc_message.cc @@ -82,7 +82,7 @@ Message::Message(const Message& other) : base::Pickle(other) { void Message::Init() { dispatch_error_ = false; -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#ifdef IPC_MESSAGE_LOG_ENABLED received_time_ = 0; dont_log_ = false; log_data_ = NULL; @@ -109,7 +109,7 @@ void Message::EnsureMessageAttachmentSet() { attachment_set_ = new MessageAttachmentSet; } -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#ifdef IPC_MESSAGE_LOG_ENABLED void Message::set_sent_time(int64_t time) { DCHECK((header()->flags & HAS_SENT_TIME_BIT) == 0); header()->flags |= HAS_SENT_TIME_BIT; @@ -128,7 +128,7 @@ int64_t Message::sent_time() const { void Message::set_received_time(int64_t time) const { received_time_ = time; } -#endif // BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#endif Message::NextMessageInfo::NextMessageInfo() : message_size(0), message_found(false), pickle_end(nullptr), diff --git a/ipc/ipc_message.h b/ipc/ipc_message.h index 3ca75482b189bb..43e9ae39c13d96 100644 --- a/ipc/ipc_message.h +++ b/ipc/ipc_message.h @@ -16,7 +16,10 @@ #include "base/trace_event/trace_event.h" #include "build/build_config.h" #include "ipc/ipc_export.h" -#include "ipc/ipc_features.h" + +#if !defined(NDEBUG) +#define IPC_MESSAGE_LOG_ENABLED +#endif namespace IPC { @@ -204,7 +207,7 @@ class IPC_EXPORT Message : public base::Pickle { // Returns true if there are any attachment in this message. bool HasAttachments() const override; -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#ifdef IPC_MESSAGE_LOG_ENABLED // Adds the outgoing time from Time::Now() at the end of the message and sets // a bit to indicate that it's been added. void set_sent_time(int64_t time); @@ -272,7 +275,7 @@ class IPC_EXPORT Message : public base::Pickle { return attachment_set_.get(); } -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#ifdef IPC_MESSAGE_LOG_ENABLED // Used for logging. mutable int64_t received_time_; mutable std::string output_params_; diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h index 044c000e90c73b..2d51c984aa0c0f 100644 --- a/ipc/ipc_message_utils.h +++ b/ipc/ipc_message_utils.h @@ -1100,7 +1100,7 @@ IPC_EXPORT void GenerateLogData(const Message& message, LogData* data, bool get_params); -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#if defined(IPC_MESSAGE_LOG_ENABLED) inline void AddOutputParamsToLog(const Message* msg, std::string* l) { const std::string& output_params = msg->output_params(); if (!l->empty() && !output_params.empty()) diff --git a/ipc/ipc_sync_channel.cc b/ipc/ipc_sync_channel.cc index ccfd8ee8787e07..0d61e08ce945b0 100644 --- a/ipc/ipc_sync_channel.cc +++ b/ipc/ipc_sync_channel.cc @@ -578,7 +578,7 @@ scoped_refptr SyncChannel::CreateSyncMessageFilter() { } bool SyncChannel::Send(Message* message) { -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) +#ifdef IPC_MESSAGE_LOG_ENABLED std::string name; Logging::GetInstance()->GetMessageText( message->type(), &name, message, nullptr); diff --git a/ppapi/nacl_irt/irt_ppapi.cc b/ppapi/nacl_irt/irt_ppapi.cc index b32f83a5b0eff3..d7ed0690f4a401 100644 --- a/ppapi/nacl_irt/irt_ppapi.cc +++ b/ppapi/nacl_irt/irt_ppapi.cc @@ -3,6 +3,10 @@ // found in the LICENSE file. #include "build/build_config.h" +// Need to include this before most other files because it defines +// IPC_MESSAGE_LOG_ENABLED. We need to use it to define +// IPC_MESSAGE_MACROS_LOG_ENABLED so ppapi_messages.h will generate the +// ViewMsgLog et al. functions. #include