forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert of Remove IPC::BrokerableAttachment. (patchset chromium#1 id:1…
…20001 of https://codereview.chromium.org/2494943002/ ) Reason for revert: Caused crash in NewlibPackagedAppTest.SuccessfulLoad browser_tests. See http://crbug.com/665678#c1 BUG=665678 Original issue's description: > Remove IPC::BrokerableAttachment. > > With only ChannelMojo in use, the distinction between brokerable and > non-brokerable attachments no longer makes sense. This CL removes that > distinction by removing BrokerableAttachment and flattening the > hierarchy of attachment types. > > This also trims some POSIX-specific parts of IPC::MessageAttachmentSet. > > BUG=659448 > > Committed: https://crrev.com/f6e03ce56c4d2370b79d0c3dd4ceb89cf5528e56 > Cr-Commit-Position: refs/heads/master@{#432153} TBR=rockot@chromium.org,dcheng@chromium.org,mseaborn@chromium.org,raymes@chromium.org,erikchen@chromium.org,sammc@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=659448 Review-Url: https://codereview.chromium.org/2504063002 Cr-Commit-Position: refs/heads/master@{#432351}
- Loading branch information
Showing
32 changed files
with
566 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2015 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. | ||
|
||
#include "ipc/brokerable_attachment.h" | ||
|
||
#include <stddef.h> | ||
|
||
#include "build/build_config.h" | ||
|
||
namespace IPC { | ||
|
||
// BrokerableAttachment::BrokerableAttachment ---------------------------------- | ||
|
||
BrokerableAttachment::BrokerableAttachment() = default; | ||
|
||
BrokerableAttachment::~BrokerableAttachment() = default; | ||
|
||
bool BrokerableAttachment::NeedsBrokering() const { | ||
return GetBrokerableType() == PLACEHOLDER; | ||
} | ||
|
||
BrokerableAttachment::Type BrokerableAttachment::GetType() const { | ||
return TYPE_BROKERABLE_ATTACHMENT; | ||
} | ||
|
||
#if defined(OS_POSIX) | ||
base::PlatformFile BrokerableAttachment::TakePlatformFile() { | ||
NOTREACHED(); | ||
return base::PlatformFile(); | ||
} | ||
#endif // OS_POSIX | ||
|
||
} // namespace IPC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Copyright 2015 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_BROKERABLE_ATTACHMENT_H_ | ||
#define IPC_BROKERABLE_ATTACHMENT_H_ | ||
|
||
#include <stddef.h> | ||
#include <stdint.h> | ||
|
||
#include <algorithm> | ||
|
||
#include "base/macros.h" | ||
#include "build/build_config.h" | ||
#include "ipc/ipc_export.h" | ||
#include "ipc/ipc_message_attachment.h" | ||
|
||
namespace IPC { | ||
|
||
// This subclass of MessageAttachment requires an AttachmentBroker to be | ||
// attached to a Chrome IPC message. | ||
class IPC_EXPORT BrokerableAttachment : public MessageAttachment { | ||
public: | ||
enum BrokerableType { | ||
PLACEHOLDER, | ||
WIN_HANDLE, | ||
MACH_PORT, | ||
}; | ||
|
||
// Whether the attachment still needs information from the broker before it | ||
// can be used. | ||
bool NeedsBrokering() const; | ||
|
||
// Returns TYPE_BROKERABLE_ATTACHMENT | ||
Type GetType() const override; | ||
|
||
virtual BrokerableType GetBrokerableType() const = 0; | ||
|
||
// MessageAttachment override. | ||
#if defined(OS_POSIX) | ||
base::PlatformFile TakePlatformFile() override; | ||
#endif // OS_POSIX | ||
|
||
protected: | ||
BrokerableAttachment(); | ||
~BrokerableAttachment() override; | ||
|
||
private: | ||
DISALLOW_COPY_AND_ASSIGN(BrokerableAttachment); | ||
}; | ||
|
||
} // namespace IPC | ||
|
||
#endif // IPC_BROKERABLE_ATTACHMENT_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.