From 6990820200f6cae5556bdf296ad724e0a4ed833e Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 17 Jan 2013 18:48:17 +0000 Subject: [PATCH] Merge revision 1007 changes: - Allow empty |mimeType| argument to GetDownloadHandler (issue #405). git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/1364@1008 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- cef1/include/cef_request_handler.h | 2 +- cef1/libcef_dll/cpptoc/request_handler_cpptoc.cc | 5 +---- cef1/libcef_dll/ctocpp/request_handler_ctocpp.cc | 5 +---- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/cef1/include/cef_request_handler.h b/cef1/include/cef_request_handler.h index 0ee758f07..a9c7f1d66 100644 --- a/cef1/include/cef_request_handler.h +++ b/cef1/include/cef_request_handler.h @@ -132,7 +132,7 @@ class CefRequestHandler : public virtual CefBase { // CefDownloadHandler instance that will recieve the file contents. Return // true to download the file or false to cancel the file download. /// - /*--cef()--*/ + /*--cef(optional_param=mimeType)--*/ virtual bool GetDownloadHandler(CefRefPtr browser, const CefString& mimeType, const CefString& fileName, diff --git a/cef1/libcef_dll/cpptoc/request_handler_cpptoc.cc b/cef1/libcef_dll/cpptoc/request_handler_cpptoc.cc index 084b33ac4..b499c1b46 100644 --- a/cef1/libcef_dll/cpptoc/request_handler_cpptoc.cc +++ b/cef1/libcef_dll/cpptoc/request_handler_cpptoc.cc @@ -254,10 +254,6 @@ int CEF_CALLBACK request_handler_get_download_handler( DCHECK(browser); if (!browser) return 0; - // Verify param: mimeType; type: string_byref_const - DCHECK(mimeType); - if (!mimeType) - return 0; // Verify param: fileName; type: string_byref_const DCHECK(fileName); if (!fileName) @@ -266,6 +262,7 @@ int CEF_CALLBACK request_handler_get_download_handler( DCHECK(handler); if (!handler) return 0; + // Unverified params: mimeType // Translate param: handler; type: refptr_same_byref CefRefPtr handlerPtr; diff --git a/cef1/libcef_dll/ctocpp/request_handler_ctocpp.cc b/cef1/libcef_dll/ctocpp/request_handler_ctocpp.cc index 7dfd0af98..32f25d3ba 100644 --- a/cef1/libcef_dll/ctocpp/request_handler_ctocpp.cc +++ b/cef1/libcef_dll/ctocpp/request_handler_ctocpp.cc @@ -217,14 +217,11 @@ bool CefRequestHandlerCToCpp::GetDownloadHandler(CefRefPtr browser, DCHECK(browser.get()); if (!browser.get()) return false; - // Verify param: mimeType; type: string_byref_const - DCHECK(!mimeType.empty()); - if (mimeType.empty()) - return false; // Verify param: fileName; type: string_byref_const DCHECK(!fileName.empty()); if (fileName.empty()) return false; + // Unverified params: mimeType // Translate param: handler; type: refptr_same_byref cef_download_handler_t* handlerStruct = NULL;