Once upon a time, happy ending was only used in the context of fiction. But since then, it's been used as a euphemism for sexual release at the end of an erotic massage.
When did "Happy ending" get the second meaning? Was this meaning made popular by non-native speakers of English?
Google NGrams isn't useful because of the existing meaning, and the Online Etymology Dictionary pointedly only refers to the original meaning:
Happy ending in the literary sense recorded from 1756.