OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 "android_webview/browser/compositor_id.h" |
| 6 #include "content/public/common/child_process_host.h" |
| 7 |
| 8 namespace android_webview { |
| 9 |
| 10 CompositorID::CompositorID() |
| 11 : process_id(content::ChildProcessHost::kInvalidUniqueID), |
| 12 routing_id(content::ChildProcessHost::kInvalidUniqueID) {} |
| 13 |
| 14 CompositorID::CompositorID(int process_id, int routing_id) |
| 15 : process_id(process_id), routing_id(routing_id) {} |
| 16 |
| 17 CompositorID::CompositorID(const CompositorID& other) = default; |
| 18 |
| 19 CompositorID& CompositorID::operator=(const CompositorID& other) { |
| 20 process_id = other.process_id; |
| 21 routing_id = other.routing_id; |
| 22 return *this; |
| 23 } |
| 24 |
| 25 bool CompositorID::Equals(const CompositorID& other) const { |
| 26 return process_id == other.process_id && routing_id == other.routing_id; |
| 27 } |
| 28 |
| 29 bool CompositorIDComparator::operator()(const CompositorID& a, |
| 30 const CompositorID& b) const { |
| 31 if (a.process_id == b.process_id) { |
| 32 return a.routing_id < b.routing_id; |
| 33 } |
| 34 return a.process_id < b.process_id; |
| 35 } |
| 36 |
| 37 } // namespace android_webview |
OLD | NEW |