My wife is a comfort eater to begin with, but she has been doing "chocolate therapy" for a while now. She's had a lot to deal with - families suffer from our conditions just like we do. I can tell when she's getting borderline depressed by watching the amount of junk she is easting. I'm trying to get her to see our ARNP since her Lexapro isn't enough.
From what I see, I think there is something to the theory that chocolate produces some endorphins and serotonin. The caffeine may be a small part of it too.