mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-06 04:00:07 +00:00
Return Async task for GetSource/GetText based on review.
This commit is contained in:
@@ -95,10 +95,11 @@ void CefFrameWrapper::ViewSource()
|
||||
// visitor.
|
||||
///
|
||||
/*--cef()--*/
|
||||
void CefFrameWrapper::GetSource(IStringVisitor^ visitor)
|
||||
Task<String^>^ CefFrameWrapper::GetSourceAsync()
|
||||
{
|
||||
auto stringVisitor = new StringVisitor(visitor);
|
||||
_frame->GetSource(stringVisitor);
|
||||
auto taskStringVisitor = gcnew TaskStringVisitor();
|
||||
_frame->GetSource(new StringVisitor(taskStringVisitor));
|
||||
return taskStringVisitor->Task;
|
||||
}
|
||||
|
||||
///
|
||||
@@ -106,10 +107,11 @@ void CefFrameWrapper::GetSource(IStringVisitor^ visitor)
|
||||
// visitor.
|
||||
///
|
||||
/*--cef()--*/
|
||||
void CefFrameWrapper::GetText(IStringVisitor^ visitor)
|
||||
Task<String^>^ CefFrameWrapper::GetTextAsync()
|
||||
{
|
||||
auto stringVisitor = new StringVisitor(visitor);
|
||||
_frame->GetText(stringVisitor);
|
||||
auto taskStringVisitor = gcnew TaskStringVisitor();
|
||||
_frame->GetText(new StringVisitor(taskStringVisitor));
|
||||
return taskStringVisitor->Task;
|
||||
}
|
||||
|
||||
// TODO: Do we need this?
|
||||
|
||||
@@ -94,14 +94,14 @@ namespace CefSharp
|
||||
// visitor.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void GetSource(IStringVisitor^ visitor);
|
||||
virtual Task<String^>^ GetSourceAsync();
|
||||
|
||||
///
|
||||
// Retrieve this frame's display text as a string sent to the specified
|
||||
// visitor.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void GetText(IStringVisitor^ visitor);
|
||||
virtual Task<String^>^ GetTextAsync();
|
||||
|
||||
// TODO: Do we need this?
|
||||
///
|
||||
|
||||
+2
-2
@@ -72,14 +72,14 @@ namespace CefSharp
|
||||
// visitor.
|
||||
///
|
||||
/*--cef()--*/
|
||||
void GetSource(IStringVisitor visitor);
|
||||
Task<string> GetSourceAsync();
|
||||
|
||||
///
|
||||
// Retrieve this frame's display text as a string sent to the specified
|
||||
// visitor.
|
||||
///
|
||||
/*--cef()--*/
|
||||
void GetText(IStringVisitor visitor);
|
||||
Task<string> GetTextAsync();
|
||||
|
||||
// TODO: Expose a public constructor to CefRequestWrapper maybe?
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user