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_service_impl.h" | 5 #include "content/browser/plugin_service_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/message_loop_proxy.h" | 12 #include "base/message_loop_proxy.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
16 #include "base/synchronization/waitable_event.h" | 16 #include "base/synchronization/waitable_event.h" |
17 #include "base/threading/thread.h" | 17 #include "base/threading/thread.h" |
18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
19 #include "base/values.h" | |
20 #include "content/browser/ppapi_plugin_process_host.h" | 19 #include "content/browser/ppapi_plugin_process_host.h" |
21 #include "content/browser/renderer_host/render_process_host_impl.h" | 20 #include "content/browser/renderer_host/render_process_host_impl.h" |
22 #include "content/browser/renderer_host/render_view_host_impl.h" | 21 #include "content/browser/renderer_host/render_view_host_impl.h" |
23 #include "content/common/pepper_plugin_registry.h" | 22 #include "content/common/pepper_plugin_registry.h" |
24 #include "content/common/plugin_messages.h" | |
25 #include "content/common/utility_messages.h" | |
26 #include "content/common/view_messages.h" | 23 #include "content/common/view_messages.h" |
27 #include "content/public/browser/browser_thread.h" | 24 #include "content/public/browser/browser_thread.h" |
28 #include "content/public/browser/content_browser_client.h" | 25 #include "content/public/browser/content_browser_client.h" |
29 #include "content/public/browser/plugin_service_filter.h" | 26 #include "content/public/browser/plugin_service_filter.h" |
30 #include "content/public/browser/resource_context.h" | 27 #include "content/public/browser/resource_context.h" |
31 #include "content/public/common/content_switches.h" | 28 #include "content/public/common/content_switches.h" |
32 #include "content/public/common/process_type.h" | 29 #include "content/public/common/process_type.h" |
33 #include "webkit/plugins/npapi/plugin_list.h" | 30 #include "webkit/plugins/npapi/plugin_list.h" |
34 #include "webkit/plugins/npapi/plugin_utils.h" | 31 #include "webkit/plugins/npapi/plugin_utils.h" |
35 #include "webkit/plugins/plugin_constants.h" | 32 #include "webkit/plugins/plugin_constants.h" |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 733 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
737 std::map<base::FilePath, std::vector<base::Time> >::const_iterator i = | 734 std::map<base::FilePath, std::vector<base::Time> >::const_iterator i = |
738 crash_times_.find(path); | 735 crash_times_.find(path); |
739 if (i == crash_times_.end()) { | 736 if (i == crash_times_.end()) { |
740 return false; | 737 return false; |
741 } | 738 } |
742 if (i->second.size() != kMaxCrashesPerInterval) { | 739 if (i->second.size() != kMaxCrashesPerInterval) { |
743 return false; | 740 return false; |
744 } | 741 } |
745 base::TimeDelta delta = base::Time::Now() - i->second[0]; | 742 base::TimeDelta delta = base::Time::Now() - i->second[0]; |
746 if (delta.InSeconds() <= kCrashesInterval) { | 743 return delta.InSeconds() <= kCrashesInterval; |
747 return true; | |
748 } | |
749 return false; | |
750 } | 744 } |
751 | 745 |
752 void PluginServiceImpl::RefreshPlugins() { | 746 void PluginServiceImpl::RefreshPlugins() { |
753 plugin_list_->RefreshPlugins(); | 747 plugin_list_->RefreshPlugins(); |
754 } | 748 } |
755 | 749 |
756 void PluginServiceImpl::AddExtraPluginPath(const base::FilePath& path) { | 750 void PluginServiceImpl::AddExtraPluginPath(const base::FilePath& path) { |
757 plugin_list_->AddExtraPluginPath(path); | 751 plugin_list_->AddExtraPluginPath(path); |
758 } | 752 } |
759 | 753 |
(...skipping 30 matching lines...) Expand all Loading... |
790 void PluginServiceImpl::GetInternalPlugins( | 784 void PluginServiceImpl::GetInternalPlugins( |
791 std::vector<webkit::WebPluginInfo>* plugins) { | 785 std::vector<webkit::WebPluginInfo>* plugins) { |
792 plugin_list_->GetInternalPlugins(plugins); | 786 plugin_list_->GetInternalPlugins(plugins); |
793 } | 787 } |
794 | 788 |
795 webkit::npapi::PluginList* PluginServiceImpl::GetPluginList() { | 789 webkit::npapi::PluginList* PluginServiceImpl::GetPluginList() { |
796 return plugin_list_; | 790 return plugin_list_; |
797 } | 791 } |
798 | 792 |
799 } // namespace content | 793 } // namespace content |
OLD | NEW |