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

Side by Side Diff: chrome/ppapi_plugin/plugin_process_dispatcher.cc

Issue 6493004: Implement basic crash detection and shutdown handling for out of process PPAP... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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 | « chrome/ppapi_plugin/plugin_process_dispatcher.h ('k') | chrome/ppapi_plugin/ppapi_thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/ppapi_plugin/plugin_process_dispatcher.h"
6
7 #include "chrome/common/child_process.h"
8
9 namespace {
10
11 class PluginReleaseTask : public Task {
12 public:
13 void Run() {
14 ChildProcess::current()->ReleaseProcess();
15 }
16 };
17
18 // How long we wait before releasing the plugin process.
19 const int kPluginReleaseTimeMs = 30 * 1000; // 30 seconds.
20
21 } // namespace
22
23 PluginProcessDispatcher::PluginProcessDispatcher(
24 base::ProcessHandle remote_process_handle,
25 GetInterfaceFunc get_interface)
26 : pp::proxy::PluginDispatcher(remote_process_handle, get_interface) {
27 ChildProcess::current()->AddRefProcess();
28 }
29
30 PluginProcessDispatcher::~PluginProcessDispatcher() {
31 // Don't free the process right away. This timer allows the child process
32 // to be re-used if the user rapidly goes to a new page that requires this
33 // plugin. This is the case for common plugins where they may be used on a
34 // source and destination page of a navigation. We don't want to tear down
35 // and re-start processes each time in these cases.
36 MessageLoop::current()->PostDelayedTask(FROM_HERE, new PluginReleaseTask(),
37 kPluginReleaseTimeMs);
38 }
OLDNEW
« no previous file with comments | « chrome/ppapi_plugin/plugin_process_dispatcher.h ('k') | chrome/ppapi_plugin/ppapi_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698