OLD | NEW |
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_service.h" | 5 #include "content/browser/plugin_service.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/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 base::Bind(&PluginService::GetPluginsInternal, base::Unretained(this), | 501 base::Bind(&PluginService::GetPluginsInternal, base::Unretained(this), |
502 target_loop, callback)); | 502 target_loop, callback)); |
503 #else | 503 #else |
504 std::vector<webkit::WebPluginInfo> cached_plugins; | 504 std::vector<webkit::WebPluginInfo> cached_plugins; |
505 if (webkit::npapi::PluginList::Singleton()->GetPluginsIfNoRefreshNeeded( | 505 if (webkit::npapi::PluginList::Singleton()->GetPluginsIfNoRefreshNeeded( |
506 &cached_plugins)) { | 506 &cached_plugins)) { |
507 // Can't assume the caller is reentrant. | 507 // Can't assume the caller is reentrant. |
508 target_loop->PostTask(FROM_HERE, | 508 target_loop->PostTask(FROM_HERE, |
509 base::Bind(&RunGetPluginsCallback, callback, cached_plugins)); | 509 base::Bind(&RunGetPluginsCallback, callback, cached_plugins)); |
510 } else { | 510 } else { |
| 511 if (!plugin_loader_.get()) |
| 512 plugin_loader_ = new PluginLoaderPosix; |
511 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 513 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
512 base::Bind(&PluginLoaderPosix::LoadPlugins, target_loop, callback)); | 514 base::Bind(&PluginLoaderPosix::LoadPlugins, plugin_loader_, |
| 515 target_loop, callback)); |
513 } | 516 } |
514 #endif | 517 #endif |
515 } | 518 } |
516 | 519 |
517 void PluginService::GetPluginGroups(const GetPluginGroupsCallback& callback) { | 520 void PluginService::GetPluginGroups(const GetPluginGroupsCallback& callback) { |
518 GetPlugins(base::Bind(&GetPluginsForGroupsCallback, callback)); | 521 GetPlugins(base::Bind(&GetPluginsForGroupsCallback, callback)); |
519 } | 522 } |
520 | 523 |
521 void PluginService::GetPluginsInternal( | 524 void PluginService::GetPluginsInternal( |
522 base::MessageLoopProxy* target_loop, | 525 base::MessageLoopProxy* target_loop, |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 613 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
611 // static | 614 // static |
612 void PluginService::RegisterFilePathWatcher( | 615 void PluginService::RegisterFilePathWatcher( |
613 FilePathWatcher *watcher, | 616 FilePathWatcher *watcher, |
614 const FilePath& path, | 617 const FilePath& path, |
615 FilePathWatcher::Delegate* delegate) { | 618 FilePathWatcher::Delegate* delegate) { |
616 bool result = watcher->Watch(path, delegate); | 619 bool result = watcher->Watch(path, delegate); |
617 DCHECK(result); | 620 DCHECK(result); |
618 } | 621 } |
619 #endif | 622 #endif |
OLD | NEW |