diff --git a/CefSharp/CefFormsWebBrowser.cpp b/CefSharp/CefFormsWebBrowser.cpp index 6020a9e1e..77d837b26 100644 --- a/CefSharp/CefFormsWebBrowser.cpp +++ b/CefSharp/CefFormsWebBrowser.cpp @@ -1,8 +1,6 @@ #include "stdafx.h" #include "CefFormsWebBrowser.h" -#include "JsTask.h" -#include "ScriptException.h" using namespace System::Drawing; @@ -73,33 +71,9 @@ namespace CefSharp String^ CefFormsWebBrowser::RunScript(String^ script, String^ scriptUrl, int startLine, int timeout) { WaitForInitialized(); - - _jsError = false; - _jsResult = nullptr; - /* - script = - "(function() {" - " try { " - " __js_run_done(" + script + ");" - " } catch(e) {" - " __js_run_err(e);" - " }" - "})();"; - */ - - CefRefPtr task = new JsTask(this, toNative(script), toNative(scriptUrl), startLine); - _clientAdapter->GetCefBrowser()->GetMainFrame()->ExecuteJavaScriptTask(static_cast>(task)); - if(!_runJsFinished->WaitOne(timeout)) - { - throw gcnew TimeoutException(L"Timed out waiting for JavaScript to return"); - } - - if(_jsError == false) - { - return _jsResult; - } - throw gcnew ScriptException("An error occurred during javascript execution"); + // XXX; reimplement + return nullptr; } void CefFormsWebBrowser::OnInitialized() diff --git a/CefSharp/CefSharp.vcproj b/CefSharp/CefSharp.vcproj index ed8935d21..5a43e3a56 100644 --- a/CefSharp/CefSharp.vcproj +++ b/CefSharp/CefSharp.vcproj @@ -242,10 +242,6 @@ RelativePath=".\ClientAdapter.cpp" > - - @@ -262,10 +258,6 @@ RelativePath=".\SchemeHandler.cpp" > - - @@ -348,10 +340,6 @@ RelativePath=".\ICefWebBrowser.h" > - - @@ -376,10 +364,6 @@ RelativePath=".\SchemeHandler.h" > - - diff --git a/CefSharp/CefWpfWebBrowser.cpp b/CefSharp/CefWpfWebBrowser.cpp index de996e8b6..b748e5664 100644 --- a/CefSharp/CefWpfWebBrowser.cpp +++ b/CefSharp/CefWpfWebBrowser.cpp @@ -1,8 +1,6 @@ #include "stdafx.h" #include "CefWpfWebBrowser.h" -#include "JsTask.h" -#include "ScriptException.h" namespace CefSharp { @@ -81,33 +79,9 @@ namespace CefSharp String^ CefWpfWebBrowser::RunScript(String^ script, String^ scriptUrl, int startLine, int timeout) { WaitForInitialized(); - - _jsError = false; - _jsResult = nullptr; - /* - script = - "(function() {" - " try { " - " __js_run_done(" + script + ");" - " } catch(e) {" - " __js_run_err(e);" - " }" - "})();"; - */ - - CefRefPtr task = new JsTask(this, toNative(script), toNative(scriptUrl), startLine); - _clientAdapter->GetCefBrowser()->GetMainFrame()->ExecuteJavaScriptTask(static_cast>(task)); - if(!_runJsFinished->WaitOne(timeout)) - { - throw gcnew TimeoutException(L"Timed out waiting for JavaScript to return"); - } - - if(_jsError == false) - { - return _jsResult; - } - throw gcnew ScriptException("An error occurred during javascript execution"); + // XXX; reimplement + return nullptr; } void CefWpfWebBrowser::OnInitialized() diff --git a/CefSharp/JsTask.cpp b/CefSharp/JsTask.cpp deleted file mode 100644 index 9c160b788..000000000 --- a/CefSharp/JsTask.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include "stdafx.h" -#include "JsTask.h" -#include "Utils.h" - -namespace CefSharp -{ - void JsTask::HandleSuccess(CefRefPtr result) - { - Object^ obj = convertFromCef(result); - if(obj != nullptr) - { - _browser->SetJsResult(obj->ToString()); - } - else - { - _browser->SetJsResult(""); - } - } - - void JsTask::HandleError() - { - _browser->SetJsError(); - } - -} \ No newline at end of file diff --git a/CefSharp/JsTask.h b/CefSharp/JsTask.h deleted file mode 100644 index 3c44d14d1..000000000 --- a/CefSharp/JsTask.h +++ /dev/null @@ -1,29 +0,0 @@ -#include "stdafx.h" -#pragma once - -#include "ICefWebBrowser.h" - -namespace CefSharp -{ - class JsTask : public CefV8Task - { - gcroot _browser; - CefString _script; - CefString _scriptName; - int _lineNo; - public: - JsTask(ICefWebBrowser^ browser, CefString script, CefString scriptName, int lineNo) - : _browser(browser), _script(script), _scriptName(scriptName), _lineNo(lineNo) - { - } - - virtual CefString GetScript() { return _script; }; - virtual CefString GetScriptName() { return _scriptName; }; - virtual int GetStartLine() { return _lineNo; }; - virtual void HandleSuccess(CefRefPtr result); - virtual void HandleError(); - - IMPLEMENT_REFCOUNTING(JsTask); - }; - -} \ No newline at end of file diff --git a/CefSharp/ScriptException.cpp b/CefSharp/ScriptException.cpp deleted file mode 100644 index 0d39ff256..000000000 --- a/CefSharp/ScriptException.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "stdafx.h" - -namespace CefSharp -{ -} \ No newline at end of file diff --git a/CefSharp/ScriptException.h b/CefSharp/ScriptException.h deleted file mode 100644 index 0f7daaf31..000000000 --- a/CefSharp/ScriptException.h +++ /dev/null @@ -1,28 +0,0 @@ -#include "stdafx.h" -#pragma once - -using namespace System; -using namespace System::Runtime::Serialization; - -namespace CefSharp -{ - public ref class ScriptException : public Exception - { - public: ScriptException() - : Exception() - {} - - public: ScriptException(String^ message) - : Exception(message) - {} - - public: ScriptException(String^ message, Exception^ innerException) - : Exception(message, innerException) - {} - - public: ScriptException(SerializationInfo^ info, StreamingContext context) - : Exception(info, context) - {} - }; - -} \ No newline at end of file