Chromium Code Reviews| Index: ppapi/host/instance_message_filter.cc |
| diff --git a/ppapi/host/instance_message_filter.cc b/ppapi/host/instance_message_filter.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b7117488863bb57ebc6f795d3efc32a6be37ec58 |
| --- /dev/null |
| +++ b/ppapi/host/instance_message_filter.cc |
| @@ -0,0 +1,30 @@ |
| +// 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. |
| + |
| +#include "ppapi/host/instance_message_filter.h" |
| + |
| +#include "ppapi/host/ppapi_host.h" |
| + |
| +namespace ppapi { |
| +namespace host { |
| + |
| +InstanceMessageFilter::InstanceMessageFilter(PpapiHost* host) |
| + : host_(host) { |
| + host_->AddInstanceMessageFilter(this); |
| +} |
| + |
| +InstanceMessageFilter::~InstanceMessageFilter() { |
| + if (host_) |
| + host_->RemoveInstanceMessageFilter(this); |
| +} |
| + |
| +void InstanceMessageFilter::CallPpapiHostDestroyed() { |
| + host_->RemoveInstanceMessageFilter(this); |
| + PpapiHost* host = host_; |
| + host_ = NULL; |
| + PpapiHostDestroyed(host); |
|
dmichael (off chromium)
2012/07/25 16:57:27
If the host is in the process of being destroyed,
brettw
2012/07/26 16:18:12
This seems reasonable. I'm not actually sure how t
|
| +} |
| + |
| +} // namespace host |
| +} // namespace ppapi |