1 // Copyright 2019 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "content/public/browser/media_player_id.h" 6 7 #include "content/public/browser/render_frame_host.h" 8 9 namespace content { 10 MediaPlayerId(RenderFrameHost * render_frame_host,int delegate_id)11MediaPlayerId::MediaPlayerId(RenderFrameHost* render_frame_host, 12 int delegate_id) 13 : render_frame_host(render_frame_host), delegate_id(delegate_id) {} 14 CreateMediaPlayerIdForTests()15MediaPlayerId MediaPlayerId::CreateMediaPlayerIdForTests() { 16 return MediaPlayerId(nullptr, 0); 17 } 18 operator ==(const MediaPlayerId & other) const19bool MediaPlayerId::operator==(const MediaPlayerId& other) const { 20 return render_frame_host == other.render_frame_host && 21 delegate_id == other.delegate_id; 22 } 23 operator !=(const MediaPlayerId & other) const24bool MediaPlayerId::operator!=(const MediaPlayerId& other) const { 25 return render_frame_host != other.render_frame_host || 26 delegate_id != other.delegate_id; 27 } 28 operator <(const MediaPlayerId & other) const29bool MediaPlayerId::operator<(const MediaPlayerId& other) const { 30 if (render_frame_host == other.render_frame_host) 31 return delegate_id < other.delegate_id; 32 return render_frame_host < other.render_frame_host; 33 } 34 35 } // namespace content 36