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

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

Issue 8440042: Send the index in the canonical list over IPC when using the OOP plugin loader. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 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 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"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 process_host_ = new UtilityProcessHost(this, BrowserThread::IO); 95 process_host_ = new UtilityProcessHost(this, BrowserThread::IO);
96 process_host_->set_no_sandbox(true); 96 process_host_->set_no_sandbox(true);
97 #if defined(OS_MACOSX) 97 #if defined(OS_MACOSX)
98 process_host_->set_child_flags(ChildProcessHost::CHILD_ALLOW_HEAP_EXECUTION); 98 process_host_->set_child_flags(ChildProcessHost::CHILD_ALLOW_HEAP_EXECUTION);
99 #endif 99 #endif
100 100
101 process_host_->Send(new UtilityMsg_LoadPlugins(canonical_list_)); 101 process_host_->Send(new UtilityMsg_LoadPlugins(canonical_list_));
102 } 102 }
103 103
104 void PluginLoaderPosix::OnPluginLoaded(const webkit::WebPluginInfo& plugin) { 104 void PluginLoaderPosix::OnPluginLoaded(size_t index,
105 if (plugin.path.value() != canonical_list_[next_load_index_].value()) { 105 const webkit::WebPluginInfo& plugin) {
106 if (index != next_load_index_) {
106 LOG(ERROR) << "Received unexpected plugin load message for " 107 LOG(ERROR) << "Received unexpected plugin load message for "
107 << plugin.path.value(); 108 << plugin.path.value() << "; index=" << index;
108 return; 109 return;
109 } 110 }
110 111
111 if (!MaybeAddInternalPlugin(plugin.path)) 112 if (!MaybeAddInternalPlugin(plugin.path))
112 loaded_plugins_.push_back(plugin); 113 loaded_plugins_.push_back(plugin);
113 114
114 ++next_load_index_; 115 ++next_load_index_;
115 116
116 MaybeRunPendingCallbacks(); 117 MaybeRunPendingCallbacks();
117 } 118 }
118 119
119 void PluginLoaderPosix::OnPluginLoadFailed(const FilePath& plugin_path) { 120 void PluginLoaderPosix::OnPluginLoadFailed(size_t index,
120 if (plugin_path.value() != canonical_list_[next_load_index_].value()) { 121 const FilePath& plugin_path) {
122 if (index != next_load_index_) {
121 LOG(ERROR) << "Received unexpected plugin load failure message for " 123 LOG(ERROR) << "Received unexpected plugin load failure message for "
122 << plugin_path.value(); 124 << plugin_path.value() << "; index=" << index;
123 return; 125 return;
124 } 126 }
125 127
126 ++next_load_index_; 128 ++next_load_index_;
127 129
128 MaybeAddInternalPlugin(plugin_path); 130 MaybeAddInternalPlugin(plugin_path);
129 MaybeRunPendingCallbacks(); 131 MaybeRunPendingCallbacks();
130 } 132 }
131 133
132 bool PluginLoaderPosix::MaybeAddInternalPlugin(const FilePath& plugin_path) { 134 bool PluginLoaderPosix::MaybeAddInternalPlugin(const FilePath& plugin_path) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 168
167 PluginLoaderPosix::PendingCallback::PendingCallback( 169 PluginLoaderPosix::PendingCallback::PendingCallback(
168 scoped_refptr<base::MessageLoopProxy> loop, 170 scoped_refptr<base::MessageLoopProxy> loop,
169 const PluginService::GetPluginsCallback& cb) 171 const PluginService::GetPluginsCallback& cb)
170 : target_loop(loop), 172 : target_loop(loop),
171 callback(cb) { 173 callback(cb) {
172 } 174 }
173 175
174 PluginLoaderPosix::PendingCallback::~PendingCallback() { 176 PluginLoaderPosix::PendingCallback::~PendingCallback() {
175 } 177 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698