diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-21 16:04:50 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-21 16:04:50 +0000 |
commit | 7de8404f117520baf2d45cf248c5450fecbb051f (patch) | |
tree | d59b102f318edc94c06e44201696578ebc05a966 /ipc/ipc_message.h | |
parent | 0c6601903f547785adadfbed4856b4fc039d5599 (diff) | |
download | chromium_src-7de8404f117520baf2d45cf248c5450fecbb051f.zip chromium_src-7de8404f117520baf2d45cf248c5450fecbb051f.tar.gz chromium_src-7de8404f117520baf2d45cf248c5450fecbb051f.tar.bz2 |
Make IPC_MESSAGE_EXPORT more robust.
Currently, files that want to export ipc messages currently do
#undef IPC_MESSAGE_EXPORT
#define IPC_MESSAGE_EXPORT CONTENT_EXPORT
at the top, and files that don't want to export ipc messages just do nothing. This is problematic if a cc file does
#include "exported_messages.h"
#include "not_exported_messages.h"
because the second header file picks up the #define from the first file and declares all its messages as exported. In other translation units, where not_exported_messages.h is #included without another header above it, the messages will get default visibility – so the same class ends up with different visibilities in different translation units.
Instead, let ipc_message_macros.h #undef IPC_MESSAGE_EXPORT outside of the include guard, so that all files that don't set the define see it as defined to nothing. (Idea from jam@)
Also disable about:ipc in the component build, since ipc logging adds a dependency from chrome on all ipc message classes, so they would all have to be exported.
BUG=90078
TEST=No linker errors about IPC messages when doing components build on mac. (Other linker errors remain for now.)
TBR=brettw
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=122689
Review URL: http://codereview.chromium.org/9425006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122828 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_message.h')
-rw-r--r-- | ipc/ipc_message.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ipc/ipc_message.h b/ipc/ipc_message.h index b978cf2..b630432 100644 --- a/ipc/ipc_message.h +++ b/ipc/ipc_message.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -12,7 +12,10 @@ #include "base/pickle.h" #include "ipc/ipc_export.h" -#ifndef NDEBUG +// Ipc logging adds a dependency from the 'chrome' target on all ipc message +// classes. In a component build, this would require exporting all message +// classes, so don't support ipc logging in the components build. +#if !defined(NDEBUG) && !defined(COMPONENT_BUILD) #define IPC_MESSAGE_LOG_ENABLED #endif |