I've reviewed a paper by section editors in their own journal. I can't speak to common practice, but for this particular paper, in this particular journal, the practice was to simply assign the paper to the editor of a different section. My assumption is that confidentiality was maintained. I imagine the handling for an editor-in-chief would be similar, and that the paper would go to a section editor who would handle everything.
In this particular instance, I can't say I was real happy with the outcome. There was a major mistake of interpretation of the manuscript. The other two reviewers simply missed it (don't get me started about referees who choose to do no work!!), and just about recommended acceptance with no revisions, and my recommendation was much more harsh . The author acknowledged the error and rewrote the results and discussion-- changing the paper from "Earlier investigators found 'A', but using this new method, we find the exact opposite of 'A'" to "We find 'A', just like everyone else", making it a much less important contribution. I felt that if the author were not a section editor, the paper would not have been accepted to that high profile of a journal. I don't think I'd referee under those circumstances again.