Chromium Code Reviews| Index: android_webview/browser/compositor_id.cc |
| diff --git a/android_webview/browser/compositor_id.cc b/android_webview/browser/compositor_id.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..823186d048573b65bbb3ce06b1528be98d2ae3eb |
| --- /dev/null |
| +++ b/android_webview/browser/compositor_id.cc |
| @@ -0,0 +1,38 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "android_webview/browser/compositor_id.h" |
| +#include "content/public/common/child_process_host.h" |
| + |
| +namespace android_webview { |
| + |
| +CompositorID::CompositorID() |
| + : process_id(content::ChildProcessHost::kInvalidUniqueID), |
| + routing_id(content::ChildProcessHost::kInvalidUniqueID) {} |
| + |
| +CompositorID::CompositorID(int process_id, int routing_id) |
| + : process_id(process_id), routing_id(routing_id) {} |
| + |
| +CompositorID::CompositorID(const CompositorID& other) = default; |
| + |
| +bool CompositorID::operator==(const CompositorID& other) const { |
| + return process_id == other.process_id && routing_id == other.routing_id; |
| +} |
| + |
| +bool CompositorID::operator<(const CompositorID& other) const { |
|
boliu
2016/06/10 15:55:38
Actually, overloading operator< was bad advice. St
hush (inactive)
2016/06/10 23:28:43
i overloaded everything in the new patchset
|
| + if (process_id == other.process_id) { |
| + return routing_id < other.routing_id; |
| + } |
| + return process_id < other.process_id; |
| +} |
| + |
| +bool CompositorID::operator>(const CompositorID& other) const { |
| + return other < *this; |
| +} |
| + |
| +bool CompositorID::operator!=(const CompositorID& other) const { |
| + return !(operator==(other)); |
| +} |
| + |
| +} // namespace android_webview |