1. Preheat oven to 350 degrees. Butter two 9-by-2-inch round cake pans; line with parchment rounds, and butter parchment. Dust with flour, tapping out excess. In a medium bowl, whisk together flour, cocoa, and salt.
2. With an electric mixer on medium speed, beat sugar and oil until well combined. Add eggs, 1 at a time, beating well after each addition. Add food coloring and vanilla; beat until well combined. Add flour mixture in 2 batches, alternating with the buttermilk and beginning and ending with the flour; beat until just combined, scraping sides of bowl as needed.
3. In a small bowl, mix baking soda and vinegar. Add to batter; beat 10 seconds. Divide batter evenly between prepared pans. Bake until a cake tester comes out clean, 30 to 35 minutes. Transfer pans to a wire rack to cool 15 minutes. Turn out cakes onto rack to cool completely.
4. Place bottom cake layer on a cake stand or platter, and spread evenly with about 1 1/2 cups cream-cheese frosting. Place second layer on top; spread and swirl remaining frosting over cake. Cake can be refrigerated up to 6 hours; bring to room temperature before serving.
For cream-cheese frosting:
1. With an electric mixer on medium speed, beat cream cheese and vanilla until light and creamy, about 2 minutes. Add butter, beating until incorporated.
2. Reduce speed to low. Gradually add confectioners' sugar, 1 cup at a time, and beat until fluffy and smooth. Frosting can be refrigerated in an airtight container up to 3 days. Bring to room temperature, and beat on low speed before using.