From the Scientific American article titled How can sea mammals drink saltwater? :
” Although some marine mammals are known to drink seawater at least on occasion, it is not well established that they routinely do so. They have other options: sea-dwelling mammals can get water through their food, and they can produce it internally from the metabolic breakdown of food (water is one of the by-products of carbohydrate and fat metabolism).”
“The salt content of the blood and other body fluids of marine mammals is not very different from that of terrestrial mammals or any other vertebrates: it is about one third as salty as seawater. Because a vertebrate that drinks seawater is imbibing something three times saltier than its blood, it must get rid of the excess salt by producing very salty urine. In the seal and sea lion species, for which measurements exist, the animals’ urine contains up to two and a half times more salt than seawater does and seven or eight times more salt than their blood.”
The article goes on to elaborate in more detail. Pretty interesting.
Your first two ideas were correct – they can drink and process salt water, and they also get it from food. The primordial seas were not fresh water, as the salt largely comes from sediment from rivers that accumulates to higher concentrations in seas because seas don’t flow but do evaporate. Animals went the opposite direction from how you wrote it, from sea mammals who can drink seawater to land animals who can’t, no doubt because processing salt water wasn’t necessary so they adapted to the less salty conditions on land, losing their saltwater adaptation.