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

Side by Side Diff: content/browser/plugin_loader_posix.cc

Issue 9317074: Create an API around UtilityProcessHost and use that from chrome. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 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 | « content/browser/plugin_loader_posix.h ('k') | content/browser/plugin_service_impl.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/browser/plugin_loader_posix.h" 5 #include "content/browser/plugin_loader_posix.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
11 #include "content/common/child_process_host_impl.h" 11 #include "content/common/child_process_host_impl.h"
12 #include "content/common/utility_messages.h" 12 #include "content/common/utility_messages.h"
13 #include "content/browser/utility_process_host_impl.h"
13 #include "content/public/browser/browser_thread.h" 14 #include "content/public/browser/browser_thread.h"
14 #include "webkit/plugins/npapi/plugin_list.h" 15 #include "webkit/plugins/npapi/plugin_list.h"
15 16
16 using content::BrowserThread; 17 using content::BrowserThread;
17 using content::ChildProcessHost; 18 using content::ChildProcessHost;
18 19
19 PluginLoaderPosix::PluginLoaderPosix() 20 PluginLoaderPosix::PluginLoaderPosix()
20 : next_load_index_(0) { 21 : next_load_index_(0) {
21 } 22 }
22 23
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 96 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
96 97
97 // Check if the list is empty or all plugins have already been loaded before 98 // Check if the list is empty or all plugins have already been loaded before
98 // forking. 99 // forking.
99 if (MaybeRunPendingCallbacks()) 100 if (MaybeRunPendingCallbacks())
100 return; 101 return;
101 102
102 if (load_start_time_.is_null()) 103 if (load_start_time_.is_null())
103 load_start_time_ = base::TimeTicks::Now(); 104 load_start_time_ = base::TimeTicks::Now();
104 105
105 process_host_ = 106 UtilityProcessHostImpl* host =
106 (new UtilityProcessHost(this, BrowserThread::IO))->AsWeakPtr(); 107 new UtilityProcessHostImpl(this, BrowserThread::IO);
107 process_host_->set_no_sandbox(true); 108 process_host_ = host->AsWeakPtr();
109 process_host_->DisableSandbox();
108 #if defined(OS_MACOSX) 110 #if defined(OS_MACOSX)
109 process_host_->set_child_flags(ChildProcessHost::CHILD_ALLOW_HEAP_EXECUTION); 111 host->set_child_flags(ChildProcessHost::CHILD_ALLOW_HEAP_EXECUTION);
110 #endif 112 #endif
111 113
112 process_host_->Send(new UtilityMsg_LoadPlugins(canonical_list_)); 114 process_host_->Send(new UtilityMsg_LoadPlugins(canonical_list_));
113 } 115 }
114 116
115 void PluginLoaderPosix::OnPluginLoaded(uint32 index, 117 void PluginLoaderPosix::OnPluginLoaded(uint32 index,
116 const webkit::WebPluginInfo& plugin) { 118 const webkit::WebPluginInfo& plugin) {
117 if (index != next_load_index_) { 119 if (index != next_load_index_) {
118 LOG(ERROR) << "Received unexpected plugin load message for " 120 LOG(ERROR) << "Received unexpected plugin load message for "
119 << plugin.path.value() << "; index=" << index; 121 << plugin.path.value() << "; index=" << index;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 182
181 PluginLoaderPosix::PendingCallback::PendingCallback( 183 PluginLoaderPosix::PendingCallback::PendingCallback(
182 scoped_refptr<base::MessageLoopProxy> loop, 184 scoped_refptr<base::MessageLoopProxy> loop,
183 const content::PluginService::GetPluginsCallback& cb) 185 const content::PluginService::GetPluginsCallback& cb)
184 : target_loop(loop), 186 : target_loop(loop),
185 callback(cb) { 187 callback(cb) {
186 } 188 }
187 189
188 PluginLoaderPosix::PendingCallback::~PendingCallback() { 190 PluginLoaderPosix::PendingCallback::~PendingCallback() {
189 } 191 }
OLDNEW
« no previous file with comments | « content/browser/plugin_loader_posix.h ('k') | content/browser/plugin_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698