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_data_remover_impl.cc

Issue 1144353003: Do not attempt to open a channel to a plugin in Plugin Data Remover if there are no plugins availab… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | 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_data_remover_impl.h" 5 #include "content/browser/plugin_data_remover_impl.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 base::TimeDelta::FromMilliseconds(kRemovalTimeoutMs)); 84 base::TimeDelta::FromMilliseconds(kRemovalTimeoutMs));
85 } 85 }
86 86
87 void InitOnIOThread(const std::string& mime_type) { 87 void InitOnIOThread(const std::string& mime_type) {
88 PluginServiceImpl* plugin_service = PluginServiceImpl::GetInstance(); 88 PluginServiceImpl* plugin_service = PluginServiceImpl::GetInstance();
89 89
90 // Get the plugin file path. 90 // Get the plugin file path.
91 std::vector<WebPluginInfo> plugins; 91 std::vector<WebPluginInfo> plugins;
92 plugin_service->GetPluginInfoArray( 92 plugin_service->GetPluginInfoArray(
93 GURL(), mime_type, false, &plugins, NULL); 93 GURL(), mime_type, false, &plugins, NULL);
94 base::FilePath plugin_path; 94
95 if (!plugins.empty()) // May be empty for some tests. 95 if (plugins.empty()) {
96 plugin_path = plugins[0].path; 96 // May be empty for some tests and on the CrOS login OOBE screen.
97 OnTimeout();
Bernhard Bauer 2015/05/20 21:48:34 We should probably call this method OnError() now.
Will Harris 2015/05/20 21:52:12 I tried calling OnError() first, but it prints a s
Bernhard Bauer 2015/05/20 21:55:03 Oh, durr. We really only need SignalDone(), so I g
Will Harris 2015/05/20 22:02:59 yes. good plan.
98 return;
99 }
100 base::FilePath plugin_path = plugins[0].path;
97 101
98 DCHECK_CURRENTLY_ON(BrowserThread::IO); 102 DCHECK_CURRENTLY_ON(BrowserThread::IO);
99 remove_start_time_ = base::Time::Now(); 103 remove_start_time_ = base::Time::Now();
100 is_removing_ = true; 104 is_removing_ = true;
101 // Balanced in On[Ppapi]ChannelOpened or OnError. Exactly one them will 105 // Balanced in On[Ppapi]ChannelOpened or OnError. Exactly one them will
102 // eventually be called, so we need to keep this object around until then. 106 // eventually be called, so we need to keep this object around until then.
103 AddRef(); 107 AddRef();
104 108
105 PepperPluginInfo* pepper_info = 109 PepperPluginInfo* pepper_info =
106 plugin_service->GetRegisteredPpapiPluginInfo(plugin_path); 110 plugin_service->GetRegisteredPpapiPluginInfo(plugin_path);
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 308
305 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( 309 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving(
306 base::Time begin_time) { 310 base::Time begin_time) {
307 DCHECK(!context_.get()); 311 DCHECK(!context_.get());
308 context_ = new Context(begin_time, browser_context_); 312 context_ = new Context(begin_time, browser_context_);
309 context_->Init(mime_type_); 313 context_->Init(mime_type_);
310 return context_->event(); 314 return context_->event();
311 } 315 }
312 316
313 } // namespace content 317 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698