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

Issue 11601004: Introduce MessageFilterHost for Pepper ResourceHosts. (Closed)

Created:
8 years ago by raymes
Modified:
8 years ago
Reviewers:
brettw
CC:
chromium-reviews, joi+watch-content_chromium.org, jam, darin-cc_chromium.org
Visibility:
Public.

Description

Introduce MessageFilterHost for Pepper ResourceHosts. This introduces a MessageFilterHost which is a generic Pepper ResourceHost which can be used when all the ResourceHost does is forward messages to a message filter. It seems good to keep the logic for handling resource messages on a background thread separate in the ResourceMessageFilter class. However, currently when writing a ResourceHost that uses a ResourceMessageFilter, the host ends up being empty. Also, we've been putting the code for the host and the message filter in the same file which is bad for code readability. MessageFilterHost can be used as a generic host in this case such that only the ResourceMessageFilter needs to be written. This reduces the amount of boilerplate needed in cases like this. BUG= Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=173619

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : . #

Patch Set 4 : . #

Patch Set 5 : . #

Patch Set 6 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+66 lines, -0 lines) Patch
A ppapi/host/message_filter_host.h View 1 1 chunk +38 lines, -0 lines 0 comments Download
A ppapi/host/message_filter_host.cc View 1 2 3 4 5 1 chunk +26 lines, -0 lines 0 comments Download
M ppapi/ppapi_host.gypi View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
raymes
Hopefully this makes sense. I also posted https://codereview.chromium.org/11617005/ which shows how this is used. I'll ...
8 years ago (2012-12-17 21:39:25 UTC) #1
brettw
lgtm
8 years ago (2012-12-17 23:03:45 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/raymes@chromium.org/11601004/13001
8 years ago (2012-12-17 23:25:05 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/raymes@chromium.org/11601004/13001
8 years ago (2012-12-18 01:15:56 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/raymes@chromium.org/11601004/13001
8 years ago (2012-12-18 02:03:54 UTC) #5
commit-bot: I haz the power
8 years ago (2012-12-18 02:03:55 UTC) #6
Message was sent while issue was closed.
Failed to apply patch for ppapi/host/message_filter_host.cc:
While running patch -p1 --forward --force --no-backup-if-mismatch;
  The next patch would create the file ppapi/host/message_filter_host.cc,
  which already exists!  Skipping patch.
  1 out of 1 hunk ignored

Patch:   N   ppapi/host/message_filter_host.cc
Index: ppapi/host/message_filter_host.cc
diff --git a/ppapi/host/message_filter_host.cc
b/ppapi/host/message_filter_host.cc
new file mode 100644
index
0000000000000000000000000000000000000000..78ebd231ff416b381fb3d86dab20880ef901f30f
--- /dev/null
+++ b/ppapi/host/message_filter_host.cc
@@ -0,0 +1,26 @@
+// 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/message_filter_host.h"
+
+#include "ppapi/host/ppapi_host.h"
+#include "ppapi/host/resource_message_filter.h"
+
+namespace ppapi {
+namespace host {
+
+MessageFilterHost::MessageFilterHost(
+    PpapiHost* host,
+    PP_Instance instance,
+    PP_Resource resource,
+    const scoped_refptr<ResourceMessageFilter>& message_filter)
+    : ResourceHost(host, instance, resource) {
+  AddFilter(message_filter);
+}
+
+MessageFilterHost::~MessageFilterHost() {
+}
+
+}  // namespace host
+}  // namespace ppapi
\ No newline at end of file

Powered by Google App Engine
This is Rietveld 408576698