Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: ppapi/host/instance_message_filter.cc

Issue 10803050: Hook up the PPB_Flash_Print interface to new host system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698