Skip to content

Commit

Permalink
Move IPCMessageStart enum into it own file with security team OWNERS,…
Browse files Browse the repository at this point in the history
… so that new message files can't be added to chromium without triggering a security review.

Review URL: https://chromiumcodereview.appspot.com/11048038

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163713 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
tsepez@chromium.org committed Oct 23, 2012
1 parent cd5fff7 commit f950981
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 75 deletions.
11 changes: 6 additions & 5 deletions chrome/common/all_messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
// found in the LICENSE file.

// Multiply-included file, hence no include guard.
// Inclusion of all message files present in chrome. Keep this file
// up-to-date when adding a new value to enum IPCMessageStart in
// ipc/ipc_message_utils.h to include the corresponding message file.
// Messages classes used exclusively outside of chrome should instead get an
// exemption in chrome/tools/ipclist/ipclist.cc.
// Inclusion of all message files present in chrome. Keep this file
// up-to-date when adding a new value to the IPCMessageStart enum in
// ipc/ipc_message_start.h to ensure the corresponding message file is
// included here. Message classes used exclusively outside of chrome
// should not be listed here and instead get an exemption in
// chrome/tools/ipclist/ipclist.cc.
#if !defined(OS_ANDROID)
#include "chrome/browser/importer/profile_import_process_messages.h"
#endif
Expand Down
9 changes: 9 additions & 0 deletions ipc/OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,12 @@ tsepez@chromium.org

# For NaCl-related code (ipc_channel_nacl.*)
dmichael@chromium.org

# New IPC message files require a security review to avoid introducing
# new sandbox escapes.
per-file ipc_message_start.h=set noparent
per-file ipc_message_start.h=cdn@chromium.org
per-file ipc_message_start.h=jln@chromium.org
per-file ipc_message_start.h=jschuh@chromium.org
per-file ipc_message_start.h=palmer@chromium.org
per-file ipc_message_start.h=tsepez@chromium.org
1 change: 1 addition & 0 deletions ipc/ipc.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
'ipc_message.cc',
'ipc_message.h',
'ipc_message_macros.h',
'ipc_message_start.h',
'ipc_message_utils.cc',
'ipc_message_utils.h',
'ipc_param_traits.h',
Expand Down
2 changes: 1 addition & 1 deletion ipc/ipc_message_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//
// Each XXX_messages.h file must be registered with the IPC system. This
// requires adding two things:
// - An XXXMsgStart value to the IPCMessageStart enum in ipc_message_utils.h
// - An XXXMsgStart value to the IPCMessageStart enum in ipc_message_start.h
// - An inclusion of XXX_messages.h file in a message generator .h file
//
// The XXXMsgStart value is an enumeration that ensures uniqueness for
Expand Down
77 changes: 77 additions & 0 deletions ipc/ipc_message_start.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// Copyright 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.

#ifndef IPC_IPC_MESSAGE_START_H_
#define IPC_IPC_MESSAGE_START_H_

// Used by IPC_BEGIN_MESSAGES so that each message class starts from a unique
// base. Messages have unique IDs across channels in order for the IPC logging
// code to figure out the message class from its ID.
enum IPCMessageStart {
AutomationMsgStart = 0,
ViewMsgStart,
PluginMsgStart,
ProfileImportMsgStart,
TestMsgStart,
DevToolsMsgStart,
WorkerMsgStart,
NaClMsgStart,
UtilityMsgStart,
GpuMsgStart,
ServiceMsgStart,
PpapiMsgStart,
FirefoxImporterUnittestMsgStart,
FileUtilitiesMsgStart,
MimeRegistryMsgStart,
DatabaseMsgStart,
DOMStorageMsgStart,
IndexedDBMsgStart,
PepperFileMsgStart,
SpeechRecognitionMsgStart,
PepperMsgStart,
AutofillMsgStart,
SafeBrowsingMsgStart,
P2PMsgStart,
SocketStreamMsgStart,
ResourceMsgStart,
FileSystemMsgStart,
ChildProcessMsgStart,
ClipboardMsgStart,
BlobMsgStart,
AppCacheMsgStart,
DeviceMotionMsgStart,
DeviceOrientationMsgStart,
DesktopNotificationMsgStart,
GeolocationMsgStart,
AudioMsgStart,
ChromeMsgStart,
DragMsgStart,
PrintMsgStart,
SpellCheckMsgStart,
ExtensionMsgStart,
VideoCaptureMsgStart,
QuotaMsgStart,
IconMsgStart,
TextInputClientMsgStart,
ChromeUtilityMsgStart,
MediaStreamMsgStart,
ChromeBenchmarkingMsgStart,
IntentsMsgStart,
JavaBridgeMsgStart,
GamepadMsgStart,
ShellMsgStart,
AccessibilityMsgStart,
PrerenderMsgStart,
ChromotingMsgStart,
OldBrowserPluginMsgStart,
BrowserPluginMsgStart,
HyphenatorMsgStart,
AndroidWebViewMsgStart,
MetroViewerMsgStart,
CCMsgStart,
MediaPlayerMsgStart,
LastIPCMsgStart // Must come last.
};

#endif // IPC_IPC_MESSAGE_START_H_
70 changes: 1 addition & 69 deletions ipc/ipc_message_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "base/stringprintf.h"
#include "base/string_util.h"
#include "base/tuple.h"
#include "ipc/ipc_message_start.h"
#include "ipc/ipc_param_traits.h"
#include "ipc/ipc_sync_message.h"

Expand All @@ -43,75 +44,6 @@
#error "Please add the noinline property for your new compiler here."
#endif

// Used by IPC_BEGIN_MESSAGES so that each message class starts from a unique
// base. Messages have unique IDs across channels in order for the IPC logging
// code to figure out the message class from its ID.
enum IPCMessageStart {
AutomationMsgStart = 0,
ViewMsgStart,
PluginMsgStart,
ProfileImportMsgStart,
TestMsgStart,
DevToolsMsgStart,
WorkerMsgStart,
NaClMsgStart,
UtilityMsgStart,
GpuMsgStart,
ServiceMsgStart,
PpapiMsgStart,
FirefoxImporterUnittestMsgStart,
FileUtilitiesMsgStart,
MimeRegistryMsgStart,
DatabaseMsgStart,
DOMStorageMsgStart,
IndexedDBMsgStart,
PepperFileMsgStart,
SpeechRecognitionMsgStart,
PepperMsgStart,
AutofillMsgStart,
SafeBrowsingMsgStart,
P2PMsgStart,
SocketStreamMsgStart,
ResourceMsgStart,
FileSystemMsgStart,
ChildProcessMsgStart,
ClipboardMsgStart,
BlobMsgStart,
AppCacheMsgStart,
DeviceMotionMsgStart,
DeviceOrientationMsgStart,
DesktopNotificationMsgStart,
GeolocationMsgStart,
AudioMsgStart,
ChromeMsgStart,
DragMsgStart,
PrintMsgStart,
SpellCheckMsgStart,
ExtensionMsgStart,
VideoCaptureMsgStart,
QuotaMsgStart,
IconMsgStart,
TextInputClientMsgStart,
ChromeUtilityMsgStart,
MediaStreamMsgStart,
ChromeBenchmarkingMsgStart,
IntentsMsgStart,
JavaBridgeMsgStart,
GamepadMsgStart,
ShellMsgStart,
AccessibilityMsgStart,
PrerenderMsgStart,
ChromotingMsgStart,
OldBrowserPluginMsgStart,
BrowserPluginMsgStart,
HyphenatorMsgStart,
AndroidWebViewMsgStart,
MetroViewerMsgStart,
CCMsgStart,
MediaPlayerMsgStart,
LastIPCMsgStart // Must come last.
};

class FilePath;
class NullableString16;

Expand Down

0 comments on commit f950981

Please sign in to comment.