Merge "Store layers with pending frames as smart pointers instead of raw pointers"