Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Issue 646783005: Mojo JS Bindings: Mojo handles need a toString() method

Created:
6 years, 2 months ago by hansmuller
Modified:
6 years, 1 month ago
Reviewers:
abarth-chromium
CC:
abarth-chromium, Aaron Boodman, ben+mojo_chromium.org, chromium-reviews, darin (slow to review), qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Mojo JS Bindings: Mojo handles need a toString() method The toString() method returns something like this: "[mojo::Handle 28 0x7f1b48059310]". If the handle is invalid, typically because it's been closed, then the small integer raw handle value is "null". The big hex address is included to make it possible to correlate handle strings from before and after a handle has been closed. BUG=426557

Patch Set 1 #

Total comments: 2

Patch Set 2 : Removed address from output, added a unit test #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -0 lines) Patch
M mojo/bindings/js/handle.h View 2 chunks +6 lines, -0 lines 0 comments Download
M mojo/bindings/js/handle.cc View 1 2 chunks +18 lines, -0 lines 0 comments Download
M mojo/public/js/bindings/core_unittests.js View 1 2 chunks +15 lines, -0 lines 1 comment Download

Messages

Total messages: 5 (1 generated)
hansmuller
Please take a look.
6 years, 2 months ago (2014-10-23 23:18:46 UTC) #2
abarth-chromium
Test? https://codereview.chromium.org/646783005/diff/1/mojo/bindings/js/handle.cc File mojo/bindings/js/handle.cc (right): https://codereview.chromium.org/646783005/diff/1/mojo/bindings/js/handle.cc#newcode30 mojo/bindings/js/handle.cc:30: oss << " " << std::hex << this; ...
6 years, 1 month ago (2014-10-24 17:13:27 UTC) #3
hansmuller
I've added a unit test and removed this address from the toString() value. https://codereview.chromium.org/646783005/diff/1/mojo/bindings/js/handle.cc File ...
6 years, 1 month ago (2014-10-24 18:14:02 UTC) #4
abarth-chromium
6 years, 1 month ago (2014-10-24 21:17:10 UTC) #5
LGTM

https://codereview.chromium.org/646783005/diff/20001/mojo/public/js/bindings/...
File mojo/public/js/bindings/core_unittests.js (right):

https://codereview.chromium.org/646783005/diff/20001/mojo/public/js/bindings/...
mojo/public/js/bindings/core_unittests.js:123: var openHandleRE =
/^\[mojo\:\:Handle \d*\]$/ // e.g. "[mojo::Handle 123]"
\d*   ->   \d+

Powered by Google App Engine
This is Rietveld 408576698