Mojo: Make mojo::Handle::value() return a reference instead of a value.

Getting the value is fine and fast, but returning a reference has the
advantage of allowing you to pass &handle.value() to anything taking a
|const MojoHandle*| (without needing to save to a temporary variable).

R=sky@chromium.org

Review URL: https://codereview.chromium.org/417583002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285019 0039d316-1c4b-4281-b951-d872f2087c98
parent ef2b06da
...@@ -174,7 +174,7 @@ class Handle { ...@@ -174,7 +174,7 @@ class Handle {
return value_ != kInvalidHandleValue; return value_ != kInvalidHandleValue;
} }
MojoHandle value() const { return value_; } const MojoHandle& value() const { return value_; }
MojoHandle* mutable_value() { return &value_; } MojoHandle* mutable_value() { return &value_; }
void set_value(MojoHandle value) { value_ = value; } void set_value(MojoHandle value) { value_ = value; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment