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

Side by Side Diff: content/plugin/plugin_thread.cc

Issue 245443005: Move IPC::MessageFilter and router to a separate file (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix gn build Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/plugin/plugin_channel.cc ('k') | content/public/browser/browser_message_filter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/plugin/plugin_thread.h" 5 #include "content/plugin/plugin_thread.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #if defined(OS_MACOSX) 9 #if defined(OS_MACOSX)
10 #include <CoreFoundation/CoreFoundation.h> 10 #include <CoreFoundation/CoreFoundation.h>
(...skipping 10 matching lines...) Expand all
21 #include "base/threading/thread_local.h" 21 #include "base/threading/thread_local.h"
22 #include "content/child/blink_platform_impl.h" 22 #include "content/child/blink_platform_impl.h"
23 #include "content/child/child_process.h" 23 #include "content/child/child_process.h"
24 #include "content/child/npapi/npobject_util.h" 24 #include "content/child/npapi/npobject_util.h"
25 #include "content/child/npapi/plugin_lib.h" 25 #include "content/child/npapi/plugin_lib.h"
26 #include "content/common/plugin_process_messages.h" 26 #include "content/common/plugin_process_messages.h"
27 #include "content/public/common/content_switches.h" 27 #include "content/public/common/content_switches.h"
28 #include "content/public/plugin/content_plugin_client.h" 28 #include "content/public/plugin/content_plugin_client.h"
29 #include "third_party/WebKit/public/web/WebKit.h" 29 #include "third_party/WebKit/public/web/WebKit.h"
30 #include "ipc/ipc_channel_handle.h" 30 #include "ipc/ipc_channel_handle.h"
31 #include "ipc/message_filter.h"
31 32
32 namespace content { 33 namespace content {
33 34
34 namespace { 35 namespace {
35 36
36 class EnsureTerminateMessageFilter : public IPC::ChannelProxy::MessageFilter { 37 class EnsureTerminateMessageFilter : public IPC::MessageFilter {
37 public: 38 public:
38 EnsureTerminateMessageFilter() {} 39 EnsureTerminateMessageFilter() {}
39 40
40 protected: 41 protected:
41 virtual ~EnsureTerminateMessageFilter() {} 42 virtual ~EnsureTerminateMessageFilter() {}
42 43
43 // IPC::ChannelProxy::MessageFilter: 44 // IPC::MessageFilter:
44 virtual void OnChannelError() OVERRIDE { 45 virtual void OnChannelError() OVERRIDE {
45 // How long we wait before forcibly shutting down the process. 46 // How long we wait before forcibly shutting down the process.
46 const base::TimeDelta kPluginProcessTerminateTimeout = 47 const base::TimeDelta kPluginProcessTerminateTimeout =
47 base::TimeDelta::FromSeconds(3); 48 base::TimeDelta::FromSeconds(3);
48 // Ensure that we don't wait indefinitely for the plugin to shutdown. 49 // Ensure that we don't wait indefinitely for the plugin to shutdown.
49 // as the browser does not terminate plugin processes on shutdown. 50 // as the browser does not terminate plugin processes on shutdown.
50 // We achieve this by posting an exit process task on the IO thread. 51 // We achieve this by posting an exit process task on the IO thread.
51 base::MessageLoop::current()->PostDelayedTask( 52 base::MessageLoop::current()->PostDelayedTask(
52 FROM_HERE, 53 FROM_HERE,
53 base::Bind(&EnsureTerminateMessageFilter::Terminate, this), 54 base::Bind(&EnsureTerminateMessageFilter::Terminate, this),
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } 152 }
152 153
153 Send(new PluginProcessHostMsg_ChannelCreated(channel_handle)); 154 Send(new PluginProcessHostMsg_ChannelCreated(channel_handle));
154 } 155 }
155 156
156 void PluginThread::OnNotifyRenderersOfPendingShutdown() { 157 void PluginThread::OnNotifyRenderersOfPendingShutdown() {
157 PluginChannel::NotifyRenderersOfPendingShutdown(); 158 PluginChannel::NotifyRenderersOfPendingShutdown();
158 } 159 }
159 160
160 } // namespace content 161 } // namespace content
OLDNEW
« no previous file with comments | « content/plugin/plugin_channel.cc ('k') | content/public/browser/browser_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698