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" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 TOTAL_BROWSER_PROCESSES, | 59 TOTAL_BROWSER_PROCESSES, |
60 FLASH_USAGE_ENUM_COUNT | 60 FLASH_USAGE_ENUM_COUNT |
61 }; | 61 }; |
62 | 62 |
63 bool LoadPluginListInProcess() { | 63 bool LoadPluginListInProcess() { |
64 #if defined(OS_WIN) | 64 #if defined(OS_WIN) |
65 return true; | 65 return true; |
66 #else | 66 #else |
67 // If on POSIX, we don't want to load the list of NPAPI plugins in-process as | 67 // If on POSIX, we don't want to load the list of NPAPI plugins in-process as |
68 // that causes instability. | 68 // that causes instability. |
| 69 |
| 70 // Can't load the plugins on the utility thread when in single process mode |
| 71 // since that requires using WebKit and GTK and they can only be used on the |
| 72 // main thread. |
| 73 if (RenderProcessHost::run_renderer_in_process()) |
| 74 return true; |
| 75 |
69 return !webkit::npapi::NPAPIPluginsSupported(); | 76 return !webkit::npapi::NPAPIPluginsSupported(); |
70 #endif | 77 #endif |
71 } | 78 } |
72 | 79 |
73 // Callback set on the PluginList to assert that plugin loading happens on the | 80 // Callback set on the PluginList to assert that plugin loading happens on the |
74 // correct thread. | 81 // correct thread. |
75 void WillLoadPluginsCallback( | 82 void WillLoadPluginsCallback( |
76 base::SequencedWorkerPool::SequenceToken token) { | 83 base::SequencedWorkerPool::SequenceToken token) { |
77 if (LoadPluginListInProcess()) { | 84 if (LoadPluginListInProcess()) { |
78 CHECK(BrowserThread::GetBlockingPool()->IsRunningSequenceOnCurrentThread( | 85 CHECK(BrowserThread::GetBlockingPool()->IsRunningSequenceOnCurrentThread( |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 void PluginServiceImpl::GetInternalPlugins( | 794 void PluginServiceImpl::GetInternalPlugins( |
788 std::vector<webkit::WebPluginInfo>* plugins) { | 795 std::vector<webkit::WebPluginInfo>* plugins) { |
789 plugin_list_->GetInternalPlugins(plugins); | 796 plugin_list_->GetInternalPlugins(plugins); |
790 } | 797 } |
791 | 798 |
792 webkit::npapi::PluginList* PluginServiceImpl::GetPluginList() { | 799 webkit::npapi::PluginList* PluginServiceImpl::GetPluginList() { |
793 return plugin_list_; | 800 return plugin_list_; |
794 } | 801 } |
795 | 802 |
796 } // namespace content | 803 } // namespace content |
OLD | NEW |