Chromium Code Reviews| 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) {} | |
|
boliu
2016/06/13 15:30:44
does this apply to routing_id too?
either way, I
hush (inactive)
2016/06/14 23:48:28
it does apply to routing_id. Example here: https:/
| |
| 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 operator==(const CompositorID& lhs, const CompositorID& rhs) { | |
| 26 return lhs.process_id == rhs.process_id && lhs.routing_id == rhs.routing_id; | |
| 27 } | |
| 28 | |
| 29 bool operator<(const CompositorID& lhs, const CompositorID& rhs) { | |
| 30 if (lhs.process_id == rhs.process_id) { | |
| 31 return lhs.routing_id < rhs.routing_id; | |
| 32 } | |
| 33 return lhs.process_id < rhs.process_id; | |
| 34 } | |
| 35 | |
| 36 bool operator!=(const CompositorID& lhs, const CompositorID& rhs) { | |
| 37 return !(lhs == rhs); | |
| 38 } | |
| 39 | |
| 40 bool operator>(const CompositorID& lhs, const CompositorID& rhs) { | |
| 41 return rhs < lhs; | |
| 42 } | |
| 43 | |
| 44 bool operator<=(const CompositorID& lhs, const CompositorID& rhs) { | |
| 45 return !(rhs > lhs); | |
| 46 } | |
| 47 | |
| 48 bool operator>=(const CompositorID& lhs, const CompositorID& rhs) { | |
| 49 return !(lhs < rhs); | |
| 50 } | |
| 51 | |
| 52 } // namespace android_webview | |
| OLD | NEW |