One of the proposed damping mechanisms of coronal (transverse) loop oscillations in the kink mode is resonant absorption as a result of the Alfven speed variation at the outer boundary of coronal loops. Analytical expressions for the period and damping time exist for loop models with thin nonuniform boundaries. They predict a linear dependency of the ratio of the damping time to the period on the thickness of the nonuniform boundary layer. Ruderman and Roberts used a sinusoidal variation of the density in the nonuniform boundary layer and obtained the corresponding analytical expression for the damping time. Here we measure the thickness of the nonuniform layer in oscillating loops for 11 events, by forward-fitting of the cross-sectional density profile n(e)(r) and line-of-sight integration to the cross-sectional fluxes F(r) observed with TRACE 171 Angstrom. This way we model the internal (n(i)) and external electron density (n(e)) of the coronal plasma in oscillating loops. This allows us to test the theoretically predicted damping rates for thin boundaries as a function of the density ratio chi = n(e)/n(i). Since the observations show that the loops have nonuniform density profiles, we also use numerical results for damping rates to determine the value of chi for the loops. We find that the density ratio predicted by the damping time, chi(LEDA) = 0.53 +/- 0.12, is a factor of approximate to1.2-3.5 higher than the density ratio estimated from the background fluxes, chi = 0.30 +/- 0.16. The lower densities modeled from the background fluxes are likely to be a consequence of the neglected hotter plasma that is not detected with the TRACE 171 Angstrom filter. Taking these corrections into account, resonant absorption predicts damping times of kink-mode oscillations that are commensurable with the observed ones and provides a new diagnostic of the density contrast of oscillating loops.