summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_message.cc
Commit message (Collapse)AuthorAgeFilesLines
* Switch to standard integer types in ipc/.avi2015-12-221-0/+2
| | | | | | | | | BUG=138542 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1546533002 Cr-Commit-Position: refs/heads/master@{#366527}
* ipc: USE_ATTACHMENT_BROKER should apply to both Windows and OSX.erikchen2015-12-041-2/+2
| | | | | | | | | | | | Previously, many uses of the preprocessor conditional were restricted to OSX, since the Windows version of IPC::Message::Header did not have the num_brokered_attachments field. BUG=493414 Review URL: https://codereview.chromium.org/1494623003 Cr-Commit-Position: refs/heads/master@{#363155}
* Add the field num_brokered_attachments to IPC::Message::Header on Windows.erikchen2015-12-031-2/+2
| | | | | | | | | | | | This CL adds the field and initializes it to 0. It has no other effect. This is probably going to cause some assertions to fail, due to interactions with third-party software. See the associated bugs for more details. BUG=527588, 493414 Review URL: https://codereview.chromium.org/1500453002 Cr-Commit-Position: refs/heads/master@{#363047}
* IPC: Remove unnecessary conversions of BrokerableAttachment.erikchen2015-10-291-4/+3
| | | | | | | | | | | | | | BrokerableAttachments are typically stored and passed around in a scoped_refptr. There were several locations where they were being unnecessarily converted to a raw pointer. This was probably responsible for a non-deterministic crash on GPU bots (https://code.google.com/p/chromium/issues/detail?id=535711#c28), although I haven't been able to reproduce the problem locally. BUG=535711 Review URL: https://codereview.chromium.org/1414503009 Cr-Commit-Position: refs/heads/master@{#356968}
* ipc: Allow attachment broker messages to be processed out of order.erikchen2015-10-211-0/+2
| | | | | | | | | | | | | | | | | There are no ordering restrictions on messages destined for the attachment broker, and the message may be needed to dispatch messages waiting in |message_queue_|. This CL introduces a small behavioral change ot ChannelReader - messages for the attachment broker are processed immediately. This CL also includes a small refactor of ChannelReader to split the function TranslateInputData into several, smaller, better documented functions. BUG=535711 Review URL: https://codereview.chromium.org/1421473004 Cr-Commit-Position: refs/heads/master@{#355411}
* Revert of ipc: Add a member to IPC::Message::Header on Windows. (patchset #1 ↵erikchen2015-10-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | id:1 of https://codereview.chromium.org/1400713002/ ) Reason for revert: Likely causes crashes: https://code.google.com/p/chromium/issues/detail?id=527588#c57 Original issue's description: > ipc: Add a member to IPC::Message::Header on Windows. > > According to my most recent debugging experiments, the root cause of the crashes > that happened the first time I tried to make this change have magically > disappeared. See the bug for more details. > > BUG=527588 > > Committed: https://crrev.com/c32bea67c022c6c385463f0eec027f18b2915300 > Cr-Commit-Position: refs/heads/master@{#354889} TBR=tsepez@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=527588 Review URL: https://codereview.chromium.org/1414293002 Cr-Commit-Position: refs/heads/master@{#355089}
* ipc: Add a member to IPC::Message::Header on Windows.erikchen2015-10-191-2/+2
| | | | | | | | | | | | According to my most recent debugging experiments, the root cause of the crashes that happened the first time I tried to make this change have magically disappeared. See the bug for more details. BUG=527588 Review URL: https://codereview.chromium.org/1400713002 Cr-Commit-Position: refs/heads/master@{#354889}
* ipc: Make a separate vector for brokerable attachments.erikchen2015-10-101-6/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Mac, an IPC::Message can have both non-brokered and brokered attachments. During Message serialization, an index of the attachment is written as a placeholder for the attachment. This relies on the assumption that there exists a well defined ordering for all attachments. The receiving processes multiplexes brokered and non-brokered attachments across different communication mediums, and the ordering between them is non-deterministic. I changed MessageAttachmentSet to have two vectors - one for brokered attachments and one for non-brokered attachments. During Message serialization, a bool is written that indicates whether the attachment is brokered, and then an index into the appropriate vector. I decided not to add an equivalent of |consumed_descriptor_highwater_| for brokered attachments for two reasons: 1) The sender has clearer ownership semantics for brokered attachments, and they will clean themselves up appropriately without assistance from the MessageAttachmentSet. 2) Ownership semantics are fundamentally broken in the receiver, since the semantics for Message translation are stateless, whereas ownership transfer is stateful. Note the presence of awkward hacks for |consumed_descriptor_highwater_|, for which there is no good solution. BUG=535711 Review URL: https://codereview.chromium.org/1401473002 Cr-Commit-Position: refs/heads/master@{#353457}
* ipc: Add missing includes for USE_ATTACHMENT_BROKER.erikchen2015-10-101-2/+3
| | | | | | | | | | | The preprocessor variable is defined in ipc/attachment_broker.h. There were three files that were using the variable without including the header. BUG=535711 Review URL: https://codereview.chromium.org/1392713004 Cr-Commit-Position: refs/heads/master@{#353448}
* ipc: Update MachPortMac ownership semantics.erikchen2015-10-071-2/+2
| | | | | | | | | | | | | | | This CL consists of a small refactor, a small change in ownership semantics, and a lot of documentation. The refactor removes a |const| qualifier from brokerable message attachments that are passed to the attachment broker. This allows for an improvement to ownership semantics for MachPortMac. BUG=535711 Review URL: https://codereview.chromium.org/1385143002 Cr-Commit-Position: refs/heads/master@{#352938}
* Resize IPC input buffer to fit the next message.dskiba2015-09-301-10/+31
| | | | | | | | | | | | Sometimes we can get IPC message size from its header. In those cases we resize IPC::ChannelReader' overflow buffer to fit the entire message to avoid growing / reallocating it as we receive message's data. BUG=529940 Review URL: https://codereview.chromium.org/1345353004 Cr-Commit-Position: refs/heads/master@{#351586}
* ipc: Add a new field num_brokered_attachments to the message header on Mac.erikchen2015-09-291-0/+6
| | | | | | | | | | This will be used for attachment brokering on Mac. BUG=535711 Review URL: https://codereview.chromium.org/1373133003 Cr-Commit-Position: refs/heads/master@{#351341}
* Revert of Reland debugging for ipc related crash.erikchen2015-09-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reason for revert: Once again, seeing crashes. https://crash.corp.google.com/browse?q=product.name%3D%27Chrome%27%20AND%20product.version%3D%2747.0.2517.0%27%20AND%20custom_data.ChromeCrashProto.ptype%3D%27renderer%27 Original issue's description: > Reland of land debugging for ipc related crash. (patchset #1 id:1 of https://codereview.chromium.org/1354863004/ ) > > Reason for revert: > Relanding this CL, as I don't think it will actually cause crashes. > > https://code.google.com/p/chromium/issues/detail?id=524032#c27 > > Original issue's description: > > Revert of Reland debugging for ipc related crash. (patchset #1 id:1 of https://codereview.chromium.org/1354063002/ ) > > > > Reason for revert: > > Supposedly, this CL only changes the signature of the crash, not the presence of the crash. There is some (but not totally clear) evidence that this CL is causing a crash itself. > > > > https://code.google.com/p/chromium/issues/detail?id=527588#c32 > > > > Original issue's description: > > > Reland debugging for ipc related crash. > > > > > > This CL is almost identical to https://codereview.chromium.org/1350823002/. The > > > only difference is that the part of the CL that causes the crash has been > > > omitted. > > > > > > BUG=527588 > > > > > > Committed: https://crrev.com/a7502c6dff276bce3c76d680c5d613cb6ece19be > > > Cr-Commit-Position: refs/heads/master@{#349828} > > > > TBR=avi@chromium.org,tsepez@chromium.org > > NOPRESUBMIT=true > > NOTREECHECKS=true > > NOTRY=true > > BUG=527588 > > > > Committed: https://crrev.com/dbc8c1869a4fd0493150c008106be720eba86205 > > Cr-Commit-Position: refs/heads/master@{#350062} > > TBR=avi@chromium.org,tsepez@chromium.org > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=527588 > > Committed: https://crrev.com/a8b611fd4d40c8be9d65a16853fcfb572e3302cd > Cr-Commit-Position: refs/heads/master@{#350203} TBR=avi@chromium.org,tsepez@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=527588 Review URL: https://codereview.chromium.org/1367543002 Cr-Commit-Position: refs/heads/master@{#350346}
* ipc: Serialize brokerable attachments and append them to the message.erikchen2015-09-221-0/+21
| | | | | | | | | | | | The ids of the brokerable attachments are appended to the message. This allows the receiving side of the IPC channel to broker the attachments without needing to translate the message. BUG=493414 Review URL: https://codereview.chromium.org/1323623002 Cr-Commit-Position: refs/heads/master@{#350252}
* Reland of land debugging for ipc related crash. (patchset #1 id:1 of ↵erikchen2015-09-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1354863004/ ) Reason for revert: Relanding this CL, as I don't think it will actually cause crashes. https://code.google.com/p/chromium/issues/detail?id=524032#c27 Original issue's description: > Revert of Reland debugging for ipc related crash. (patchset #1 id:1 of https://codereview.chromium.org/1354063002/ ) > > Reason for revert: > Supposedly, this CL only changes the signature of the crash, not the presence of the crash. There is some (but not totally clear) evidence that this CL is causing a crash itself. > > https://code.google.com/p/chromium/issues/detail?id=527588#c32 > > Original issue's description: > > Reland debugging for ipc related crash. > > > > This CL is almost identical to https://codereview.chromium.org/1350823002/. The > > only difference is that the part of the CL that causes the crash has been > > omitted. > > > > BUG=527588 > > > > Committed: https://crrev.com/a7502c6dff276bce3c76d680c5d613cb6ece19be > > Cr-Commit-Position: refs/heads/master@{#349828} > > TBR=avi@chromium.org,tsepez@chromium.org > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=527588 > > Committed: https://crrev.com/dbc8c1869a4fd0493150c008106be720eba86205 > Cr-Commit-Position: refs/heads/master@{#350062} TBR=avi@chromium.org,tsepez@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=527588 Review URL: https://codereview.chromium.org/1359933002 Cr-Commit-Position: refs/heads/master@{#350203}
* Revert of Reland debugging for ipc related crash. (patchset #1 id:1 of ↵erikchen2015-09-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1354063002/ ) Reason for revert: Supposedly, this CL only changes the signature of the crash, not the presence of the crash. There is some (but not totally clear) evidence that this CL is causing a crash itself. https://code.google.com/p/chromium/issues/detail?id=527588#c32 Original issue's description: > Reland debugging for ipc related crash. > > This CL is almost identical to https://codereview.chromium.org/1350823002/. The > only difference is that the part of the CL that causes the crash has been > omitted. > > BUG=527588 > > Committed: https://crrev.com/a7502c6dff276bce3c76d680c5d613cb6ece19be > Cr-Commit-Position: refs/heads/master@{#349828} TBR=avi@chromium.org,tsepez@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=527588 Review URL: https://codereview.chromium.org/1354863004 Cr-Commit-Position: refs/heads/master@{#350062}
* Reland debugging for ipc related crash.erikchen2015-09-191-2/+2
| | | | | | | | | | | | This CL is almost identical to https://codereview.chromium.org/1350823002/. The only difference is that the part of the CL that causes the crash has been omitted. BUG=527588 Review URL: https://codereview.chromium.org/1354063002 Cr-Commit-Position: refs/heads/master@{#349828}
* Revert of Reland #2 "ipc: Add a new field num_brokered_attachments to the ↵erikchen2015-09-161-14/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | message header." (patchset #5 id:80001 of https://codereview.chromium.org/1334593002/ ) Reason for revert: CL was only ever intended to be in 1 canary release. Original issue's description: > Reland #2 "ipc: Add a new field num_brokered_attachments to the message header." > > This original version of this CL is causing an unusual crash in Canary. This CL > adds a message verifier to the ipc code so that it can dynamically verify the > contents of this message that is being corrupted. This CL also verifies the > message at several different points in the dispatch process. This will help > narrow down the range of code that is corrupting the message. > > I expect this CL to cause ~100 crashes in the next Chrome Canary. I intend to > revert this CL after a single Canary release. > > BUG=527588 > > Committed: https://crrev.com/a2e71be46dc4bdcbb544db479680f65a390ae8f3 > Cr-Commit-Position: refs/heads/master@{#349056} TBR=avi@chromium.org,tsepez@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=527588 Review URL: https://codereview.chromium.org/1350823002 Cr-Commit-Position: refs/heads/master@{#349152}
* Reland #2 "ipc: Add a new field num_brokered_attachments to the message header."erikchen2015-09-161-2/+14
| | | | | | | | | | | | | | | | | This original version of this CL is causing an unusual crash in Canary. This CL adds a message verifier to the ipc code so that it can dynamically verify the contents of this message that is being corrupted. This CL also verifies the message at several different points in the dispatch process. This will help narrow down the range of code that is corrupting the message. I expect this CL to cause ~100 crashes in the next Chrome Canary. I intend to revert this CL after a single Canary release. BUG=527588 Review URL: https://codereview.chromium.org/1334593002 Cr-Commit-Position: refs/heads/master@{#349056}
* ipc: Make a new class PlaceholderBrokerableAttachment.erikchen2015-09-151-0/+8
| | | | | | | | | | | | | Instances of this class need to be replaced before the message can be dispatched. This mechanism is a lot cleaner than the previous mechanism, which had an "unbrokered" state for every type of BrokerableAttachment, which had to be mutated before being dispatched. BUG=493414 Review URL: https://codereview.chromium.org/1317093007 Cr-Commit-Position: refs/heads/master@{#348952}
* ipc: Update Message::FindNext to parse brokered attachments.erikchen2015-09-111-0/+53
| | | | | | | | | | | The method Message::FindNext now takes an output parameter NextMessageInfo which contains additional metadata needed for generating brokered attachments. BUG=493414 Review URL: https://codereview.chromium.org/1308613006 Cr-Commit-Position: refs/heads/master@{#348459}
* ipc: Convert int types from basictypes.h to the ones from stdint.htfarina2015-09-041-10/+10
| | | | | | | | | | | | | | Now that the supported toolchain has stdint.h, use the integer types from this standard header file. BUG=138542 TEST=ipc_tests R=tsepez@chromium.org TBR=sadrul@chromium.org # for ui/ Review URL: https://codereview.chromium.org/1322253003 Cr-Commit-Position: refs/heads/master@{#347457}
* Revert of Reland #1 "ipc: Add a new field num_brokered_attachments to the ↵erikchen2015-09-041-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | message header." (patchset #4 id:60001 of https://codereview.chromium.org/1330563002/ ) Reason for revert: This CL was only ever intended to make it into one Canary. Original issue's description: > Reland #1 "ipc: Add a new field num_brokered_attachments to the message header." > > This otherwise innocuous CL is causing an unusual crash in Canary. At first > glance, the crash appears related to IPC, but further digging indicates that > it's probably related to corruption of a ResourceBuffer. I've updated that class > to use CHECKs instead of DCHECKs https://codereview.chromium.org/1325153002/. > > I expect this CL to cause ~100 crashes in the next Chrome Canary. I intend to > revert this CL after a single Canary release. This CL will help me better > diagnose the exact nature of the crash. > > BUG=493414 > > Committed: https://crrev.com/d32c32bef61d80f68208e550ace18f50f1c498d1 > Cr-Commit-Position: refs/heads/master@{#347250} TBR=tsepez@chromium.org,avi@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=493414 Review URL: https://codereview.chromium.org/1314803005 Cr-Commit-Position: refs/heads/master@{#347429}
* Reland #1 "ipc: Add a new field num_brokered_attachments to the message header."erikchen2015-09-031-0/+12
| | | | | | | | | | | | | | | | | This otherwise innocuous CL is causing an unusual crash in Canary. At first glance, the crash appears related to IPC, but further digging indicates that it's probably related to corruption of a ResourceBuffer. I've updated that class to use CHECKs instead of DCHECKs https://codereview.chromium.org/1325153002/. I expect this CL to cause ~100 crashes in the next Chrome Canary. I intend to revert this CL after a single Canary release. This CL will help me better diagnose the exact nature of the crash. BUG=493414 Review URL: https://codereview.chromium.org/1330563002 Cr-Commit-Position: refs/heads/master@{#347250}
* Revert of ipc: Add a new field num_brokered_attachments to the message ↵erikchen2015-09-011-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | header. (patchset #1 id:1 of https://codereview.chromium.org/1311673011/ ) Reason for revert: Causes crashes on Canary: https://code.google.com/p/chromium/issues/detail?id=524032 Original issue's description: > ipc: Add a new field num_brokered_attachments to the message header. > > BUG=493414 > > Committed: https://crrev.com/9e3e945e56139cf34634dc21ad25a67fc5507590 > Cr-Commit-Position: refs/heads/master@{#346426} TBR=tsepez@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=493414 Review URL: https://codereview.chromium.org/1326703002 Cr-Commit-Position: refs/heads/master@{#346692}
* ipc: Add a new field num_brokered_attachments to the message header.erikchen2015-08-311-0/+12
| | | | | | | | BUG=493414 Review URL: https://codereview.chromium.org/1311673011 Cr-Commit-Position: refs/heads/master@{#346426}
* Revert of IPC: Add attachment brokering support to the message header. ↵erikchen2015-08-271-88/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (patchset #3 id:40001 of https://codereview.chromium.org/1303103002/ ) Reason for revert: Reverting on suspicion of causing crashes in Canary. https://code.google.com/p/chromium/issues/detail?id=524032 Original issue's description: > Reland #1: IPC: Add attachment brokering support to the message header. > > This reland fixes a race condition in the unit test SendHandleTwice that caused > the test to flakily fail, mostly on XP machines. This reland also updates switch > statements to contain a block for the newly added enum > BrokerableAttachment::PLACEHOLDER, which was causing problems with the clang > Windows build. > > > Message dispatch happens before message translation, and message dispatch > > requires that all brokered attachments have been received. This means that > > attachment brokering needs to function without message translation. This is > > accomplished by modifying the message header to include a new field > > num_brokered_attachments, and writing the attachment ids into the IPC Channel > > immediately following the pickled message itself. > > > > AttachmentBrokerPrivilegedWinUnittest was expanded to test ChannelReader in the > > receiving process. It is now a fully functional end-to-end test of attachment > > brokering. > > > > BUG=493414 > > TBR=tsepez@chromium.org > BUG=493414 > > Committed: https://crrev.com/37a2e0b682555bf35852d707dbd74b68f345841f > Cr-Commit-Position: refs/heads/master@{#344933} TBR= NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=493414 Review URL: https://codereview.chromium.org/1312433009 Cr-Commit-Position: refs/heads/master@{#345960}
* Reland #1: IPC: Add attachment brokering support to the message header.erikchen2015-08-221-0/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reland fixes a race condition in the unit test SendHandleTwice that caused the test to flakily fail, mostly on XP machines. This reland also updates switch statements to contain a block for the newly added enum BrokerableAttachment::PLACEHOLDER, which was causing problems with the clang Windows build. > Message dispatch happens before message translation, and message dispatch > requires that all brokered attachments have been received. This means that > attachment brokering needs to function without message translation. This is > accomplished by modifying the message header to include a new field > num_brokered_attachments, and writing the attachment ids into the IPC Channel > immediately following the pickled message itself. > > AttachmentBrokerPrivilegedWinUnittest was expanded to test ChannelReader in the > receiving process. It is now a fully functional end-to-end test of attachment > brokering. > > BUG=493414 TBR=tsepez@chromium.org BUG=493414 Review URL: https://codereview.chromium.org/1303103002 Cr-Commit-Position: refs/heads/master@{#344933}
* Revert of IPC: Add attachment brokering support to the message header. ↵ricea2015-08-201-88/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (patchset #20 id:420001 of https://codereview.chromium.org/1286253002/ ) Reason for revert: Suspected of breaking XP Tests. See, for example https://build.chromium.org/p/chromium.win/builders/XP%20Tests%20%281%29/builds/39586 . Original issue's description: > IPC: Add attachment brokering support to the message header. > > Message dispatch happens before message translation, and message dispatch > requires that all brokered attachments have been received. This means that > attachment brokering needs to function without message translation. This is > accomplished by modifying the message header to include a new field > num_brokered_attachments, and writing the attachment ids into the IPC Channel > immediately following the pickled message itself. > > AttachmentBrokerPrivilegedWinUnittest was expanded to test ChannelReader in the > receiving process. It is now a fully functional end-to-end test of attachment > brokering. > > BUG=493414 > > Committed: https://crrev.com/e8e4f4fa67ee9db6c2910020ef49318e5df68481 > Cr-Commit-Position: refs/heads/master@{#344389} TBR=tsepez@chromium.org,thakis@chromium.org,erikchen@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=493414 Review URL: https://codereview.chromium.org/1286883003 Cr-Commit-Position: refs/heads/master@{#344461}
* IPC: Add attachment brokering support to the message header.erikchen2015-08-201-0/+88
| | | | | | | | | | | | | | | | | | | Message dispatch happens before message translation, and message dispatch requires that all brokered attachments have been received. This means that attachment brokering needs to function without message translation. This is accomplished by modifying the message header to include a new field num_brokered_attachments, and writing the attachment ids into the IPC Channel immediately following the pickled message itself. AttachmentBrokerPrivilegedWinUnittest was expanded to test ChannelReader in the receiving process. It is now a fully functional end-to-end test of attachment brokering. BUG=493414 Review URL: https://codereview.chromium.org/1286253002 Cr-Commit-Position: refs/heads/master@{#344389}
* ipc: Create an unforgeable mechanism to get the process id of the sender.erikchen2015-07-281-0/+1
| | | | | | | | | | ChannelReader now adds the process id of the sender to all external messages. BUG=513431 Review URL: https://codereview.chromium.org/1262543003 Cr-Commit-Position: refs/heads/master@{#340798}
* Update ChannelReader to use AttachmentBroker.erikchen2015-07-271-4/+0
| | | | | | | | | | | | | | | | Previously, translating from bytes into messages and dispatching the messages was accomplished in a single step. I've split this into two steps. The function TranslateInputData turns bytes into messages, and puts those messages in a queue. The function DispatchMessages() dispatches messages from the queue. Messages cannot be dispatched until all attachments have been brokered, so DispatchMessages() will sometimes wait (asynchronously) for the attachments to get brokered. BUG=466437 Review URL: https://codereview.chromium.org/1206093002 Cr-Commit-Position: refs/heads/master@{#340509}
* Stub in more IPC attachment brokering functionality.erikchen2015-07-071-1/+6
| | | | | | | | | | | | | | | | | | | This CL fills in most of the logic for sending a Windows HANDLE from a non-broker process to the broker process. This consists of several small changes: - Create the new IPC messages AttachmentBrokerMsg_WinHandleHasBeenBrokered and AttachmentBrokerMsg_RequestBrokerageOfWinHandle. - Add a sender_ member variable to AttachmentBrokerWin. - Define the wire format for HandleAttachmentWin. - Add logic to ChannelWin to send AttachmentBrokerMsg_RequestBrokerageOfWinHandle for each HANDLE attachment. BUG=466437 Review URL: https://codereview.chromium.org/1188923003 Cr-Commit-Position: refs/heads/master@{#337689}
* Change most uses of Pickle to base::Picklebrettw2015-06-031-7/+7
| | | | | | | | | | There should be no behavior change. TBR=jschuh (IPC messages) Review URL: https://codereview.chromium.org/1154283003 Cr-Commit-Position: refs/heads/master@{#332552}
* Mechanical rename of base::debug -> base::trace_event [final pass]ssid2015-02-091-1/+2
| | | | | | | | | | | | | | This is the last stage of the trace_event directory restructuring. This is part of a set of 3 CLs which is moving tracing clients to use the new base::trace_debug namespace. See crrev.com/837303004 and the related bug for motivations. BUG=451032 TBR=jam@chromium.org Review URL: https://codereview.chromium.org/868603007 Cr-Commit-Position: refs/heads/master@{#315397}
* IPC: Add MojoHandleAttachmentmorrita2015-02-061-0/+4
| | | | | | | | | | | | | | | | | | This CL introduces MojoHandleAttachment, a MessageAttachment subclass. With this and ChannelMojo, we are able to send Mojo MessagePipes over IPC. There is also MojoMessageHelper which provides some static member functions that reads and writes MessagePipes from/to a Message. In coming changes, we'll add ParamTraits for MessagePipe based on this. R=agl@chromium.org, viettrungluu@chromium.org TEST=IPCChannelMojoTest.SendMessagePipe, IPCChannelMojoTest.SendPlatformHandleAndPipe BUG=448190 Review URL: https://codereview.chromium.org/866223005 Cr-Commit-Position: refs/heads/master@{#314930}
* IPC::Message Refactoring: Move POSIX specific bits to PlatformFileAttachmentmorrita2015-01-311-20/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | This change: * Gets rid of MessageAttachmentSet::owning_descriptors_ by moving the responsibility to PlatformFileAttachment, where owning_ member variable is used to track the lifetime * Replaces MessageAttachmetnSet::Add*File() and TakePlatformFile() with platform agnostic AddAttachment() and GetAttachmentAt() * Repalces Message::ReadFile(), Write*File() with ReadAttachment() and WriteAttachmente(), which are also platform agnostic. This also adds MessageAttachment::TakePlatformFile() virtual function, which will be implemented by upcoming MojoHandleAttachment as well. This is another preparation for introducing MojoHandleAttachment, but it also simplifies Message and MessageAttachmentSet. R=agl@chromium.org TBR=mtomasz@chromium.org BUG=448190 Review URL: https://codereview.chromium.org/883093003 Cr-Commit-Position: refs/heads/master@{#314047}
* IPC: Generalize FileDescriptorSet to MessageAttachmentSetmorrita2015-01-141-17/+16
| | | | | | | | | | | | | | | | | | | | | | This is a preparation for crbug.com/448190, where we're going to allow Mojo MessagePipe being sent over Chrome IPC. The plan is that we'll extend existing FileDescriptorSet to carry both platform handles and Mojo's MessagePipes, then let ChannelMojo take care of these handles. As the first step, this change renames FileDescriptorSet to MessageAttachmentSet and moves it out from the OS_POSIX guard. Although this change doesn't do anything significant, we'll generalize it to carry both platform files and mojo handles eventually. R=agl@chromium.org, viettrungluu@chromium.org BUG=448190 Review URL: https://codereview.chromium.org/835873004 Cr-Commit-Position: refs/heads/master@{#311546}
* Remove deprecated methods from Pickle.avi2014-12-281-1/+1
| | | | | | | | | | | | | BUG=444578 TEST=none R=nasko@chromium.org TBR=ben@chromium.org Committed: https://chromium.googlesource.com/chromium/src/+/b740bfe23ae7ad244356a4a7538b95ae560251db Review URL: https://codereview.chromium.org/818833004 Cr-Commit-Position: refs/heads/master@{#309691}
* Revert of Remove deprecated methods from Pickle. (patchset #10 id:180001 of ↵avi2014-12-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/818833004/) Reason for revert: Allegedly causes a performance hit: http://crbug.com/445173 Original issue's description: > Remove deprecated methods from Pickle. > > BUG=444578 > TEST=none > R=nasko@chromium.org > TBR=ben@chromium.org > > Committed: https://chromium.googlesource.com/chromium/src/+/b740bfe23ae7ad244356a4a7538b95ae560251db TBR=nasko@chromium.org NOTREECHECKS=true NOTRY=true BUG=444578 Review URL: https://codereview.chromium.org/825353003 Cr-Commit-Position: refs/heads/master@{#309689}
* Remove deprecated methods from Pickle.Avi Drissman2014-12-221-1/+1
| | | | | | | | | | | BUG=444578 TEST=none R=nasko@chromium.org TBR=ben@chromium.org Review URL: https://codereview.chromium.org/818833004 Cr-Commit-Position: refs/heads/master@{#309445}
* Fix signed integer overflow in GetRefNumUpper24.rickyz2014-11-121-2/+2
| | | | | | Review URL: https://codereview.chromium.org/717793005 Cr-Commit-Position: refs/heads/master@{#303777}
* IPC: Get rid of FileDescriptor usage from FileDescriptorSet and Messagemorrita2014-09-241-11/+17
| | | | | | | | | | | | | | | This is a step toward to killing FileDescriptor. This change lets FiileDescriptorSet have both Files (for owning fds) and PlatformFiles (for non-owning fds). Doing this, we no longer need FileDescriptor which provides |auto_close| flag. BUG=415294 TEST=ipc_tests, ipc_mojo_unittests R=agl@chromium.org, jam@hcromium.org, viettrungluu@chromium.org Review URL: https://codereview.chromium.org/583473002 Cr-Commit-Position: refs/heads/master@{#296498}
* Ensure that any IPC sent from a child process that couldn't be deserialized ↵jam@chromium.org2014-05-151-5/+6
| | | | | | | | | | | | causes that process to be killed. Today we do this only for a subset of IPCs and not all process types. R=jar@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/283313002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270839 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 260408 "Another temporary CHECK to help track down crash ..."viettrungluu@chromium.org2014-03-301-2/+0
| | | | | | | | | | | | | | | | | > Another temporary CHECK to help track down crash in IPC. > > (Grasping at straws here.) > > TBR=sievers@chromium.org, cpu@chromium.org > BUG=357915 > > Review URL: https://codereview.chromium.org/218513002 TBR=viettrungluu@chromium.org Review URL: https://codereview.chromium.org/218573002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260418 0039d316-1c4b-4281-b951-d872f2087c98
* Another temporary CHECK to help track down crash in IPC.viettrungluu@chromium.org2014-03-301-0/+2
| | | | | | | | | | | (Grasping at straws here.) TBR=sievers@chromium.org, cpu@chromium.org BUG=357915 Review URL: https://codereview.chromium.org/218513002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260408 0039d316-1c4b-4281-b951-d872f2087c98
* Use StaticAtomicSequenceNumber instead of subtle::Atomic32 in IPCMessage.andrew@tullo.ch2014-02-251-3/+3
| | | | | | | | BUG= Review URL: https://codereview.chromium.org/177123004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253169 0039d316-1c4b-4281-b951-d872f2087c98
* Revert https://src.chromium.org/viewvc/chrome?view=rev&revision=231330bbudge@chromium.org2013-11-041-4/+4
| | | | | | | | | | This is a speculative revert to see if it's the cause of hanging renderers. BUG=313112 Review URL: https://codereview.chromium.org/57783006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232819 0039d316-1c4b-4281-b951-d872f2087c98
* Remove unused IPC::Message priority.bbudge@chromium.org2013-10-281-4/+4
| | | | | | | | | | | | | | | | | Removes the PriorityValue enum and field from IPC::Message. This doesn't appear to be used anywhere. Changes the data message ctor to take a size_t data_len parameter. This works around an ambiguity problem with the main ctor, which has a similar signature and would require lots of futzing with our test code to fix. To make this work, the matching Pickle constructor is also changed to take a size_t data_len parameter. BUG=194304 Review URL: https://codereview.chromium.org/35643005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231330 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Correct bit-shift in IPC hash generation."dsinclair@chromium.org2013-08-141-1/+1
| | | | | | | | | | | | | | This reverts commit r213882. This change caused too much shifting. Reverting back to the original as it is, in fact, correct. BUG= TBR=cpu@chromium.org Review URL: https://chromiumcodereview.appspot.com/23081002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217408 0039d316-1c4b-4281-b951-d872f2087c98