A new scientific theory is postulating warm-bloodedness was a response to the conditions of plant eaters, not predators. The theory is still quite new and therefore strong on predictions but short on evidence. However, it does seem to neatly explain why both mammals and (presumably) dinosaurs selected what would otherwise be considered a quite wasteful metabolic strategy.