Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(8391)

Issue 4275048: Add asynchronous InputContext.IsEnabled and InputContext.GetEngine APIs. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 1 month ago by Yusuke Sato
Modified:
13 years, 1 month ago
Reviewers:
shawn.p.huang
CC:
Peng Huang, satorux
Base URL:
git@github.com:ibus/ibus.git@master
Visibility:
Public.

Description

Add asynchronous InputContext.IsEnabled and InputContext.GetEngine APIs. * Added asynchronous InputContext.IsEnabled and InputContext.GetEngine APIs. Now all InputContext IPCs can be async. * Added comments to src/ibusinputcontext.h. * Moved input context tests from ibus-bus.c to ibus-inputcontext.c (new file), and fixed flaky tests. * Fixed typos in bus/. BUG=http://code.google.com/p/ibus/issues/detail?id=1215 TEST=ran the new test

Patch Set 1 : review #

Total comments: 14

Patch Set 2 : rebase #

Patch Set 3 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+417 lines, -71 lines) Patch
M bus/ibusimpl.c View 1 1 chunk +4 lines, -1 line 0 comments Download
M bus/inputcontext.c View 1 1 chunk +1 line, -1 line 0 comments Download
M src/ibusinputcontext.h View 1 11 chunks +80 lines, -8 lines 0 comments Download
M src/ibusinputcontext.c View 6 chunks +91 lines, -7 lines 0 comments Download
M src/tests/.gitignore View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/tests/Makefile.am View 1 2 chunks +4 lines, -0 lines 0 comments Download
M src/tests/ibus-bus.c View 2 chunks +0 lines, -54 lines 0 comments Download
A src/tests/ibus-inputcontext.c View 1 chunk +236 lines, -0 lines 0 comments Download

Messages

Total messages: 5
Yusuke Sato
If you think it's better to change all APIs (i.e. add timeout, cancellable, ... parameters ...
13 years, 1 month ago (2011-03-14 07:09:23 UTC) #1
Peng
http://codereview.appspot.com/4275048/diff/2001/src/ibusinputcontext.c File src/ibusinputcontext.c (right): http://codereview.appspot.com/4275048/diff/2001/src/ibusinputcontext.c#newcode647 src/ibusinputcontext.c:647: if (error != NULL && error->message != NULL) { ...
13 years, 1 month ago (2011-03-14 13:40:46 UTC) #2
Yusuke Sato
all done. But it seems that something weird happened to this rietveld review. So could ...
13 years, 1 month ago (2011-03-18 14:08:01 UTC) #3
Peng
http://codereview.appspot.com/4275048/diff/2001/src/ibusinputcontext.c File src/ibusinputcontext.c (right): http://codereview.appspot.com/4275048/diff/2001/src/ibusinputcontext.c#newcode647 src/ibusinputcontext.c:647: if (error != NULL && error->message != NULL) { ...
13 years, 1 month ago (2011-03-18 15:30:33 UTC) #4
Yusuke Sato
13 years, 1 month ago (2011-03-21 05:13:32 UTC) #5
http://codereview.appspot.com/4275048/diff/2001/src/ibusinputcontext.c
File src/ibusinputcontext.c (right):

http://codereview.appspot.com/4275048/diff/2001/src/ibusinputcontext.c#newcod...
src/ibusinputcontext.c:647: if (error != NULL && error->message != NULL) {
OK, I'm convinced. I'll remove the redundant check.
Please take a look at the new review URL.

On 2011/03/18 15:30:33, Peng wrote:
> IMHO, error must be set, if function call is failed.
> 
> For the case you mentioned, it is a wrong using the API. The passed arguments
> are invalidate. That must be fixed. I think it is not too reasonable to
recovery
> from that kind of faults instead of segment fault. That makes things much
worse.
> right?
> 
> For other cases, if some APIs do not set error, it should be a bug of those
> APIs. We need fix them.
> 
> If we want to add some checking code here, maybe it is better to use g_assert
> (error != NULL).
> 
> 
> On 2011/03/18 14:08:01, Yusuke Sato wrote:
> > I think GDBus functions sometimes return 'fail' without initializing GError.
> For
> > example, g_initable_new_valist might return immediately without initializing
> > GError when g_return_val_if_fail(G_TYPE_IS_INITABLE (object_type), NULL)
> fails.
> > 
> > I tend to be very conservative since I experienced some SEGVs due to the
issue
> > in the past.
> > 
> > What do you think?
> > 
> > On 2011/03/14 13:40:46, Peng wrote:
> > > Is it necessary?
> > 
>

http://codereview.appspot.com/4275048/diff/2001/src/ibusinputcontext.c#newcod...
src/ibusinputcontext.c:845: GError            **error)
ok, I'll file a bug on code.google.com/p/ibus.


On 2011/03/18 15:30:33, Peng wrote:
> On 2011/03/18 14:08:01, Yusuke Sato wrote:
> > Sounds reasonable to me. Fixed the signature of
> > ibus_input_context_is_enabled_async_finish.
> > 
> > BTW, what do you mean by 'for integer'? Do you mean the async functions in
> > ibusbus.h?
> 
> Yeah. Some functions return gint. It is difficult to define which value is
> failed. 0 -1, or other.
> 
> > 
> > On 2011/03/14 13:40:46, Peng wrote:
> > > The return type is boolean value. I think the caller may be confused by
the
> > > return value. Maybe we should define the finish function like:
> > > gboolean xxx_finish(IBusInputContext *context, GAsyncResult *res, gboolean
> > > *retval, GError **error);
> > > 
> > > Return true, if it is successful, otherwise returns false, and use retval
to
> > get
> > > the real return value from ibus-daemon.
> > > 
> > > And I think for integer, it also has similar problem. Maybe it is better
to
> > > define _finish function like it too.
> > > 
> > > What do you think?
> > 
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b