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

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

Issue 14335017: content: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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
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/ppapi_plugin/plugin_process_dispatcher.h" 5 #include "content/ppapi_plugin/plugin_process_dispatcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "content/common/child_process.h" 9 #include "content/common/child_process.h"
10 10
(...skipping 14 matching lines...) Expand all
25 incognito) { 25 incognito) {
26 ChildProcess::current()->AddRefProcess(); 26 ChildProcess::current()->AddRefProcess();
27 } 27 }
28 28
29 PluginProcessDispatcher::~PluginProcessDispatcher() { 29 PluginProcessDispatcher::~PluginProcessDispatcher() {
30 // Don't free the process right away. This timer allows the child process 30 // Don't free the process right away. This timer allows the child process
31 // to be re-used if the user rapidly goes to a new page that requires this 31 // to be re-used if the user rapidly goes to a new page that requires this
32 // plugin. This is the case for common plugins where they may be used on a 32 // plugin. This is the case for common plugins where they may be used on a
33 // source and destination page of a navigation. We don't want to tear down 33 // source and destination page of a navigation. We don't want to tear down
34 // and re-start processes each time in these cases. 34 // and re-start processes each time in these cases.
35 MessageLoop::current()->PostDelayedTask( 35 base::MessageLoop::current()->PostDelayedTask(
36 FROM_HERE, 36 FROM_HERE,
37 base::Bind(&ChildProcess::ReleaseProcess, 37 base::Bind(&ChildProcess::ReleaseProcess,
38 base::Unretained(ChildProcess::current())), 38 base::Unretained(ChildProcess::current())),
39 base::TimeDelta::FromSeconds(kPluginReleaseTimeSeconds)); 39 base::TimeDelta::FromSeconds(kPluginReleaseTimeSeconds));
40 } 40 }
41 41
42 } // namespace content 42 } // namespace content
OLDNEW
« no previous file with comments | « content/ppapi_plugin/broker_process_dispatcher.cc ('k') | content/ppapi_plugin/ppapi_broker_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698