diff options
author | avi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-16 16:07:54 +0000 |
---|---|---|
committer | avi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-16 16:07:54 +0000 |
commit | 3d8102fbabb1d6194e4c0076b4947b0bb9b2fe9a (patch) | |
tree | e9024c1dbbc1e29200f9fb9c0f9e88eb0c873a07 | |
parent | 7fad4a4b9f751c438f4b0701e0f0b9052db00d5a (diff) | |
download | chromium_src-3d8102fbabb1d6194e4c0076b4947b0bb9b2fe9a.zip chromium_src-3d8102fbabb1d6194e4c0076b4947b0bb9b2fe9a.tar.gz chromium_src-3d8102fbabb1d6194e4c0076b4947b0bb9b2fe9a.tar.bz2 |
Spaces at end of lines begone!
Review URL: http://codereview.chromium.org/18314
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8176 0039d316-1c4b-4281-b951-d872f2087c98
23 files changed, 132 insertions, 133 deletions
diff --git a/webkit/glue/plugins/mozilla_extensions.cc b/webkit/glue/plugins/mozilla_extensions.cc index 5c0f47f..f3a00f9 100644 --- a/webkit/glue/plugins/mozilla_extensions.cc +++ b/webkit/glue/plugins/mozilla_extensions.cc @@ -60,7 +60,7 @@ bool MozillaExtensionApi::FindProxyForUrl(const char* url, // - HTTP proxy: "111.111.111.111:11" // -.SOCKS proxy: "socks=111.111.111.111:11" // - Mixed proxy: "http=111.111.111.111:11; socks=222.222.222.222:22" - // + // // We need to translate this into the following format: // i) "DIRECT" -- no proxy // ii) "PROXY xxx.xxx.xxx.xxx" -- use proxy @@ -72,7 +72,7 @@ bool MozillaExtensionApi::FindProxyForUrl(const char* url, // Proxy is in the form: "111.111.111.111:11" winhttp_proxy.insert(0, "http "); } else { - // Proxy is in the following form. + // Proxy is in the following form. // -.SOCKS proxy: "socks=111.111.111.111:11" // - Mixed proxy: "http=111.111.111.111:11; socks=222.222.222.222:22" // in this case just replace the '=' with a space @@ -265,7 +265,7 @@ NS_IMETHODIMP MozillaExtensionApi::FindProxyForURL( std::string proxy = "DIRECT"; FindProxyForUrl(aURL, &proxy); - // Allocate this using the NPAPI allocator. The plugin will call + // Allocate this using the NPAPI allocator. The plugin will call // NPN_Free to free this. char* result = static_cast<char*>(NPN_MemAlloc(proxy.length() + 1)); strncpy(result, proxy.c_str(), proxy.length() + 1); @@ -357,7 +357,7 @@ NS_IMETHODIMP MozillaExtensionApi::SetCookie( if (!webplugin) return NS_ERROR_FAILURE; - std::string cookie(static_cast<const char*>(cookie_buffer), + std::string cookie(static_cast<const char*>(cookie_buffer), buffer_size); GURL cookies_url((std::string(url))); webplugin->SetCookie(cookies_url, diff --git a/webkit/glue/plugins/mozilla_extensions.h b/webkit/glue/plugins/mozilla_extensions.h index 900e84f..4eb80d7 100644 --- a/webkit/glue/plugins/mozilla_extensions.h +++ b/webkit/glue/plugins/mozilla_extensions.h @@ -7,7 +7,7 @@ #include <string> -// Include npapi first to avoid definition clashes due to +// Include npapi first to avoid definition clashes due to // XP_WIN #include "third_party/npapi/bindings/npapi.h" @@ -19,7 +19,7 @@ #include "base/ref_counted.h" // NS_DECL_NSIPLUGINMANAGER doesn't include methods described as "C++" in the -// nsIPluginManager.idl. +// nsIPluginManager.idl. #define NS_DECL_NSIPLUGINMANAGER_FIXED \ NS_DECL_NSIPLUGINMANAGER \ NS_IMETHOD \ @@ -68,7 +68,7 @@ namespace NPAPI class PluginInstance; -// Implementation of extended Mozilla interfaces needed to support +// Implementation of extended Mozilla interfaces needed to support // Sun's new Java plugin. class MozillaExtensionApi : public nsIServiceManager, public nsIPluginManager2, diff --git a/webkit/glue/plugins/nphostapi.h b/webkit/glue/plugins/nphostapi.h index 3a0ab82..2fd7a809 100644 --- a/webkit/glue/plugins/nphostapi.h +++ b/webkit/glue/plugins/nphostapi.h @@ -12,7 +12,7 @@ #include "third_party/npapi/bindings/npruntime.h" #ifdef __cplusplus -extern "C" { +extern "C" { #endif // @@ -30,7 +30,7 @@ typedef NPError (*NPP_DestroyProcPtr)(NPP instance, typedef NPError (*NPP_SetWindowProcPtr)(NPP instance, NPWindow* window); typedef NPError (*NPP_NewStreamProcPtr)(NPP instance, - NPMIMEType type, + NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype); @@ -40,7 +40,7 @@ typedef NPError (*NPP_DestroyStreamProcPtr)(NPP instance, typedef int32 (*NPP_WriteReadyProcPtr)(NPP instance, NPStream* stream); typedef int32 (*NPP_WriteProcPtr)(NPP instance, - NPStream* stream, + NPStream* stream, int32 offset, int32 len, void* buffer); @@ -52,7 +52,7 @@ typedef void (*NPP_PrintProcPtr)(NPP instance, typedef int16 (*NPP_HandleEventProcPtr)(NPP instance, void* event); typedef void (*NPP_URLNotifyProcPtr)(NPP instance, - const char* url, + const char* url, NPReason reason, void* notifyData); typedef void* JRIGlobalRef; //not using this right now @@ -178,7 +178,7 @@ typedef bool (*NPN_EnumerateProcPtr)(NPP npp, NPObject *obj, NPIdentifier **identifier, uint32_t *count); -typedef void (*NPN_PluginThreadAsyncCallProcPtr)(NPP instance, +typedef void (*NPN_PluginThreadAsyncCallProcPtr)(NPP instance, void (*func)(void *), void *userData); typedef bool (*NPN_ConstructProcPtr)(NPP npp, diff --git a/webkit/glue/plugins/plugin_lib.h b/webkit/glue/plugins/plugin_lib.h index 7878766..136a474 100644 --- a/webkit/glue/plugins/plugin_lib.h +++ b/webkit/glue/plugins/plugin_lib.h @@ -55,7 +55,7 @@ class PluginLib : public base::RefCounted<PluginLib> { // Creates a WebPluginInfo structure given a plugin's path. On success // returns true, with the information being put into "info". Returns false if - // the library 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 bool ReadWebPluginInfo(const FilePath &filename, WebPluginInfo* info); // Unloads all the loaded plugin libraries and cleans up the plugin map. @@ -103,15 +103,15 @@ class PluginLib : public base::RefCounted<PluginLib> { // Shutdown the plugin library. void Shutdown(); - + // // Platform functions // - + // Gets the list of internal plugins. static void GetInternalPlugins(const InternalPluginInfo** plugins, size_t* count); - + public: #if defined(OS_WIN) typedef HMODULE NativeLibrary; @@ -122,20 +122,20 @@ class PluginLib : public base::RefCounted<PluginLib> { typedef CFStringRef NativeLibraryFunctionNameType; #define FUNCTION_NAME(x) CFSTR(x) #endif // OS_* - + // Loads a native library from disk. NOTE: You must release it with // UnloadNativeLibrary when you're done. static NativeLibrary LoadNativeLibrary(const FilePath& library_path); - + // Unloads a native library. static void UnloadNativeLibrary(NativeLibrary library); - + private: // Gets a function pointer from a native library. static void* GetFunctionPointerFromNativeLibrary( NativeLibrary library, NativeLibraryFunctionNameType name); - + bool internal_; // Whether this an internal plugin. WebPluginInfo web_plugin_info_; // supported mime types, description NativeLibrary library_; // the opened library reference diff --git a/webkit/glue/plugins/plugin_lib_mac.mm b/webkit/glue/plugins/plugin_lib_mac.mm index a8f53ad..f823647 100644 --- a/webkit/glue/plugins/plugin_lib_mac.mm +++ b/webkit/glue/plugins/plugin_lib_mac.mm @@ -37,15 +37,15 @@ PluginLib::NativeLibrary PluginLib::LoadNativeLibrary( true)); if (!url) return NULL; - + return CFBundleCreate(kCFAllocatorDefault, url.get()); } - + /* static */ void PluginLib::UnloadNativeLibrary(NativeLibrary library) { CFRelease(library); } - + /* static */ void* PluginLib::GetFunctionPointerFromNativeLibrary( NativeLibrary library, @@ -59,19 +59,19 @@ NSDictionary* GetMIMETypes(CFBundleRef bundle) { NSString* mime_filename = (NSString*)CFBundleGetValueForInfoDictionaryKey(bundle, CFSTR("WebPluginMIMETypesFilename")); - + if (mime_filename) { - + // get the file - + NSString* mime_path = [NSString stringWithFormat:@"%@/Library/Preferences/%@", NSHomeDirectory(), mime_filename]; NSDictionary* mime_file_dict = [NSDictionary dictionaryWithContentsOfFile:mime_path]; - + // is it valid? - + bool valid_file = false; if (mime_file_dict) { NSString* l10n_name = @@ -80,12 +80,12 @@ NSDictionary* GetMIMETypes(CFBundleRef bundle) { if ([l10n_name isEqualToString:preferred_l10n]) valid_file = true; } - + if (valid_file) return [mime_file_dict objectForKey:@"WebPluginMIMETypes"]; - + // dammit, I didn't want to have to do this - + typedef void (*CreateMIMETypesPrefsPtr)(void); CreateMIMETypesPrefsPtr create_prefs_file = (CreateMIMETypesPrefsPtr)CFBundleGetFunctionPointerForName( @@ -93,15 +93,15 @@ NSDictionary* GetMIMETypes(CFBundleRef bundle) { if (!create_prefs_file) return nil; create_prefs_file(); - + // one more time - + mime_file_dict = [NSDictionary dictionaryWithContentsOfFile:mime_path]; if (mime_file_dict) return [mime_file_dict objectForKey:@"WebPluginMIMETypes"]; else return nil; - + } else { return (NSDictionary*)CFBundleGetValueForInfoDictionaryKey(bundle, CFSTR("WebPluginMIMETypes")); @@ -113,12 +113,12 @@ bool ReadPlistPluginInfo(const FilePath& filename, CFBundleRef bundle, NSDictionary* mime_types = GetMIMETypes(bundle); if (!mime_types) return false; // no type info here; try elsewhere - + for (NSString* mime_type in [mime_types allKeys]) { NSDictionary* mime_dict = [mime_types objectForKey:mime_type]; NSString* mime_desc = [mime_dict objectForKey:@"WebPluginTypeDescription"]; NSArray* mime_exts = [mime_dict objectForKey:@"WebPluginExtensions"]; - + WebPluginMimeType mime; mime.mime_type = base::SysNSStringToUTF8([mime_type lowercaseString]); if (mime_desc) @@ -126,10 +126,10 @@ bool ReadPlistPluginInfo(const FilePath& filename, CFBundleRef bundle, for (NSString* ext in mime_exts) mime.file_extensions.push_back( base::SysNSStringToUTF8([ext lowercaseString])); - + info->mime_types.push_back(mime); } - + NSString* plugin_name = (NSString*)CFBundleGetValueForInfoDictionaryKey(bundle, CFSTR("WebPluginName")); @@ -139,7 +139,7 @@ bool ReadPlistPluginInfo(const FilePath& filename, CFBundleRef bundle, NSString* plugin_desc = (NSString*)CFBundleGetValueForInfoDictionaryKey(bundle, CFSTR("WebPluginDescription")); - + if (plugin_name) info->name = base::SysNSStringToWide(plugin_name); else @@ -151,7 +151,7 @@ bool ReadPlistPluginInfo(const FilePath& filename, CFBundleRef bundle, info->desc = base::SysNSStringToWide(plugin_desc); else info->desc = UTF8ToWide(filename.BaseName().value()); - + return true; } @@ -178,7 +178,7 @@ bool GetSTRResource(CFBundleRef bundle, short res_id, Handle res_handle = Get1Resource('STR#', res_id); if (!res_handle || !*res_handle) return false; - + char* pointer = *res_handle; short num_strings = *(short*)pointer; pointer += sizeof(short); @@ -192,30 +192,30 @@ bool GetSTRResource(CFBundleRef bundle, short res_id, contents->push_back(base::SysCFStringRefToUTF8(str.get())); pointer += 1+*pointer; } - + return true; } bool ReadSTRPluginInfo(const FilePath& filename, CFBundleRef bundle, WebPluginInfo* info) { ScopedBundleResourceFile res_file(bundle); - + std::vector<std::string> type_strings; if (!GetSTRResource(bundle, kSTRTypeDefinitionResourceID, &type_strings)) return false; - + std::vector<std::string> type_descs; bool have_type_descs = GetSTRResource(bundle, kSTRTypeDescriptionResourceID, &type_descs); - + std::vector<std::string> plugin_descs; bool have_plugin_descs = GetSTRResource(bundle, kSTRPluginDescriptionResourceID, &plugin_descs); - + size_t num_types = type_strings.size()/2; - + for (size_t i = 0; i < num_types; ++i) { WebPluginMimeType mime; mime.mime_type = StringToLowerASCII(type_strings[2*i]); @@ -223,14 +223,14 @@ bool ReadSTRPluginInfo(const FilePath& filename, CFBundleRef bundle, mime.description = UTF8ToWide(type_descs[i]); SplitString(StringToLowerASCII(type_strings[2*i+1]), ',', &mime.file_extensions); - + info->mime_types.push_back(mime); } - + NSString* plugin_vers = (NSString*)CFBundleGetValueForInfoDictionaryKey(bundle, CFSTR("CFBundleShortVersionString")); - + if (have_plugin_descs && plugin_descs.size() > 1) info->name = UTF8ToWide(plugin_descs[1]); else @@ -242,10 +242,10 @@ bool ReadSTRPluginInfo(const FilePath& filename, CFBundleRef bundle, info->desc = UTF8ToWide(plugin_descs[0]); else info->desc = UTF8ToWide(filename.BaseName().value()); - + return true; } - + } // anonymous namespace bool PluginLib::ReadWebPluginInfo(const FilePath &filename, @@ -333,33 +333,33 @@ bool PluginLib::ReadWebPluginInfo(const FilePath &filename, // (2) <<pluginname>> // // Strictly speaking, only STR# 128 is required. - + scoped_cftyperef<CFBundleRef> bundle(LoadNativeLibrary(filename)); if (!bundle) return false; - + // preflight - + OSType type = 0; CFBundleGetPackageInfo(bundle.get(), &type, NULL); if (type != FOUR_CHAR_CODE('BRPL')) return false; - + CFErrorRef error; Boolean would_load = CFBundlePreflightExecutable(bundle.get(), &error); if (!would_load) return false; - + // get the info - + if (ReadPlistPluginInfo(filename, bundle.get(), info)) return true; - + if (ReadSTRPluginInfo(filename, bundle.get(), info)) return true; - + // ... or not - + return false; } diff --git a/webkit/glue/plugins/plugin_lib_win.cc b/webkit/glue/plugins/plugin_lib_win.cc index bc662ec..423056a 100644 --- a/webkit/glue/plugins/plugin_lib_win.cc +++ b/webkit/glue/plugins/plugin_lib_win.cc @@ -85,19 +85,19 @@ PluginLib::NativeLibrary PluginLib::LoadNativeLibrary( restore_directory = true; } } - + HMODULE module = LoadLibrary(library_path.value().c_str()); if (restore_directory) PathService::SetCurrentDirectory(current_directory); - + return module; } - + /* static */ void PluginLib::UnloadNativeLibrary(NativeLibrary library) { FreeLibrary(library); } - + /* static */ void* PluginLib::GetFunctionPointerFromNativeLibrary( NativeLibrary library, diff --git a/webkit/glue/plugins/plugin_list.cc b/webkit/glue/plugins/plugin_list.cc index 4d48a9c..129dd3d 100644 --- a/webkit/glue/plugins/plugin_list.cc +++ b/webkit/glue/plugins/plugin_list.cc @@ -141,7 +141,7 @@ bool PluginList::FindPlugin(const GURL &url, std::string* actual_mime_type, std::string::size_type last_dot = path.rfind('.'); if (last_dot == std::string::npos) return false; - + std::string extension = StringToLowerASCII(std::string(path, last_dot+1)); for (size_t i = 0; i < plugins_.size(); ++i) { diff --git a/webkit/glue/plugins/plugin_list.h b/webkit/glue/plugins/plugin_list.h index c425faa..088217e 100644 --- a/webkit/glue/plugins/plugin_list.h +++ b/webkit/glue/plugins/plugin_list.h @@ -91,7 +91,7 @@ class PluginList : public base::RefCounted<PluginList> { // Find a plugin by mime type, and clsid. // If clsid is empty, we will just find the plugin that supports mime type. // Otherwise, if mime_type is application/x-oleobject etc that's supported by - // by our activex shim, we need to check if the specified ActiveX exists. + // by our activex shim, we need to check if the specified ActiveX exists. // If not we will not return the activex shim, instead we will let the // default plugin handle activex installation. // The allow_wildcard parameter controls whether this function returns @@ -124,14 +124,14 @@ class PluginList : public base::RefCounted<PluginList> { // Do any initialization. void PlatformInit(); - + // Get the ordered list of directories from which to load plugins void GetPluginDirectories(std::vector<FilePath>* plugin_dirs); - + // // Command-line switches // - + #if defined(OS_WIN) // true if we shouldn't load the new WMP plugin. bool dont_load_new_wmp_; @@ -143,7 +143,7 @@ class PluginList : public base::RefCounted<PluginList> { // // Internals // - + static scoped_refptr<PluginList> singleton_; bool plugins_loaded_; diff --git a/webkit/glue/plugins/plugin_list_mac.mm b/webkit/glue/plugins/plugin_list_mac.mm index 0ebdb6c..50b07aa 100644 --- a/webkit/glue/plugins/plugin_list_mac.mm +++ b/webkit/glue/plugins/plugin_list_mac.mm @@ -18,13 +18,13 @@ void GetPluginCommonDirectory(std::vector<FilePath>* plugin_dirs, // directories so we can't use Cocoa's NSSearchPathForDirectoriesInDomains(). // Interestingly, Safari hard-codes the location (see // WebKit/WebKit/mac/Plugins/WebPluginDatabase.mm's +_defaultPlugInPaths). - FSRef ref; + FSRef ref; OSErr err = FSFindFolder(user ? kLocalDomain : kUserDomain, kInternetPlugInFolderType, false, &ref); - + if (err) return; - + plugin_dirs->push_back(FilePath(mac_util::PathFromFSRef(ref))); } @@ -32,7 +32,7 @@ void GetPluginPrivateDirectory(std::vector<FilePath>* plugin_dirs) { NSString* plugin_path = [[NSBundle mainBundle] builtInPlugInsPath]; if (!plugin_path) return; - + plugin_dirs->push_back(FilePath([plugin_path fileSystemRepresentation])); } @@ -70,17 +70,17 @@ void PluginList::LoadPluginsFromDir(const FilePath &path) { } bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info) { - + // Hierarchy check // (we're loading plugins hierarchically from Library folders, so plugins we // encounter earlier must override plugins we encounter later) - + for (size_t i = 0; i < plugins_.size(); ++i) { if (plugins_[i].path.BaseName() == info.path.BaseName()) { return false; // We already have a loaded plugin higher in the hierarchy. } } - + return true; } diff --git a/webkit/glue/plugins/plugin_list_win.cc b/webkit/glue/plugins/plugin_list_win.cc index 208211f..bb81ddc 100644 --- a/webkit/glue/plugins/plugin_list_win.cc +++ b/webkit/glue/plugins/plugin_list_win.cc @@ -26,7 +26,7 @@ const TCHAR kRegistryWindowsMedia[] = _T("wmplayer.exe"); const TCHAR kRegistryQuickTime[] = _T("QuickTimePlayer.exe"); const TCHAR kRegistryPath[] = _T("Path"); const TCHAR kRegistryMozillaPlugins[] = _T("SOFTWARE\\MozillaPlugins"); -const TCHAR kRegistryFirefoxInstalled[] = +const TCHAR kRegistryFirefoxInstalled[] = _T("SOFTWARE\\Mozilla\\Mozilla Firefox"); const TCHAR kMozillaActiveXPlugin[] = _T("npmozax.dll"); const TCHAR kNewWMPPlugin[] = _T("np-mswmp.dll"); @@ -100,7 +100,7 @@ void GetPluginsInRegistryDirectory( void GetFirefoxInstalledPaths(std::vector<FilePath>* out) { RegistryKeyIterator it(HKEY_LOCAL_MACHINE, kRegistryFirefoxInstalled); for (; it.Valid(); ++it) { - std::wstring full_path = std::wstring(kRegistryFirefoxInstalled) + L"\\" + + std::wstring full_path = std::wstring(kRegistryFirefoxInstalled) + L"\\" + it.Name() + L"\\Main"; RegKey key(HKEY_LOCAL_MACHINE, full_path.c_str(), KEY_READ); std::wstring install_dir; @@ -172,12 +172,12 @@ void GetJavaDirectory(std::set<FilePath>* plugin_dirs) { if (!java_version.empty()) { java_key.OpenKey(java_version.c_str(), KEY_QUERY_VALUE); - // 3. Install path of the JRE binaries is specified in "JavaHome" + // 3. Install path of the JRE binaries is specified in "JavaHome" // value under the Java version key. std::wstring java_plugin_directory; if (java_key.ReadValue(kRegistryJavaHome, &java_plugin_directory)) { - // 4. The new plugin resides under the 'bin/new_plugin' + // 4. The new plugin resides under the 'bin/new_plugin' // subdirectory. DCHECK(!java_plugin_directory.empty()); java_plugin_directory.append(L"\\bin\\new_plugin"); @@ -193,7 +193,7 @@ void GetJavaDirectory(std::set<FilePath>* plugin_dirs) { namespace NPAPI { - + void PluginList::PlatformInit() { CommandLine command_line; dont_load_new_wmp_ = command_line.HasSwitch(kUseOldWMPPluginSwitch); @@ -214,7 +214,7 @@ void PluginList::GetPluginDirectories(std::vector<FilePath>* plugin_dirs) { // Load Java GetJavaDirectory(&dirs); - // Load firefox plugins too. This is mainly to try to locate + // Load firefox plugins too. This is mainly to try to locate // a pre-installed Flash player. GetFirefoxDirectory(&dirs); @@ -271,18 +271,18 @@ bool IsNewerVersion(const std::wstring& a, const std::wstring& b) { } bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info) { - + // Version check - + for (size_t i = 0; i < plugins_.size(); ++i) { if (plugins_[i].path.BaseName() == info.path.BaseName() && !IsNewerVersion(plugins_[i].version, info.version)) { return false; // We already have a loaded plugin whose version is newer. } } - + // Troublemakers - + std::wstring filename = StringToLowerASCII(info.path.BaseName().value()); // Depends on XPCOM. if (filename == kMozillaActiveXPlugin) @@ -295,7 +295,7 @@ bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info) { return false; // Special WMP handling - + // We will use the ActiveX shim to handle embedded WMP media. if (use_internal_activex_shim_) { if (filename == kNewWMPPlugin || filename == kOldWMPPlugin) @@ -337,7 +337,7 @@ void PluginList::LoadInternalPlugins() { &info)) { plugins_.push_back(info); } -} +} } // namespace NPAPI diff --git a/webkit/glue/plugins/plugin_stream_url.cc b/webkit/glue/plugins/plugin_stream_url.cc index 54dfbdd..15be976 100644 --- a/webkit/glue/plugins/plugin_stream_url.cc +++ b/webkit/glue/plugins/plugin_stream_url.cc @@ -17,7 +17,7 @@ namespace NPAPI { PluginStreamUrl::PluginStreamUrl( int resource_id, const GURL &url, - PluginInstance *instance, + PluginInstance *instance, bool notify_needed, void *notify_data) : PluginStream(instance, url.spec().c_str(), notify_needed, notify_data), diff --git a/webkit/glue/plugins/test/plugin_client.cc b/webkit/glue/plugins/test/plugin_client.cc index b0e7e91..b7158ce 100644 --- a/webkit/glue/plugins/test/plugin_client.cc +++ b/webkit/glue/plugins/test/plugin_client.cc @@ -118,14 +118,14 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, "npobject_lifetime_test") == 0) { new_test = new NPAPIClient::NPObjectLifetimeTest(instance, NPAPIClient::PluginClient::HostFunctions()); - } else if (base::strcasecmp(argv[name_index], + } else if (base::strcasecmp(argv[name_index], "npobject_lifetime_test_second_instance") == 0) { new_test = new NPAPIClient::NPObjectLifetimeTestInstance2(instance, NPAPIClient::PluginClient::HostFunctions()); } else if (base::strcasecmp(argv[name_index], "new_fails") == 0) { new_test = new NPAPIClient::NewFailsTest(instance, NPAPIClient::PluginClient::HostFunctions()); - } else if (base::strcasecmp(argv[name_index], + } else if (base::strcasecmp(argv[name_index], "npobject_delete_plugin_in_evaluate") == 0) { new_test = new NPAPIClient::NPObjectDeletePluginInNPN_Evaluate(instance, NPAPIClient::PluginClient::HostFunctions()); diff --git a/webkit/glue/plugins/test/plugin_delete_plugin_in_stream_test.h b/webkit/glue/plugins/test/plugin_delete_plugin_in_stream_test.h index 2c98cfc..60413cb 100644 --- a/webkit/glue/plugins/test/plugin_delete_plugin_in_stream_test.h +++ b/webkit/glue/plugins/test/plugin_delete_plugin_in_stream_test.h @@ -9,7 +9,7 @@ namespace NPAPIClient { -// This class tests +// This class tests class DeletePluginInStreamTest : public PluginTest { public: // Constructor. diff --git a/webkit/glue/plugins/test/plugin_execute_script_delete_test.cc b/webkit/glue/plugins/test/plugin_execute_script_delete_test.cc index 3f1d0e1..b71ded7 100644 --- a/webkit/glue/plugins/test/plugin_execute_script_delete_test.cc +++ b/webkit/glue/plugins/test/plugin_execute_script_delete_test.cc @@ -16,8 +16,8 @@ ExecuteScriptDeleteTest::ExecuteScriptDeleteTest( int16 ExecuteScriptDeleteTest::HandleEvent(void* event) { - NPNetscapeFuncs* browser = NPAPIClient::PluginClient::HostFunctions(); - + NPNetscapeFuncs* browser = NPAPIClient::PluginClient::HostFunctions(); + NPBool supports_windowless = 0; NPError result = browser->getvalue(id(), NPNVSupportsWindowless, &supports_windowless); @@ -28,20 +28,20 @@ int16 ExecuteScriptDeleteTest::HandleEvent(void* event) { } NPEvent* np_event = reinterpret_cast<NPEvent*>(event); - if (WM_PAINT == np_event->event && + if (WM_PAINT == np_event->event && base::strcasecmp(test_name_.c_str(), "execute_script_delete_in_paint") == 0) { NPUTF8* urlString = "javascript:DeletePluginWithinScript()"; NPUTF8* targetString = NULL; browser->geturl(id(), urlString, targetString); SignalTestCompleted(); - } else if (WM_MOUSEMOVE == np_event->event && + } else if (WM_MOUSEMOVE == np_event->event && base::strcasecmp(test_name_.c_str(), "execute_script_delete_in_mouse_move") == 0) { std::string script = "javascript:DeletePluginWithinScript()"; NPString script_string; script_string.UTF8Characters = script.c_str(); - script_string.UTF8Length = + script_string.UTF8Length = static_cast<unsigned int>(script.length()); NPObject *window_obj = NULL; diff --git a/webkit/glue/plugins/test/plugin_get_javascript_url_test.cc b/webkit/glue/plugins/test/plugin_get_javascript_url_test.cc index 43281f7..054c3d2 100644 --- a/webkit/glue/plugins/test/plugin_get_javascript_url_test.cc +++ b/webkit/glue/plugins/test/plugin_get_javascript_url_test.cc @@ -6,7 +6,7 @@ #include "base/basictypes.h" -// url for "self". +// url for "self". #define SELF_URL "javascript:window.location+\"\"" // The identifier for the self url stream. #define SELF_URL_STREAM_ID 1 diff --git a/webkit/glue/plugins/test/plugin_javascript_open_popup.cc b/webkit/glue/plugins/test/plugin_javascript_open_popup.cc index cd9c121..2ddf698 100644 --- a/webkit/glue/plugins/test/plugin_javascript_open_popup.cc +++ b/webkit/glue/plugins/test/plugin_javascript_open_popup.cc @@ -8,7 +8,7 @@ namespace NPAPIClient { ExecuteJavascriptOpenPopupWithPluginTest:: - ExecuteJavascriptOpenPopupWithPluginTest(NPP id, + ExecuteJavascriptOpenPopupWithPluginTest(NPP id, NPNetscapeFuncs *host_functions) : PluginTest(id, host_functions), popup_window_test_started_(false) { diff --git a/webkit/glue/plugins/test/plugin_npobject_lifetime_test.cc b/webkit/glue/plugins/test/plugin_npobject_lifetime_test.cc index 4e0b20f..8f3a89f 100644 --- a/webkit/glue/plugins/test/plugin_npobject_lifetime_test.cc +++ b/webkit/glue/plugins/test/plugin_npobject_lifetime_test.cc @@ -11,10 +11,10 @@ const int kNPObjectLifetimeTimerElapse = 2000; NPObject* NPObjectLifetimeTestInstance2::plugin_instance_object_ = NULL; -NPObjectDeletePluginInNPN_Evaluate* +NPObjectDeletePluginInNPN_Evaluate* NPObjectDeletePluginInNPN_Evaluate::g_npn_evaluate_test_instance_ = NULL; -NPObjectLifetimeTest::NPObjectLifetimeTest(NPP id, +NPObjectLifetimeTest::NPObjectLifetimeTest(NPP id, NPNetscapeFuncs *host_functions) : PluginTest(id, host_functions), other_plugin_instance_object_(NULL) { @@ -34,15 +34,15 @@ NPError NPObjectLifetimeTest::SetWindow(NPWindow* pNPWindow) { } void CALLBACK NPObjectLifetimeTest::TimerProc( - HWND window, UINT message, UINT timer_id, + HWND window, UINT message, UINT timer_id, unsigned long elapsed_milli_seconds) { KillTimer(window, kNPObjectLifetimeTimer); - NPObjectLifetimeTest* this_instance = + NPObjectLifetimeTest* this_instance = reinterpret_cast<NPObjectLifetimeTest*> (::GetProp(window, L"Plugin_Instance")); - this_instance->other_plugin_instance_object_ = + this_instance->other_plugin_instance_object_ = NPObjectLifetimeTestInstance2::plugin_instance_object_; this_instance->HostFunctions()->retainobject( this_instance->other_plugin_instance_object_); @@ -56,7 +56,7 @@ void CALLBACK NPObjectLifetimeTest::TimerProc( reinterpret_cast<void*>(1)); } -void NPObjectLifetimeTest::URLNotify(const char* url, NPReason reason, +void NPObjectLifetimeTest::URLNotify(const char* url, NPReason reason, void* data) { // Create a "location" identifier. NPIdentifier identifier = HostFunctions()->getstringidentifier("location"); @@ -85,7 +85,7 @@ NPObjectLifetimeTestInstance2::~NPObjectLifetimeTestInstance2() { NPError NPObjectLifetimeTestInstance2::SetWindow(NPWindow* pNPWindow) { if (!plugin_instance_object_) { - if (!HostFunctions()->getvalue(id(), NPNVWindowNPObject, + if (!HostFunctions()->getvalue(id(), NPNVWindowNPObject, &plugin_instance_object_)) { SetError("Failed to get NPObject for plugin instance2"); SignalTestCompleted(); @@ -98,7 +98,7 @@ NPError NPObjectLifetimeTestInstance2::SetWindow(NPWindow* pNPWindow) { NPObjectDeletePluginInNPN_Evaluate::NPObjectDeletePluginInNPN_Evaluate( - NPP id, NPNetscapeFuncs *host_functions) + NPP id, NPNetscapeFuncs *host_functions) : PluginTest(id, host_functions), plugin_instance_object_(NULL), npn_evaluate_timer_proc_set_(false) { @@ -132,7 +132,7 @@ NPError NPObjectDeletePluginInNPN_Evaluate::SetWindow(NPWindow* np_window) { } void CALLBACK NPObjectDeletePluginInNPN_Evaluate::TimerProc( - HWND window, UINT message, UINT timer_id, + HWND window, UINT message, UINT timer_id, unsigned long elapsed_milli_seconds) { KillTimer(window, kNPObjectLifetimeTimer); @@ -151,7 +151,7 @@ void CALLBACK NPObjectDeletePluginInNPN_Evaluate::TimerProc( std::string script = "javascript:DeletePluginWithinScript()"; NPString script_string; script_string.UTF8Characters = script.c_str(); - script_string.UTF8Length = + script_string.UTF8Length = static_cast<unsigned int>(script.length()); NPVariant result_var; diff --git a/webkit/glue/plugins/test/plugin_npobject_lifetime_test.h b/webkit/glue/plugins/test/plugin_npobject_lifetime_test.h index 4ffda5f..935f626 100644 --- a/webkit/glue/plugins/test/plugin_npobject_lifetime_test.h +++ b/webkit/glue/plugins/test/plugin_npobject_lifetime_test.h @@ -10,7 +10,7 @@ namespace NPAPIClient { // The NPObjectLifeTime class tests the case where a plugin has an NPObject -// which points to a different plugin instance on a different frame in the +// which points to a different plugin instance on a different frame in the // page and whether refcounts on this npobject are valid when the source frame // is destroyed. class NPObjectLifetimeTest : public PluginTest { @@ -25,7 +25,7 @@ class NPObjectLifetimeTest : public PluginTest { protected: NPObject* other_plugin_instance_object_; - static void CALLBACK TimerProc(HWND window, UINT message, UINT timer_id, + static void CALLBACK TimerProc(HWND window, UINT message, UINT timer_id, unsigned long elapsed_milli_seconds); }; @@ -58,7 +58,7 @@ class NPObjectDeletePluginInNPN_Evaluate : public PluginTest { protected: NPObject* plugin_instance_object_; - static void CALLBACK TimerProc(HWND window, UINT message, UINT timer_id, + static void CALLBACK TimerProc(HWND window, UINT message, UINT timer_id, unsigned long elapsed_milli_seconds); private: bool npn_evaluate_timer_proc_set_; diff --git a/webkit/glue/plugins/test/plugin_window_size_test.cc b/webkit/glue/plugins/test/plugin_window_size_test.cc index b1b5927..ea8894c 100644 --- a/webkit/glue/plugins/test/plugin_window_size_test.cc +++ b/webkit/glue/plugins/test/plugin_window_size_test.cc @@ -7,13 +7,13 @@ namespace NPAPIClient { -PluginWindowSizeTest::PluginWindowSizeTest(NPP id, +PluginWindowSizeTest::PluginWindowSizeTest(NPP id, NPNetscapeFuncs *host_functions) : PluginTest(id, host_functions) { } NPError PluginWindowSizeTest::SetWindow(NPWindow* pNPWindow) { - if (!pNPWindow || + if (!pNPWindow || !::IsWindow(reinterpret_cast<HWND>(pNPWindow->window))) { SetError("Invalid arguments passed in"); return NPERR_INVALID_PARAM; @@ -24,7 +24,7 @@ NPError PluginWindowSizeTest::SetWindow(NPWindow* pNPWindow) { window_rect.top = pNPWindow->y; window_rect.right = pNPWindow->width; window_rect.bottom = pNPWindow->height; - + if (!::IsRectEmpty(&window_rect)) { RECT client_rect = {0}; ::GetClientRect(reinterpret_cast<HWND>(pNPWindow->window), diff --git a/webkit/glue/plugins/test/plugin_window_size_test.h b/webkit/glue/plugins/test/plugin_window_size_test.h index 7eea3fa..e372940 100644 --- a/webkit/glue/plugins/test/plugin_window_size_test.h +++ b/webkit/glue/plugins/test/plugin_window_size_test.h @@ -9,7 +9,7 @@ namespace NPAPIClient { -// This class tests whether the plugin window has a non zero rect +// This class tests whether the plugin window has a non zero rect // on the second SetWindow call. class PluginWindowSizeTest : public PluginTest { public: diff --git a/webkit/glue/plugins/test/resource.h b/webkit/glue/plugins/test/resource.h index 2f2bf3b..f9680f7 100644 --- a/webkit/glue/plugins/test/resource.h +++ b/webkit/glue/plugins/test/resource.h @@ -3,7 +3,7 @@ // Used by npapitest.rc // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 101 diff --git a/webkit/glue/plugins/webplugin_delegate_impl.cc b/webkit/glue/plugins/webplugin_delegate_impl.cc index fa6ef26..0f713d7 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl.cc +++ b/webkit/glue/plugins/webplugin_delegate_impl.cc @@ -277,7 +277,7 @@ bool WebPluginDelegateImpl::Initialize(const GURL& url, // and remember the cursor being set. This is shipped over to the browser // in the HandleEvent call, which ensures that the cursor does not change // when a windowless plugin instance changes the cursor in a background tab. - if (windowless_ && !iat_patch_set_cursor_.is_patched() && + if (windowless_ && !iat_patch_set_cursor_.is_patched() && (quirks_ & PLUGIN_QUIRK_PATCH_SETCURSOR)) { iat_patch_set_cursor_.Patch(plugin_module_handle_, "user32.dll", "SetCursor", @@ -862,7 +862,7 @@ LRESULT CALLBACK WebPluginDelegateImpl::NativeWndProc( delegate->last_message_ = message; delegate->is_calling_wndproc = true; - if (!delegate->user_gesture_message_posted_ && + if (!delegate->user_gesture_message_posted_ && IsUserGestureMessage(message)) { delegate->user_gesture_message_posted_ = true; @@ -1075,7 +1075,7 @@ WebPluginResourceClient* WebPluginDelegateImpl::CreateResourceClient( if (existing_stream) { NPAPI::PluginStream* plugin_stream = reinterpret_cast<NPAPI::PluginStream*>(existing_stream); - + plugin_stream->CancelRequest(); return plugin_stream->AsResourceClient(); diff --git a/webkit/glue/plugins/webplugin_delegate_impl.h b/webkit/glue/plugins/webplugin_delegate_impl.h index e231d5f..62547c0 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl.h +++ b/webkit/glue/plugins/webplugin_delegate_impl.h @@ -51,7 +51,7 @@ class WebPluginDelegateImpl : public WebPluginDelegate { virtual void Print(HDC hdc); virtual void SetFocus(); // only called when windowless // only called when windowless - virtual bool HandleEvent(NPEvent* event, + virtual bool HandleEvent(NPEvent* event, WebCursor* cursor); virtual NPObject* GetPluginScriptableObject(); virtual void DidFinishLoadWithReason(NPReason reason); @@ -59,9 +59,9 @@ class WebPluginDelegateImpl : public WebPluginDelegate { virtual void FlushGeometryUpdates() { } - virtual void SendJavaScriptStream(const std::string& url, - const std::wstring& result, - bool success, bool notify_needed, + virtual void SendJavaScriptStream(const std::string& url, + const std::wstring& result, + bool success, bool notify_needed, int notify_data); virtual void DidReceiveManualResponse(const std::string& url, const std::string& mime_type, @@ -94,7 +94,6 @@ class WebPluginDelegateImpl : public WebPluginDelegate { PLUGIN_QUIRK_DIE_AFTER_UNLOAD = 32, PLUGIN_QUIRK_PATCH_TRACKPOPUP_MENU = 64, PLUGIN_QUIRK_PATCH_SETCURSOR = 128, - PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS = 256, }; int quirks() { return quirks_; } @@ -116,7 +115,7 @@ class WebPluginDelegateImpl : public WebPluginDelegate { const gfx::Rect& clip_rect, const std::vector<gfx::Rect>& cutout_rects, bool visible); - // Create the native window. + // Create the native window. // Returns true if the window is created (or already exists). // Returns false if unable to create the window. bool WindowedCreatePlugin(); @@ -176,7 +175,7 @@ class WebPluginDelegateImpl : public WebPluginDelegate { bool windowed_did_set_window_; gfx::Rect windowed_last_pos_; - // this is an optimization to avoid calling SetWindow to the plugin + // this is an optimization to avoid calling SetWindow to the plugin // when it is not necessary. Initially, we need to call SetWindow, // and after that we only need to call it when the geometry changes. // use this flag to indicate whether we really need it or not. @@ -208,14 +207,14 @@ class WebPluginDelegateImpl : public WebPluginDelegate { bool initial_plugin_resize_done_; // Windowless plugins don't have keyboard focus causing issues with the - // plugin not receiving keyboard events if the plugin enters a modal + // plugin not receiving keyboard events if the plugin enters a modal // loop like TrackPopupMenuEx or MessageBox, etc. // This is a basic issue with windows activation and focus arising due to // the fact that these windows are created by different threads. Activation // and focus are thread specific states, and if the browser has focus, - // the plugin may not have focus. - // To fix a majority of these activation issues we create a dummy visible - // child window to which we set focus whenever the windowless plugin + // the plugin may not have focus. + // To fix a majority of these activation issues we create a dummy visible + // child window to which we set focus whenever the windowless plugin // receives a WM_LBUTTONDOWN/WM_RBUTTONDOWN message via NPP_HandleEvent. HWND dummy_window_for_activation_; bool CreateDummyWindowForActivation(); |