The structure of peroxides - $\ce{ROOR}$ - implies that the oxygens will generally exhibit -1 oxidation states. Oxidation states are assigned as if all bonding is ionic.
Given that oxygen is the second most electronegative element on the periodic table, we would expect that all the electrons in the $\ce{R-O}$ bond to be "taken" by oxygen (unless $\ce{R=F}$ as in the case of $\ce{FOOF}$).
In the $\ce{O-O}$ bond, however, the electrons are split 50/50 between the two oxygens (since both are of equal atomic electronegativities).
Therefore each oxygen has an oxidation state of -1 in peroxides (usually): each oxygen has 3 bonding electrons and 4 lone pair electrons for a total of 7 electrons, and oxygen by itself only has 6 electrons. 6 minus 7 is -1.