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

Side by Side Diff: content/ppapi_plugin/broker_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
« no previous file with comments | « content/plugin/webplugin_proxy.cc ('k') | content/ppapi_plugin/plugin_process_dispatcher.cc » ('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/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/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 } 98 }
99 } 99 }
100 100
101 BrokerProcessDispatcher::~BrokerProcessDispatcher() { 101 BrokerProcessDispatcher::~BrokerProcessDispatcher() {
102 DVLOG(1) << "BrokerProcessDispatcher::~BrokerProcessDispatcher()"; 102 DVLOG(1) << "BrokerProcessDispatcher::~BrokerProcessDispatcher()";
103 // Don't free the process right away. This timer allows the child process 103 // Don't free the process right away. This timer allows the child process
104 // to be re-used if the user rapidly goes to a new page that requires this 104 // to be re-used if the user rapidly goes to a new page that requires this
105 // plugin. This is the case for common plugins where they may be used on a 105 // plugin. This is the case for common plugins where they may be used on a
106 // source and destination page of a navigation. We don't want to tear down 106 // source and destination page of a navigation. We don't want to tear down
107 // and re-start processes each time in these cases. 107 // and re-start processes each time in these cases.
108 MessageLoop::current()->PostDelayedTask( 108 base::MessageLoop::current()->PostDelayedTask(
109 FROM_HERE, 109 FROM_HERE,
110 base::Bind(&ChildProcess::ReleaseProcess, 110 base::Bind(&ChildProcess::ReleaseProcess,
111 base::Unretained(ChildProcess::current())), 111 base::Unretained(ChildProcess::current())),
112 base::TimeDelta::FromSeconds(kBrokerReleaseTimeSeconds)); 112 base::TimeDelta::FromSeconds(kBrokerReleaseTimeSeconds));
113 } 113 }
114 114
115 bool BrokerProcessDispatcher::OnMessageReceived(const IPC::Message& msg) { 115 bool BrokerProcessDispatcher::OnMessageReceived(const IPC::Message& msg) {
116 IPC_BEGIN_MESSAGE_MAP(BrokerProcessDispatcher, msg) 116 IPC_BEGIN_MESSAGE_MAP(BrokerProcessDispatcher, msg)
117 IPC_MESSAGE_HANDLER(PpapiMsg_GetSitesWithData, OnGetSitesWithData) 117 IPC_MESSAGE_HANDLER(PpapiMsg_GetSitesWithData, OnGetSitesWithData)
118 IPC_MESSAGE_HANDLER(PpapiMsg_ClearSiteData, OnClearSiteData) 118 IPC_MESSAGE_HANDLER(PpapiMsg_ClearSiteData, OnClearSiteData)
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 PP_Bool result = flash_browser_operations_1_2_->SetSitePermission( 323 PP_Bool result = flash_browser_operations_1_2_->SetSitePermission(
324 data_str.c_str(), setting_type, sites.size(), site_array.get()); 324 data_str.c_str(), setting_type, sites.size(), site_array.get());
325 325
326 return PP_ToBool(result); 326 return PP_ToBool(result);
327 } 327 }
328 328
329 return false; 329 return false;
330 } 330 }
331 331
332 } // namespace content 332 } // namespace content
OLDNEW
« no previous file with comments | « content/plugin/webplugin_proxy.cc ('k') | content/ppapi_plugin/plugin_process_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698