Return Async task for GetSource/GetText based on review.

This commit is contained in:
Bill Tutt
2015-05-04 18:52:34 -04:00
parent 3d4f2a76d6
commit ac0b52d646
3 changed files with 12 additions and 10 deletions
+8 -6
View File
@@ -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?
+2 -2
View File
@@ -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
View File
@@ -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?
///