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

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

Issue 10378057: Broker out PPAPI handle duplication (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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/broker_process_dispatcher.h" 5 #include "content/ppapi_plugin/broker_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 "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "content/common/child_process.h" 10 #include "content/common/child_process.h"
11 #include "ppapi/c/private/ppp_flash_browser_operations.h" 11 #include "ppapi/c/private/ppp_flash_browser_operations.h"
12 #include "ppapi/proxy/ppapi_messages.h" 12 #include "ppapi/proxy/ppapi_messages.h"
13 13
14 namespace { 14 namespace {
15 15
16 // How long we wait before releasing the broker process. 16 // How long we wait before releasing the broker process.
17 const int kBrokerReleaseTimeSeconds = 30; 17 const int kBrokerReleaseTimeSeconds = 30;
18 18
19 } // namespace 19 } // namespace
20 20
21 BrokerProcessDispatcher::BrokerProcessDispatcher( 21 BrokerProcessDispatcher::BrokerProcessDispatcher(
22 base::ProcessHandle remote_process_handle,
23 PP_GetInterface_Func get_plugin_interface, 22 PP_GetInterface_Func get_plugin_interface,
24 PP_ConnectInstance_Func connect_instance) 23 PP_ConnectInstance_Func connect_instance)
25 : ppapi::proxy::BrokerSideDispatcher(remote_process_handle, 24 : ppapi::proxy::BrokerSideDispatcher(connect_instance),
26 connect_instance),
27 get_plugin_interface_(get_plugin_interface) { 25 get_plugin_interface_(get_plugin_interface) {
28 ChildProcess::current()->AddRefProcess(); 26 ChildProcess::current()->AddRefProcess();
29 } 27 }
30 28
31 BrokerProcessDispatcher::~BrokerProcessDispatcher() { 29 BrokerProcessDispatcher::~BrokerProcessDispatcher() {
32 DVLOG(1) << "BrokerProcessDispatcher::~BrokerProcessDispatcher()"; 30 DVLOG(1) << "BrokerProcessDispatcher::~BrokerProcessDispatcher()";
33 // Don't free the process right away. This timer allows the child process 31 // Don't free the process right away. This timer allows the child process
34 // to be re-used if the user rapidly goes to a new page that requires this 32 // to be re-used if the user rapidly goes to a new page that requires this
35 // plugin. This is the case for common plugins where they may be used on a 33 // plugin. This is the case for common plugins where they may be used on a
36 // source and destination page of a navigation. We don't want to tear down 34 // source and destination page of a navigation. We don't want to tear down
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 #else 75 #else
78 std::string data_str = plugin_data_path.value(); 76 std::string data_str = plugin_data_path.value();
79 #endif 77 #endif
80 78
81 browser_interface->ClearSiteData(data_str.c_str(), 79 browser_interface->ClearSiteData(data_str.c_str(),
82 site.empty() ? NULL : site.c_str(), 80 site.empty() ? NULL : site.c_str(),
83 flags, max_age); 81 flags, max_age);
84 return true; 82 return true;
85 } 83 }
86 84
OLDNEW
« no previous file with comments | « content/ppapi_plugin/broker_process_dispatcher.h ('k') | content/ppapi_plugin/plugin_process_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698