start using __declspec

This commit is contained in:
anthony taranto
2012-02-24 02:25:31 -08:00
parent 55fa6c3830
commit e042d31700
12 changed files with 60 additions and 53 deletions
+9 -11
View File
@@ -47,47 +47,45 @@ namespace CefSharp
SetEvent(_event);
}
void ScriptCore::Execute(CefRefPtr<CefFrame> frame, String^ script)
void ScriptCore::Execute(CefRefPtr<CefFrame> frame, CefString script)
{
if (CefCurrentlyOn(TID_UI))
{
UIT_Execute(frame, toNative(script));
UIT_Execute(frame, script);
}
else
{
CefPostTask(TID_UI, NewCefRunnableMethod(this, &ScriptCore::UIT_Execute,
frame, toNative(script)));
frame, script));
}
}
String^ ScriptCore::Evaluate(CefRefPtr<CefFrame> frame, String^ script, TimeSpan timeout)
CefString ScriptCore::Evaluate(CefRefPtr<CefFrame> frame, CefString script, int timeout)
{
AutoLock lock_scope(this);
if (CefCurrentlyOn(TID_UI))
{
UIT_Evaluate(frame, toNative(script));
UIT_Evaluate(frame, script);
}
else
{
CefPostTask(TID_UI, NewCefRunnableMethod(this, &ScriptCore::UIT_Evaluate,
frame, toNative(script)));
frame, script));
if (WaitForSingleObject(_event, timeout.TotalMilliseconds))
if (WaitForSingleObject(_event, timeout))
{
throw gcnew ScriptException("Script timed out");
}
}
String^ result = toClr(_result);
if (!_success)
{
throw gcnew ScriptException(result);
throw gcnew ScriptException(toClr(_result));
}
else
{
return result;
return _result;
}
}
}