diff options
author | erikchen <erikchen@chromium.org> | 2015-09-14 10:45:12 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-14 17:45:59 +0000 |
commit | 5708aae6ec926bddd69f3e9058f129d10a0d1873 (patch) | |
tree | 1d139378a2464f14c71419452eb7a2e53a718bba /ipc/attachment_broker.cc | |
parent | 4d53c25e7f09d990b52ef037b17d27690dd02614 (diff) | |
download | chromium_src-5708aae6ec926bddd69f3e9058f129d10a0d1873.zip chromium_src-5708aae6ec926bddd69f3e9058f129d10a0d1873.tar.gz chromium_src-5708aae6ec926bddd69f3e9058f129d10a0d1873.tar.bz2 |
ipc: Use a global for the process's attachment broker.
This eliminates the need for a lot of plumbing, at the expense of yet another
global.
BUG=493414
Review URL: https://codereview.chromium.org/1292263003
Cr-Commit-Position: refs/heads/master@{#348649}
Diffstat (limited to 'ipc/attachment_broker.cc')
-rw-r--r-- | ipc/attachment_broker.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ipc/attachment_broker.cc b/ipc/attachment_broker.cc index 7450ec3..7e04bcd 100644 --- a/ipc/attachment_broker.cc +++ b/ipc/attachment_broker.cc @@ -6,8 +6,23 @@ #include <algorithm> +namespace { +IPC::AttachmentBroker* g_attachment_broker = nullptr; +} + namespace IPC { +// static +void AttachmentBroker::SetGlobal(AttachmentBroker* broker) { + CHECK(!g_attachment_broker); + g_attachment_broker = broker; +} + +// static +AttachmentBroker* AttachmentBroker::GetGlobal() { + return g_attachment_broker; +} + AttachmentBroker::AttachmentBroker() {} AttachmentBroker::~AttachmentBroker() {} |