Skip to content

Commit

Permalink
Clean up deprecated EncodableValue code (flutter#20981)
Browse files Browse the repository at this point in the history
Removes the older pointer-based versions of APIs taking EncodableValues for which there are now reference-based versions.
  • Loading branch information
stuartmorgan committed Sep 11, 2020
1 parent 216a1ab commit 83cc923
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,12 @@ class EventSink {
EventSink(EventSink const&) = delete;
EventSink& operator=(EventSink const&) = delete;

// DEPRECATED. Use the reference version below. This will be removed in the
// near future.
void Success(const T* event) { SuccessInternal(event); }

// Consumes a successful event
void Success(const T& event) { SuccessInternal(&event); }

// Consumes a successful event.
void Success() { SuccessInternal(nullptr); }

// DEPRECATED. Use the reference version below. This will be removed in the
// near future.
void Error(const std::string& error_code,
const std::string& error_message,
const T* error_details) {
ErrorInternal(error_code, error_message, error_details);
}

// Consumes an error event.
void Error(const std::string& error_code,
const std::string& error_message,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ class MethodResult {
MethodResult(MethodResult const&) = delete;
MethodResult& operator=(MethodResult const&) = delete;

// DEPRECATED. Use the reference versions below. This will be removed in the
// near future.
void Success(const T* result) { SuccessInternal(result); }

// Sends a success response, indicating that the call completed successfully
// with the given result.
void Success(const T& result) { SuccessInternal(&result); }
Expand All @@ -36,14 +32,6 @@ class MethodResult {
// with no result.
void Success() { SuccessInternal(nullptr); }

// DEPRECATED. Use the reference versions below. This will be removed in the
// near future.
void Error(const std::string& error_code,
const std::string& error_message,
const T* error_details) {
ErrorInternal(error_code, error_message, error_details);
}

// Sends an error response, indicating that the call was understood but
// handling failed in some way.
//
Expand Down
2 changes: 1 addition & 1 deletion shell/platform/glfw/platform_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void PlatformHandler::HandleMethodCall(
rapidjson::Document::AllocatorType& allocator = document.GetAllocator();
document.AddMember(rapidjson::Value(kTextKey, allocator),
rapidjson::Value(clipboardData, allocator), allocator);
result->Success(&document);
result->Success(document);
} else if (method.compare(kSetClipboardDataMethod) == 0) {
if (!window_) {
result->Error(kNoWindowError,
Expand Down

0 comments on commit 83cc923

Please sign in to comment.