From f0d441c73741a50c69b0e71908e1de76e5956f41 Mon Sep 17 00:00:00 2001 From: "apatrick@google.com" Date: Tue, 14 Jul 2009 19:54:17 +0000 Subject: StreamOperation gets url scheme from full path rather than relative path. Fixes IE. Review URL: http://codereview.chromium.org/155521 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20639 0039d316-1c4b-4281-b951-d872f2087c98 --- .../npapi_host_control/win/stream_operation.cc | 23 +++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'o3d') diff --git a/o3d/plugin/npapi_host_control/win/stream_operation.cc b/o3d/plugin/npapi_host_control/win/stream_operation.cc index a72d1a5..8c0e385 100644 --- a/o3d/plugin/npapi_host_control/win/stream_operation.cc +++ b/o3d/plugin/npapi_host_control/win/stream_operation.cc @@ -489,18 +489,7 @@ HRESULT STDMETHODCALLTYPE StreamOperation::OnObjectAvailable(REFIID riid, HRESULT StreamOperation::OpenURL(NPPluginProxy *owning_plugin, const wchar_t *url, void *notify_data) { - // Validate the URL. If the URL is invalid there is no need to create a new - // thread only to have it immediately fail. HRESULT hr; - URL_COMPONENTS components = { sizeof(URL_COMPONENTS) }; - if (!InternetCrackUrl(url, 0, 0, &components)) - return E_INVALIDARG; - if (components.nScheme != INTERNET_SCHEME_FILE && - components.nScheme != INTERNET_SCHEME_FTP && - components.nScheme != INTERNET_SCHEME_HTTP && - components.nScheme != INTERNET_SCHEME_HTTPS) { - return E_INVALIDARG; - } // The StreamOperation instance is created with a ref-count of zero, // so we explicitly attach a CComPtr to the object to boost the count, and @@ -529,6 +518,18 @@ HRESULT StreamOperation::OpenURL(NPPluginProxy *owning_plugin, stream_object->SetFullURL(full_path); + // Validate the URL. If the URL is invalid there is no need to create a new + // thread only to have it immediately fail. + URL_COMPONENTS components = { sizeof(URL_COMPONENTS) }; + if (!InternetCrackUrl(full_path, 0, 0, &components)) + return E_INVALIDARG; + if (components.nScheme != INTERNET_SCHEME_FILE && + components.nScheme != INTERNET_SCHEME_FTP && + components.nScheme != INTERNET_SCHEME_HTTP && + components.nScheme != INTERNET_SCHEME_HTTPS) { + return E_INVALIDARG; + } + // Create an object window on this thread that will be sent messages when // something happens on the worker thread. HWND temporary_window = stream_object->Create(HWND_DESKTOP); -- cgit v1.1