OLD | NEW |
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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/sequenced_task_runner_helpers.h" | 9 #include "base/sequenced_task_runner_helpers.h" |
10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 return new PluginDataRemoverImpl(browser_context); | 38 return new PluginDataRemoverImpl(browser_context); |
39 } | 39 } |
40 | 40 |
41 // static | 41 // static |
42 void PluginDataRemover::GetSupportedPlugins( | 42 void PluginDataRemover::GetSupportedPlugins( |
43 std::vector<webkit::WebPluginInfo>* supported_plugins) { | 43 std::vector<webkit::WebPluginInfo>* supported_plugins) { |
44 bool allow_wildcard = false; | 44 bool allow_wildcard = false; |
45 std::vector<webkit::WebPluginInfo> plugins; | 45 std::vector<webkit::WebPluginInfo> plugins; |
46 PluginService::GetInstance()->GetPluginInfoArray( | 46 PluginService::GetInstance()->GetPluginInfoArray( |
47 GURL(), kFlashMimeType, allow_wildcard, &plugins, NULL); | 47 GURL(), kFlashMimeType, allow_wildcard, &plugins, NULL); |
48 scoped_ptr<Version> min_version( | 48 Version min_version(kMinFlashVersion); |
49 Version::GetVersionFromString(kMinFlashVersion)); | |
50 for (std::vector<webkit::WebPluginInfo>::iterator it = plugins.begin(); | 49 for (std::vector<webkit::WebPluginInfo>::iterator it = plugins.begin(); |
51 it != plugins.end(); ++it) { | 50 it != plugins.end(); ++it) { |
52 scoped_ptr<Version> version( | 51 Version version; |
53 webkit::npapi::PluginGroup::CreateVersionFromString(it->version)); | 52 webkit::npapi::PluginGroup::CreateVersionFromString(it->version, &version); |
54 if (version.get() && min_version->CompareTo(*version) == -1) | 53 if (version.IsValid() && min_version.CompareTo(version) == -1) |
55 supported_plugins->push_back(*it); | 54 supported_plugins->push_back(*it); |
56 } | 55 } |
57 } | 56 } |
58 | 57 |
59 class PluginDataRemoverImpl::Context | 58 class PluginDataRemoverImpl::Context |
60 : public PluginProcessHost::Client, | 59 : public PluginProcessHost::Client, |
61 public PpapiPluginProcessHost::BrokerClient, | 60 public PpapiPluginProcessHost::BrokerClient, |
62 public IPC::Listener, | 61 public IPC::Listener, |
63 public base::RefCountedThreadSafe<Context, | 62 public base::RefCountedThreadSafe<Context, |
64 BrowserThread::DeleteOnIOThread> { | 63 BrowserThread::DeleteOnIOThread> { |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 | 295 |
297 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( | 296 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving( |
298 base::Time begin_time) { | 297 base::Time begin_time) { |
299 DCHECK(!context_.get()); | 298 DCHECK(!context_.get()); |
300 context_ = new Context(begin_time, browser_context_); | 299 context_ = new Context(begin_time, browser_context_); |
301 context_->Init(mime_type_); | 300 context_->Init(mime_type_); |
302 return context_->event(); | 301 return context_->event(); |
303 } | 302 } |
304 | 303 |
305 } // namespace content | 304 } // namespace content |
OLD | NEW |