Skip to content

Commit

Permalink
[jumbo] avoid operator clashes between media_devices.h and page_state.h
Browse files Browse the repository at this point in the history
CL https://chromium-review.googlesource.com/c/chromium/src/+/1019245 seems
to have introduced a jumbo build failure:

./../../content/browser/renderer_host/media/media_devices_manager.cc:704:37: error: reference to overloaded function could not be resolved; did you mean to call it?
                  ignore_group_id ? operator== : EqualDeviceAndGroupID)) {
                                    ^~~~~~~~~~
../../content/common/media/media_devices.h:52:6: note: possible target for call
bool operator==(const MediaDeviceInfo& first, const MediaDeviceInfo& second);
     ^
../../content/public/common/page_state.h:63:13: note: possible target for call
inline bool operator==(const PageState& a, const PageState& b) {
            ^

Let's move page_state.h's ==/!= operators out of the global scope, to avoid this.

[email protected]

Bug: 834281
Change-Id: I27f0493ee2d2957b8318c969edd5615ec4dab687
Reviewed-on: https://chromium-review.googlesource.com/1042308
Commit-Queue: Morten Stenshorne <[email protected]>
Reviewed-by: Guido Urdaneta <[email protected]>
Cr-Commit-Position: refs/heads/master@{#555767}
  • Loading branch information
mostynb authored and Commit Bot committed May 3, 2018
1 parent 5f1039f commit 6210600
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions content/public/common/page_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,18 @@ class CONTENT_EXPORT PageState {
PageState RemoveScrollOffset() const;
PageState RemoveReferrer() const;

// Support DCHECK_EQ(a, b), etc.
bool operator==(const PageState& other) const { return this->Equals(other); }
bool operator!=(const PageState& other) const {
return !(this->Equals(other));
}

private:
PageState(const std::string& data);

std::string data_;
};

// Support DCHECK_EQ(a, b), etc.
inline bool operator==(const PageState& a, const PageState& b) {
return a.Equals(b);
}
inline bool operator!=(const PageState& a, const PageState& b) {
return !(a == b);
}

} // namespace content

#endif // CONTENT_PUBLIC_COMMON_PAGE_STATE_H_

0 comments on commit 6210600

Please sign in to comment.