| Index: mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc
|
| diff --git a/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc b/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc
|
| index d45fab8f5bab4f18c954a71458a25943e15e449d..a31f305ae4b2b0dc59e90fd1b50dc4a49c11b611 100644
|
| --- a/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc
|
| +++ b/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc
|
| @@ -137,11 +137,18 @@ class ViewManagerTransaction {
|
| return client_->next_server_change_id_++;
|
| }
|
|
|
| + // TODO(sky): nuke this and covert all to new one, then rename
|
| + // ActionCompletedCallbackWithErrorCode to ActionCompletedCallback.
|
| base::Callback<void(bool)> ActionCompletedCallback() {
|
| return base::Bind(&ViewManagerTransaction::OnActionCompleted,
|
| base::Unretained(this));
|
| }
|
|
|
| + base::Callback<void(ErrorCode)> ActionCompletedCallbackWithErrorCode() {
|
| + return base::Bind(&ViewManagerTransaction::OnActionCompletedWithErrorCode,
|
| + base::Unretained(this));
|
| + }
|
| +
|
| private:
|
| // General callback to be used for commits to the service.
|
| void OnActionCompleted(bool success) {
|
| @@ -149,6 +156,11 @@ class ViewManagerTransaction {
|
| client_->RemoveFromPendingQueue(this);
|
| }
|
|
|
| + void OnActionCompletedWithErrorCode(ErrorCode error_code) {
|
| + DoActionCompleted(error_code == ERROR_CODE_NONE);
|
| + client_->RemoveFromPendingQueue(this);
|
| + }
|
| +
|
| bool committed_;
|
| ViewManagerClientImpl* client_;
|
|
|
| @@ -209,7 +221,7 @@ class CreateNodeTransaction : public ViewManagerTransaction {
|
| private:
|
| // Overridden from ViewManagerTransaction:
|
| virtual void DoCommit() OVERRIDE {
|
| - service()->CreateNode(node_id_, ActionCompletedCallback());
|
| + service()->CreateNode(node_id_, ActionCompletedCallbackWithErrorCode());
|
| }
|
| virtual void DoActionCompleted(bool success) OVERRIDE {
|
| // TODO(beng): Failure means we tried to create with an extant id for this
|
|
|