diff options
-rw-r--r-- | chrome/browser/metrics_service.cc | 6 | ||||
-rw-r--r-- | chrome/browser/metrics_service.h | 2 | ||||
-rw-r--r-- | chrome/browser/plugin_process_host.cc | 36 | ||||
-rw-r--r-- | chrome/browser/plugin_process_host.h | 8 | ||||
-rw-r--r-- | chrome/browser/plugin_service.cc | 31 | ||||
-rw-r--r-- | chrome/browser/plugin_service.h | 16 | ||||
-rw-r--r-- | chrome/browser/task_manager_resource_providers.cc | 2 | ||||
-rw-r--r-- | chrome/common/chrome_plugin_lib.h | 14 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 96 | ||||
-rw-r--r-- | chrome/common/render_messages_internal.h | 2 | ||||
-rw-r--r-- | chrome/plugin/plugin_main.cc | 6 | ||||
-rw-r--r-- | chrome/plugin/plugin_process.h | 2 | ||||
-rw-r--r-- | chrome/plugin/plugin_thread.cc | 2 | ||||
-rw-r--r-- | webkit/glue/plugins/nphostapi.h | 2 | ||||
-rw-r--r-- | webkit/glue/plugins/plugin_host.cc | 5 | ||||
-rw-r--r-- | webkit/glue/plugins/plugin_lib.cc | 4 | ||||
-rw-r--r-- | webkit/glue/plugins/plugin_lib.h | 14 | ||||
-rw-r--r-- | webkit/glue/plugins/plugin_list.cc | 10 | ||||
-rw-r--r-- | webkit/glue/plugins/plugin_list.h | 19 | ||||
-rw-r--r-- | webkit/tools/test_shell/plugin_tests.cc | 12 |
20 files changed, 148 insertions, 141 deletions
diff --git a/chrome/browser/metrics_service.cc b/chrome/browser/metrics_service.cc index 7a11a3c..7909a0b 100644 --- a/chrome/browser/metrics_service.cc +++ b/chrome/browser/metrics_service.cc @@ -81,7 +81,7 @@ // are: // // INITIALIZED, // Constructor was called. -// PLUGIN_LIST_REQUESTED, // Waiting for DLL list to be loaded. +// PLUGIN_LIST_REQUESTED, // Waiting for plugin list to be loaded. // PLUGIN_LIST_ARRIVED, // Waiting for timer to send initial log. // INITIAL_LOG_READY, // Initial log generated, and waiting for reply. // SEND_OLD_INITIAL_LOGS, // Sending unsent logs from previous session. @@ -94,7 +94,7 @@ // The MS has been constructed, but has taken no actions to compose the // initial log. // -// PLUGIN_LIST_REQUESTED, // Waiting for DLL list to be loaded. +// PLUGIN_LIST_REQUESTED, // Waiting for plugin list to be loaded. // Typically about 30 seconds after startup, a task is sent to a second thread // to get the list of plugins. That task will (when complete) make an async // callback (via a Task) to indicate the completion. @@ -730,7 +730,7 @@ void MetricsService::AddOrRemoveObserver(NotificationObserver* observer, void MetricsService::PushPendingLogsToUnsentLists() { if (state_ < INITIAL_LOG_READY) - return; // We didn't and still don't have time to get DLL list etc. + return; // We didn't and still don't have time to get plugin list etc. if (pending_log()) { PreparePendingLogText(); diff --git a/chrome/browser/metrics_service.h b/chrome/browser/metrics_service.h index a7072c5..8f2f827 100644 --- a/chrome/browser/metrics_service.h +++ b/chrome/browser/metrics_service.h @@ -108,7 +108,7 @@ class MetricsService : public NotificationObserver, // See metrics_service.cc for description of this lifecycle. enum State { INITIALIZED, // Constructor was called. - PLUGIN_LIST_REQUESTED, // Waiting for DLL list to be loaded. + PLUGIN_LIST_REQUESTED, // Waiting for plugin list to be loaded. PLUGIN_LIST_ARRIVED, // Waiting for timer to send initial log. INITIAL_LOG_READY, // Initial log generated, and waiting for reply. SEND_OLD_INITIAL_LOGS, // Sending unsent logs from previous session. diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc index 351d586..9249802 100644 --- a/chrome/browser/plugin_process_host.cc +++ b/chrome/browser/plugin_process_host.cc @@ -48,24 +48,24 @@ static const char kDefaultPluginFinderURL[] = class PluginNotificationTask : public Task { public: PluginNotificationTask(NotificationType notification_type, - FilePath dll_path, + FilePath plugin_path, HANDLE process); virtual void Run(); private: NotificationType notification_type_; - FilePath dll_path_; + FilePath plugin_path_; HANDLE process_; }; PluginNotificationTask::PluginNotificationTask( NotificationType notification_type, - FilePath dll_path, + FilePath plugin_path, HANDLE process) : notification_type_(notification_type), process_(process), - dll_path_(dll_path) { + plugin_path_(plugin_path) { } void PluginNotificationTask::Run() { @@ -82,7 +82,7 @@ void PluginNotificationTask::Run() { return; } - PluginProcessInfo ppi(dll_path_, process_); + PluginProcessInfo ppi(plugin_path_, process_); // As mentioned in the notification_types.h, the PluginProcessInfo details // are only valid for the time of the notification. NotificationService::current()-> @@ -361,12 +361,12 @@ PluginProcessHost::~PluginProcessHost() { } } -bool PluginProcessHost::Init(const FilePath& dll, +bool PluginProcessHost::Init(const FilePath& plugin_path, const std::string& activex_clsid, const std::wstring& locale) { DCHECK(channel_.get() == NULL); - plugin_path_ = dll; + plugin_path_ = plugin_path; channel_id_ = GenerateRandomChannelID(this); channel_.reset(new IPC::Channel(channel_id_, IPC::Channel::MODE_SERVER, @@ -374,14 +374,14 @@ bool PluginProcessHost::Init(const FilePath& dll, if (!channel_->Connect()) return false; - // build command line for plugin, we have to quote the dll path to deal with - // spaces. - std::wstring plugin_path; - if (!PathService::Get(base::FILE_EXE, &plugin_path)) + // build command line for plugin, we have to quote the plugin's path to deal + // with spaces. + std::wstring exe_path; + if (!PathService::Get(base::FILE_EXE, &exe_path)) return false; std::wstring cmd_line(L"\""); - cmd_line += plugin_path; + cmd_line += exe_path; cmd_line += L"\""; if (logging::DialogsAreSuppressed()) CommandLine::AppendSwitch(&cmd_line, switches::kNoErrorDialogs); @@ -439,7 +439,7 @@ bool PluginProcessHost::Init(const FilePath& dll, CommandLine::AppendSwitchWithValue(&cmd_line, switches::kPluginPath, - dll.ToWStringHack()); + plugin_path.ToWStringHack()); bool in_sandbox = !browser_command_line.HasSwitch(switches::kNoSandbox) && browser_command_line.HasSwitch(switches::kSafePlugins); @@ -458,7 +458,8 @@ bool PluginProcessHost::Init(const FilePath& dll, std::wstring trusted_plugins = browser_command_line.GetSwitchValue(switches::kTrustedPlugins); - if (!AddPolicyForPlugin(dll, activex_clsid, trusted_plugins, policy)) { + if (!AddPolicyForPlugin(plugin_path, activex_clsid, trusted_plugins, + policy)) { NOTREACHED(); return false; } @@ -468,7 +469,7 @@ bool PluginProcessHost::Init(const FilePath& dll, return false; } - result = broker_service->SpawnTarget(plugin_path.c_str(), + result = broker_service->SpawnTarget(exe_path.c_str(), cmd_line.c_str(), policy, &target); policy->Release(); if (sandbox::SBOX_ALL_OK != result) @@ -495,8 +496,9 @@ bool PluginProcessHost::Init(const FilePath& dll, FilePath gears_path; if (PathService::Get(chrome::FILE_GEARS_PLUGIN, &gears_path)) { FilePath::StringType gears_path_lc = StringToLowerASCII(gears_path.value()); - FilePath::StringType dll_lc = StringToLowerASCII(dll.value()); - if (dll_lc == gears_path_lc) { + FilePath::StringType plugin_path_lc = + StringToLowerASCII(plugin_path.value()); + if (plugin_path_lc == gears_path_lc) { // Give Gears plugins "background" priority. See // http://b/issue?id=1280317. process_.SetProcessBackgrounded(true); diff --git a/chrome/browser/plugin_process_host.h b/chrome/browser/plugin_process_host.h index fb9dfe8..713c2d4 100644 --- a/chrome/browser/plugin_process_host.h +++ b/chrome/browser/plugin_process_host.h @@ -40,10 +40,10 @@ class PluginProcessHost : public IPC::Channel::Listener, ~PluginProcessHost(); // Initialize the new plugin process, returning true on success. This must - // be called before the object can be used. If dll is the ActiveX-shim, then - // activex_clsid is the class id of ActiveX control, otherwise activex_clsid - // is ignored. - bool Init(const FilePath& dll, + // be called before the object can be used. If plugin_path is the + // ActiveX-shim, then activex_clsid is the class id of ActiveX control, + // otherwise activex_clsid is ignored. + bool Init(const FilePath& plugin_path, const std::string& activex_clsid, const std::wstring& locale); diff --git a/chrome/browser/plugin_service.cc b/chrome/browser/plugin_service.cc index a58787c..133eaae 100644 --- a/chrome/browser/plugin_service.cc +++ b/chrome/browser/plugin_service.cc @@ -59,39 +59,40 @@ const std::wstring& PluginService::GetUILocale() { return ui_locale_; } -PluginProcessHost* PluginService::FindPluginProcess(const FilePath& dll) { +PluginProcessHost* PluginService::FindPluginProcess( + const FilePath& plugin_path) { DCHECK(MessageLoop::current() == ChromeThread::GetMessageLoop(ChromeThread::IO)); - if (dll.value().empty()) { - NOTREACHED() << "should only be called if we have a plugin dll to load"; + if (plugin_path.value().empty()) { + NOTREACHED() << "should only be called if we have a plugin to load"; return NULL; } - PluginMap::iterator found = plugin_hosts_.find(dll); + PluginMap::iterator found = plugin_hosts_.find(plugin_path); if (found != plugin_hosts_.end()) return found->second; return NULL; } PluginProcessHost* PluginService::FindOrStartPluginProcess( - const FilePath& dll, + const FilePath& plugin_path, const std::string& clsid) { DCHECK(MessageLoop::current() == ChromeThread::GetMessageLoop(ChromeThread::IO)); - PluginProcessHost *plugin_host = FindPluginProcess(dll); + PluginProcessHost *plugin_host = FindPluginProcess(plugin_path); if (plugin_host) return plugin_host; // This plugin isn't loaded by any plugin process, so create a new process. plugin_host = new PluginProcessHost(this); - if (!plugin_host->Init(dll, clsid, ui_locale_)) { + if (!plugin_host->Init(plugin_path, clsid, ui_locale_)) { DCHECK(false); // Init is not expected to fail delete plugin_host; return NULL; } - plugin_hosts_[dll] = plugin_host; + plugin_hosts_[plugin_path] = plugin_host; return plugin_host; // TODO(jabdelmalek): adding a new channel means we can have one less @@ -106,8 +107,8 @@ void PluginService::OpenChannelToPlugin( const std::wstring& locale, IPC::Message* reply_msg) { DCHECK(MessageLoop::current() == ChromeThread::GetMessageLoop(ChromeThread::IO)); - FilePath dll = GetPluginPath(url, mime_type, clsid, NULL); - PluginProcessHost* plugin_host = FindOrStartPluginProcess(dll, clsid); + FilePath plugin_path = GetPluginPath(url, mime_type, clsid, NULL); + PluginProcessHost* plugin_host = FindOrStartPluginProcess(plugin_path, clsid); if (plugin_host) { plugin_host->OpenChannelToPlugin(renderer_msg_filter, mime_type, reply_msg); } else { @@ -130,9 +131,9 @@ void PluginService::OnPluginProcessExited(PluginProcessHost* host) { void PluginService::RemoveHost(PluginProcessHost* host) { DCHECK(MessageLoop::current() == ChromeThread::GetMessageLoop(ChromeThread::IO)); - // Search for the instance rather than lookup by dll path, + // Search for the instance rather than lookup by plugin path, // there is a small window where two instances for the same - // dll path can co-exists. + // plugin path can co-exists. PluginMap::iterator i = plugin_hosts_.begin(); while (i != plugin_hosts_.end()) { if (i->second == host) { @@ -156,10 +157,10 @@ FilePath PluginService::GetPluginPath(const GURL& url, return info.file; } -bool PluginService::GetPluginInfoByDllPath(const FilePath& dll_path, - WebPluginInfo* info) { +bool PluginService::GetPluginInfoByPath(const FilePath& plugin_path, + WebPluginInfo* info) { AutoLock lock(lock_); - return NPAPI::PluginList::Singleton()->GetPluginInfoByDllPath(dll_path, info); + return NPAPI::PluginList::Singleton()->GetPluginInfoByPath(plugin_path, info); } bool PluginService::HavePluginFor(const std::string& mime_type, diff --git a/chrome/browser/plugin_service.h b/chrome/browser/plugin_service.h index e34552a..1355b64 100644 --- a/chrome/browser/plugin_service.h +++ b/chrome/browser/plugin_service.h @@ -57,13 +57,13 @@ class PluginService { // Returns the plugin process host corresponding to the plugin process that // has been started by this service. Returns NULL if no process has been // started. - PluginProcessHost* FindPluginProcess(const FilePath& dll); + PluginProcessHost* FindPluginProcess(const FilePath& plugin_path); // Returns the plugin process host corresponding to the plugin process that // has been started by this service. This will start a process to host the - // 'dll' if needed. If the process fails to start, the return value is NULL. - // Must be called on the IO thread. - PluginProcessHost* FindOrStartPluginProcess(const FilePath& dll, + // 'plugin_path' if needed. If the process fails to start, the return value + // is NULL. Must be called on the IO thread. + PluginProcessHost* FindOrStartPluginProcess(const FilePath& plugin_path, const std::string& clsid); // Opens a channel to a plugin process for the given mime type, starting @@ -90,9 +90,9 @@ class PluginService { const std::string& clsid, std::string* actual_mime_type); - // Get plugin info by matching full dll path. - bool GetPluginInfoByDllPath(const FilePath& dll_path, - WebPluginInfo* info); + // Get plugin info by matching full path. + bool GetPluginInfoByPath(const FilePath& plugin_path, + WebPluginInfo* info); // Returns true if the plugin's mime-type supports a given mime-type. // Checks for absolute matching and wildcards. mime-types should be in @@ -120,7 +120,7 @@ class PluginService { // Shutdown handler which executes in the context of the IO thread. void OnShutdown(); - // mapping between plugin dll path and PluginProcessHost + // mapping between plugin path and PluginProcessHost typedef base::hash_map<FilePath, PluginProcessHost*> PluginMap; PluginMap plugin_hosts_; diff --git a/chrome/browser/task_manager_resource_providers.cc b/chrome/browser/task_manager_resource_providers.cc index 71ed524..7167957 100644 --- a/chrome/browser/task_manager_resource_providers.cc +++ b/chrome/browser/task_manager_resource_providers.cc @@ -249,7 +249,7 @@ std::wstring TaskManagerPluginProcessResource::GetTitle() const { std::wstring plugin_name; WebPluginInfo info; if (PluginService::GetInstance()-> - GetPluginInfoByDllPath(plugin_process_.plugin_path(), &info)) + GetPluginInfoByPath(plugin_process_.plugin_path(), &info)) plugin_name = info.name; else plugin_name = l10n_util::GetString(IDS_TASK_MANAGER_UNKNOWN_PLUGIN_NAME); diff --git a/chrome/common/chrome_plugin_lib.h b/chrome/common/chrome_plugin_lib.h index eb2e95f..8cdfa70 100644 --- a/chrome/common/chrome_plugin_lib.h +++ b/chrome/common/chrome_plugin_lib.h @@ -35,11 +35,11 @@ class ChromePluginLib : public base::RefCounted<ChromePluginLib> { // Adds Chrome plugins to the NPAPI plugin list. static void RegisterPluginsWithNPAPI(); - // Loads all the plugin dlls that are marked as "LoadOnStartup" in the + // Loads all the plugins that are marked as "LoadOnStartup" in the // registry. This should only be called in the browser process. static void LoadChromePlugins(const CPBrowserFuncs* bfuncs); - // Unloads all the loaded plugin dlls and cleans up the plugin map. + // Unloads all the loaded plugins and cleans up the plugin map. static void UnloadAllPlugins(); // Returns true if the plugin is currently loaded. @@ -73,18 +73,18 @@ class ChromePluginLib : public base::RefCounted<ChromePluginLib> { // Method to shutdown a Plugin. void CP_Shutdown(); - // Attempts to load the plugin from the DLL. + // Attempts to load the plugin. // Returns true if it is a legitimate plugin, false otherwise bool Load(); - // Unloading the plugin DLL. + // Unloads the plugin. void Unload(); - FilePath filename_; // the path to the DLL - HMODULE module_; // the opened DLL handle + FilePath filename_; // the path to the plugin + HMODULE module_; // the opened plugin handle bool initialized_; // is the plugin initialized - // DLL exports, looked up by name. + // Exported symbols from the plugin, looked up by name. CP_VersionNegotiateFunc CP_VersionNegotiate_; CP_InitializeFunc CP_Initialize_; diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index feccc82..45c9363 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -22,7 +22,7 @@ const wchar_t kDisableMetrics[] = L"disable-metrics"; // client would use for reporting, except the report is dropped rather than sent // to the server. This is useful for finding issues in the metrics code during // UI and performance tests. -const wchar_t kMetricsRecordingOnly[] = L"metrics-recording-only"; +const wchar_t kMetricsRecordingOnly[] = L"metrics-recording-only"; // Causes the browser process to throw an assertion on startup. const wchar_t kBrowserAssertTest[] = L"assert-test"; @@ -84,13 +84,13 @@ const wchar_t kSingleProcess[] = L"single-process"; // renderer process. We default to using a renderer process for each // site instance (i.e., group of pages from the same registered domain with // script connections to each other). -const wchar_t kProcessPerTab[] = L"process-per-tab"; +const wchar_t kProcessPerTab[] = L"process-per-tab"; // Runs a single process for each site (i.e., group of pages from the same // registered domain) the user visits. We default to using a renderer process // for each site instance (i.e., group of pages from the same registered // domain with script connections to each other). -const wchar_t kProcessPerSite[] = L"process-per-site"; +const wchar_t kProcessPerSite[] = L"process-per-site"; // Runs plugins inside the renderer process const wchar_t kInProcessPlugins[] = L"in-process-plugins"; @@ -102,7 +102,7 @@ const wchar_t kNoSandbox[] = L"no-sandbox"; const wchar_t kSafePlugins[] = L"safe-plugins"; // Excludes these plugins from the plugin sandbox. -// This is a comma separated list of plugin dlls name and activex clsid. +// This is a comma-separated list of plugin library names and activex clsid. const wchar_t kTrustedPlugins[] = L"trusted-plugins"; // Runs the security test for the sandbox. @@ -113,7 +113,7 @@ const wchar_t kTestSandbox[] = L"test-sandbox"; const wchar_t kUserDataDir[] = L"user-data-dir"; // Specifies the path to the user data folder for the parent profile. -const wchar_t kParentProfile[] = L"parent-profile"; +const wchar_t kParentProfile[] = L"parent-profile"; // Specifies that the associated value should be launched in "application" mode. const wchar_t kApp[] = L"app"; @@ -188,56 +188,56 @@ const wchar_t kOmniBoxPopupCount[] = L"omnibox-popup-count"; // The value of this switch tells the app to listen for and broadcast // automation-related messages on IPC channel with the given ID. -const wchar_t kAutomationClientChannelID[] = L"automation-channel"; +const wchar_t kAutomationClientChannelID[] = L"automation-channel"; // Indicates the last session should be restored on startup. This overrides // the preferences value and is primarily intended for testing. -const wchar_t kRestoreLastSession[] = L"restore-last-session"; +const wchar_t kRestoreLastSession[] = L"restore-last-session"; // Chrome supports a playback and record mode. Record mode saves *everything* // to the cache. Playback mode reads data exclusively from the cache. This // allows us to record a session into the cache and then replay it at will. -const wchar_t kRecordMode[] = L"record-mode"; -const wchar_t kPlaybackMode[] = L"playback-mode"; +const wchar_t kRecordMode[] = L"record-mode"; +const wchar_t kPlaybackMode[] = L"playback-mode"; // Don't record/playback events when using record & playback. -const wchar_t kNoEvents[] = L"no-events"; +const wchar_t kNoEvents[] = L"no-events"; // Make Windows happy by allowing it to show "Enable access to this program" // checkbox in Add/Remove Programs->Set Program Access and Defaults. This // only shows an error box because the only way to hide Chrome is by // uninstalling it. -const wchar_t kHideIcons[] = L"hide-icons"; +const wchar_t kHideIcons[] = L"hide-icons"; -const wchar_t kShowIcons[] = L"show-icons"; +const wchar_t kShowIcons[] = L"show-icons"; // Make Chrome default browser -const wchar_t kMakeDefaultBrowser[] = L"make-default-browser"; +const wchar_t kMakeDefaultBrowser[] = L"make-default-browser"; // Use a specified proxy server, overrides system settings. This switch only // affects HTTP and HTTPS requests. -const wchar_t kProxyServer[] = L"proxy-server"; +const wchar_t kProxyServer[] = L"proxy-server"; // Chrome will support prefetching of DNS information. Until this becomes // the default, we'll provide a command line switch. -extern const wchar_t kDnsLogDetails[] = L"dns-log-details"; -extern const wchar_t kDnsPrefetchDisable[] = L"dns-prefetch-disable"; +extern const wchar_t kDnsLogDetails[] = L"dns-log-details"; +extern const wchar_t kDnsPrefetchDisable[] = L"dns-prefetch-disable"; // Enables support to debug printing subsystem. -const wchar_t kDebugPrint[] = L"debug-print"; +const wchar_t kDebugPrint[] = L"debug-print"; // Allow initialization of all activex controls. This is only to help website // developers test their controls to see if they are compatible in Chrome. // Note there's a duplicate value in activex_shared.cc (to avoid // dependency on chrome module). Please change both locations at the same time. -const wchar_t kAllowAllActiveX[] = L"allow-all-activex"; +const wchar_t kAllowAllActiveX[] = L"allow-all-activex"; // Browser flag to disable the web inspector for all renderers. -const wchar_t kDisableDevTools[] = L"disable-dev-tools"; +const wchar_t kDisableDevTools[] = L"disable-dev-tools"; // Enable web inspector for all windows, even if they're part of the browser. // Allows us to use our dev tools to debug browser windows itself. -const wchar_t kAlwaysEnableDevTools[] = L"always-enable-dev-tools"; +const wchar_t kAlwaysEnableDevTools[] = L"always-enable-dev-tools"; // Used to set the value of SessionRestore::num_tabs_to_load_. See // session_restore.h for details. @@ -246,111 +246,111 @@ const wchar_t kTabCountToLoadOnSessionRestore[] = // Enable dynamic loading of the Memory Profiler DLL, which will trace // all memory allocations during the run. -const wchar_t kMemoryProfiling[] = L"memory-profile"; +const wchar_t kMemoryProfiling[] = L"memory-profile"; // Configure Chrome's memory model. // Does chrome really need multiple memory models? No. But we get a lot // of concerns from individuals about how the changes work on *their* // system, and we need to be able to experiment with a few choices. -const wchar_t kMemoryModel[] = L"memory-model"; +const wchar_t kMemoryModel[] = L"memory-model"; // By default, cookies are not allowed on file://. They are needed in for // testing, for example page cycler and layout tests. See bug 1157243. -const wchar_t kEnableFileCookies[] = L"enable-file-cookies"; +const wchar_t kEnableFileCookies[] = L"enable-file-cookies"; // Start the browser maximized, regardless of any previous settings. -const wchar_t kStartMaximized[] = L"start-maximized"; +const wchar_t kStartMaximized[] = L"start-maximized"; // Spawn threads to watch for excessive delays in specified message loops. // User should set breakpoints on Alarm() to examine problematic thread. // Usage: -enable-watchdog=[ui][io] // Order of the listed sub-arguments does not matter. -const wchar_t kEnableWatchdog[] = L"enable-watchdog"; +const wchar_t kEnableWatchdog[] = L"enable-watchdog"; // Display the First Run experience when the browser is started, regardless of // whether or not it's actually the first run. -const wchar_t kFirstRun[] = L"first-run"; +const wchar_t kFirstRun[] = L"first-run"; // Enable histograming of tasks served by MessageLoop. See about:histograms/Loop // for results, which show frequency of messages on each thread, including APC // count, object signalling count, etc. -const wchar_t kMessageLoopHistogrammer[] = L"message-loop-histogrammer"; +const wchar_t kMessageLoopHistogrammer[] = L"message-loop-histogrammer"; // Perform importing from another browser. The value associated with this // setting encodes the target browser and what items to import. -const wchar_t kImport[] = L"import"; +const wchar_t kImport[] = L"import"; // Change the DCHECKS to dump memory and continue instead of crashing. // This is valid only in Release mode when --enable-dcheck is specified. -const wchar_t kSilentDumpOnDCHECK[] = L"silent-dump-on-dcheck"; +const wchar_t kSilentDumpOnDCHECK[] = L"silent-dump-on-dcheck"; // Normally when the user attempts to navigate to a page that was the result of // a post we prompt to make sure they want to. This switch may be used to // disable that check. This switch is used during automated testing. -const wchar_t kDisablePromptOnRepost[] = L"disable-prompt-on-repost"; +const wchar_t kDisablePromptOnRepost[] = L"disable-prompt-on-repost"; // Disable pop-up blocking. -const wchar_t kDisablePopupBlocking[] = L"disable-popup-blocking"; +const wchar_t kDisablePopupBlocking[] = L"disable-popup-blocking"; // Don't execute JavaScript (browser JS like the new tab page still runs). -const wchar_t kDisableJavaScript[] = L"disable-javascript"; +const wchar_t kDisableJavaScript[] = L"disable-javascript"; // Prevent Java from running. -const wchar_t kDisableJava[] = L"disable-java"; +const wchar_t kDisableJava[] = L"disable-java"; // Prevent plugins from running. -const wchar_t kDisablePlugins[] = L"disable-plugins"; +const wchar_t kDisablePlugins[] = L"disable-plugins"; // Prevent images from loading. -const wchar_t kDisableImages[] = L"disable-images"; +const wchar_t kDisableImages[] = L"disable-images"; // Use the low fragmentation heap for the CRT. -const wchar_t kUseLowFragHeapCrt[] = L"use-lf-heap"; +const wchar_t kUseLowFragHeapCrt[] = L"use-lf-heap"; #ifndef NDEBUG // Debug only switch to specify which gears plugin dll to load. -const wchar_t kGearsPluginPathOverride[] = L"gears-plugin-path"; +const wchar_t kGearsPluginPathOverride[] = L"gears-plugin-path"; #endif // Switch to load Gears in the renderer process. -const wchar_t kGearsInRenderer[] = L"gears-in-renderer"; +const wchar_t kGearsInRenderer[] = L"gears-in-renderer"; // Enable winhttp HTTP stack. -const wchar_t kUseWinHttp[] = L"winhttp"; +const wchar_t kUseWinHttp[] = L"winhttp"; // Enable the fastback page cache. -const wchar_t kEnableFastback[] = L"enable-fastback"; +const wchar_t kEnableFastback[] = L"enable-fastback"; // Allow loading of the javascript debugger UI from the filesystem. -const wchar_t kJavaScriptDebuggerPath[] = L"javascript-debugger-path"; +const wchar_t kJavaScriptDebuggerPath[] = L"javascript-debugger-path"; -const wchar_t kEnableP13n[] = L"enable-p13n"; +const wchar_t kEnableP13n[] = L"enable-p13n"; // Enable support for SDCH filtering (dictionary based expansion of content). // Optional argument is *the* only domain name that will have SDCH suppport. // Default is "-enable-sdch" to advertise SDCH on all domains. // Sample usage with argument: "-enable-sdch=.google.com" // SDCH is currently only supported server-side for searches on google.com. -const wchar_t kSdchFilter[] = L"enable-sdch"; +const wchar_t kSdchFilter[] = L"enable-sdch"; // Enable Greasemonkey script support. -const wchar_t kEnableGreasemonkey[] = L"enable-greasemonkey"; +const wchar_t kEnableGreasemonkey[] = L"enable-greasemonkey"; // Enable extensions. -const wchar_t kEnableExtensions[] = L"enable-extensions"; +const wchar_t kEnableExtensions[] = L"enable-extensions"; // Causes the browser to launch directly in incognito mode. -const wchar_t kIncognito[] = L"incognito"; +const wchar_t kIncognito[] = L"incognito"; // Turn on the old implementation of SafeBrowsing which may have performance // problems on some computers during updates. -const wchar_t kUseOldSafeBrowsing[] = L"old-safe-browsing"; +const wchar_t kUseOldSafeBrowsing[] = L"old-safe-browsing"; // Turns on the accessibility in the renderer. Off by default until // http://b/issue?id=1432077 is fixed. const wchar_t kEnableRendererAccessibility[] = L"enable-renderer-accessibility"; // Enable HTML5 Video/Audio tag support -const wchar_t kEnableVideo[] = L"enable-video"; +const wchar_t kEnableVideo[] = L"enable-video"; } // namespace switches diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index e2b7c26..38b92ae 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -697,7 +697,7 @@ IPC_BEGIN_MESSAGES(ViewHost, 2) bool /* refresh*/, std::vector<WebPluginInfo> /* plugins */) - // Returns a path to a plugin dll for the given url and mime type. If there's + // Returns a path to a plugin for the given url and mime type. If there's // no plugin, an empty string is returned. IPC_SYNC_MESSAGE_CONTROL3_2(ViewHostMsg_GetPluginPath, GURL /* url */, diff --git a/chrome/plugin/plugin_main.cc b/chrome/plugin/plugin_main.cc index b925a01..94f50bc 100644 --- a/chrome/plugin/plugin_main.cc +++ b/chrome/plugin/plugin_main.cc @@ -32,11 +32,11 @@ int PluginMain(CommandLine &parsed_command_line, bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox) || !parsed_command_line.HasSwitch(switches::kSafePlugins); if (target_services && !no_sandbox) { - // The command line might specify a test dll to load. + // The command line might specify a test plugin to load. if (parsed_command_line.HasSwitch(switches::kTestSandbox)) { - std::wstring test_dll_name = + std::wstring test_plugin_name = parsed_command_line.GetSwitchValue(switches::kTestSandbox); - sandbox_test_module = LoadLibrary(test_dll_name.c_str()); + sandbox_test_module = LoadLibrary(test_plugin_name.c_str()); DCHECK(sandbox_test_module); } } diff --git a/chrome/plugin/plugin_process.h b/chrome/plugin/plugin_process.h index c7c0b78..ca80722 100644 --- a/chrome/plugin/plugin_process.h +++ b/chrome/plugin/plugin_process.h @@ -25,7 +25,7 @@ class PluginProcess : public ChildProcess { // from the browser. static void BrowserShutdown(); - // File path of the plugin dll this process hosts. + // File path of the plugin this process hosts. const FilePath& plugin_path() { return plugin_path_; } private: diff --git a/chrome/plugin/plugin_thread.cc b/chrome/plugin/plugin_thread.cc index e9c1ecd..8b8c20e 100644 --- a/chrome/plugin/plugin_thread.cc +++ b/chrome/plugin/plugin_thread.cc @@ -75,7 +75,7 @@ void PluginThread::Init() { notification_service_.reset(new NotificationService); resource_dispatcher_ = new ResourceDispatcher(this); - // Preload the dll to avoid loading, unloading then reloading + // Preload the library to avoid loading, unloading then reloading preloaded_plugin_module_ = NPAPI::PluginLib::LoadPluginHelper( plugin_process_->plugin_path()); diff --git a/webkit/glue/plugins/nphostapi.h b/webkit/glue/plugins/nphostapi.h index b7814d8..3a0ab82 100644 --- a/webkit/glue/plugins/nphostapi.h +++ b/webkit/glue/plugins/nphostapi.h @@ -264,7 +264,7 @@ typedef struct _NPNetscapeFuncs { } NPNetscapeFuncs; // -// NPAPI DLL entry points +// NPAPI library entry points // typedef NPError (API_CALL * NP_InitializeFunc)(NPNetscapeFuncs* pFuncs); typedef NPError (API_CALL * NP_GetEntryPointsFunc)(NPPluginFuncs* pFuncs); diff --git a/webkit/glue/plugins/plugin_host.cc b/webkit/glue/plugins/plugin_host.cc index 3be9304..60b2b91 100644 --- a/webkit/glue/plugins/plugin_host.cc +++ b/webkit/glue/plugins/plugin_host.cc @@ -760,9 +760,10 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void *value) { // variable definition. scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); if (plugin->plugin_lib()->plugin_info().file.value() == - kDefaultPluginDllName) + kDefaultPluginLibraryName) { plugin->webplugin()->OnMissingPluginStatus( variable - default_plugin::kMissingPluginStatusStart); + } break; } default: @@ -811,7 +812,7 @@ NPError NPN_SetValue(NPP id, NPPVariable variable, void *value) { DLOG(INFO) << "NPN_SetValue(NPPVJavascriptPushCallerBool) is not implemented."; return NPERR_GENERIC_ERROR; case NPPVpluginKeepLibraryInMemory: - // Tells browser that plugin dll should live longer than usual. + // Tells browser that plugin library should live longer than usual. // TODO: implement me DLOG(INFO) << "NPN_SetValue(NPPVpluginKeepLibraryInMemory) is not implemented."; return NPERR_GENERIC_ERROR; diff --git a/webkit/glue/plugins/plugin_lib.cc b/webkit/glue/plugins/plugin_lib.cc index 5936747..e2c0f59 100644 --- a/webkit/glue/plugins/plugin_lib.cc +++ b/webkit/glue/plugins/plugin_lib.cc @@ -84,7 +84,7 @@ PluginLib* PluginLib::CreatePluginLib(const FilePath& filename) { }; static const InternalPluginInfo default_plugin_info = { - {kDefaultPluginDllName, + {kDefaultPluginLibraryName, L"Default Plug-in", L"Provides functionality for installing third-party plug-ins", L"1, 0, 0, 1", @@ -339,7 +339,7 @@ class FreePluginLibraryTask : public Task { void PluginLib::Unload() { if (!internal_ && module_) { // In case of single process mode, a plugin can delete itself - // by executing a script. So delay the unloading of the DLL + // by executing a script. So delay the unloading of the library // so that the plugin will have a chance to unwind. bool defer_unload = webkit_glue::IsPluginRunningInRendererProcess(); diff --git a/webkit/glue/plugins/plugin_lib.h b/webkit/glue/plugins/plugin_lib.h index 11b3498..cd3db97 100644 --- a/webkit/glue/plugins/plugin_lib.h +++ b/webkit/glue/plugins/plugin_lib.h @@ -24,7 +24,7 @@ namespace NPAPI class PluginInstance; -// This struct fully describes a plugin. For dll plugins, it's read in from +// This struct fully describes a plugin. For external plugins, it's read in from // the version info of the dll; For internal plugins, it's predefined. struct PluginVersionInfo { std::wstring file_name; @@ -52,7 +52,7 @@ class PluginLib : public base::RefCounted<PluginLib> { virtual ~PluginLib(); static PluginLib* CreatePluginLib(const FilePath& filename); - // Unloads all the loaded plugin dlls and cleans up the plugin map. + // Unloads all the loaded plugin libraries and cleans up the plugin map. static void UnloadAllPlugins(); // Shuts down all loaded plugin instances. @@ -97,22 +97,22 @@ class PluginLib : public base::RefCounted<PluginLib> { private: // Creates a new PluginLib. The WebPluginInfo object is owned by this // object. If internal_plugin_info is not NULL, this Lib is an internal - // plugin thus doesn't need to load dll. + // plugin thus doesn't need to load a library. PluginLib(WebPluginInfo* info, const InternalPluginInfo* internal_plugin_info); - // Attempts to load the plugin from the DLL. + // Attempts to load the plugin from the library. // Returns true if it is a legitimate plugin, false otherwise bool Load(); - // Unloading the plugin DLL. + // Unloads the plugin library. void Unload(); - // Shutdown the plugin DLL. + // Shutdown the plugin library. void Shutdown(); // Returns a WebPluginInfo structure given a plugin's path. Returns NULL if - // the dll couldn't be found, or if it's not a plugin. + // the library couldn't be found, or if it's not a plugin. static WebPluginInfo* ReadWebPluginInfo(const FilePath &filename); // Creates WebPluginInfo structure based on read in or built in // PluginVersionInfo. diff --git a/webkit/glue/plugins/plugin_list.cc b/webkit/glue/plugins/plugin_list.cc index a41f800..f969874 100644 --- a/webkit/glue/plugins/plugin_list.cc +++ b/webkit/glue/plugins/plugin_list.cc @@ -123,7 +123,7 @@ void PluginList::LoadPlugins(bool refresh) { if (webkit_glue::IsDefaultPluginEnabled()) { scoped_refptr<PluginLib> default_plugin = PluginLib::CreatePluginLib( - FilePath(kDefaultPluginDllName)); + FilePath(kDefaultPluginLibraryName)); plugins_.push_back(default_plugin); } @@ -332,7 +332,7 @@ bool PluginList::GetPluginInfo(const GURL& url, allow_wildcard); if (plugin.get() == NULL || - (plugin->plugin_info().file.value() == kDefaultPluginDllName + (plugin->plugin_info().file.value() == kDefaultPluginLibraryName && clsid.empty())) { scoped_refptr<PluginLib> default_plugin = plugin; plugin = FindPlugin(url, actual_mime_type); @@ -348,11 +348,11 @@ bool PluginList::GetPluginInfo(const GURL& url, return true; } -bool PluginList::GetPluginInfoByDllPath(const FilePath& dll_path, - WebPluginInfo* info) { +bool PluginList::GetPluginInfoByPath(const FilePath& plugin_path, + WebPluginInfo* info) { for (size_t i = 0; i < plugins_.size(); ++i) { if (wcsicmp(plugins_[i]->plugin_info().file.value().c_str(), - dll_path.value().c_str()) == 0) { + plugin_path.value().c_str()) == 0) { *info = plugins_[i]->plugin_info(); return true; } diff --git a/webkit/glue/plugins/plugin_list.h b/webkit/glue/plugins/plugin_list.h index d2cab7d..ebdb687 100644 --- a/webkit/glue/plugins/plugin_list.h +++ b/webkit/glue/plugins/plugin_list.h @@ -31,15 +31,18 @@ namespace NPAPI #define kActivexShimFileNameForMediaPlayer \ L"Microsoft® Windows Media Player Firefox Plugin" -#define kDefaultPluginDllName L"default_plugin" +#define kDefaultPluginLibraryName L"default_plugin" class PluginLib; class PluginInstance; -// The PluginList is responsible for loading our NPAPI based plugins. -// It loads plugins from a known directory by looking for DLLs -// which start with "NP", and checking to see if they are valid -// NPAPI libraries. +// The PluginList is responsible for loading our NPAPI based plugins. It does +// so in whatever manner is appropriate for the platform. On Windows, it loads +// plugins from a known directory by looking for DLLs which start with "NP", +// and checking to see if they are valid NPAPI libraries. On the Mac, it walks +// the machine-wide and user plugin directories and loads anything that has +// the correct types. On Linux, it walks the plugin directories as well +// (e.g. /usr/lib/browser-plugins/). class PluginList : public base::RefCounted<PluginList> { public: // Gets the one instance of the PluginList. @@ -102,10 +105,10 @@ class PluginList : public base::RefCounted<PluginList> { WebPluginInfo* info, std::string* actual_mime_type); - // Get plugin info by plugin dll path. Returns true if the plugin is found and + // Get plugin info by plugin path. Returns true if the plugin is found and // WebPluginInfo has been filled in |info| - bool GetPluginInfoByDllPath(const FilePath& dll_path, - WebPluginInfo* info); + bool GetPluginInfoByPath(const FilePath& plugin_path, + WebPluginInfo* info); private: // Constructors are private for singletons PluginList(); diff --git a/webkit/tools/test_shell/plugin_tests.cc b/webkit/tools/test_shell/plugin_tests.cc index a7095dc..36737e4 100644 --- a/webkit/tools/test_shell/plugin_tests.cc +++ b/webkit/tools/test_shell/plugin_tests.cc @@ -81,11 +81,11 @@ class PluginTest : public TestShellTest { std::wstring plugin_src = current_directory + L"\\npapi_test_plugin.dll"; ASSERT_TRUE(file_util::PathExists(plugin_src)); - plugin_dll_path_ = current_directory + L"\\plugins"; - ::CreateDirectory(plugin_dll_path_.c_str(), NULL); + plugin_file_path_ = current_directory + L"\\plugins"; + ::CreateDirectory(plugin_file_path_.c_str(), NULL); - plugin_dll_path_ += L"\\npapi_test_plugin.dll"; - ASSERT_TRUE(CopyFile(plugin_src.c_str(), plugin_dll_path_.c_str(), FALSE)); + plugin_file_path_ += L"\\npapi_test_plugin.dll"; + ASSERT_TRUE(CopyFile(plugin_src.c_str(), plugin_file_path_.c_str(), FALSE)); // The plugin list has to be refreshed to ensure that the npapi_test_plugin // is loaded by webkit. @@ -105,11 +105,11 @@ class PluginTest : public TestShellTest { // TODO(iyengar) The DeleteFile call fails in some cases as the plugin is // still in use. Needs more investigation. - ::DeleteFile(plugin_dll_path_.c_str()); + ::DeleteFile(plugin_file_path_.c_str()); } std::wstring plugin_data_dir_; - std::wstring plugin_dll_path_; + std::wstring plugin_file_path_; RequestContext* request_context_; GURL test_url_; }; |