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

Unified Diff: mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc

Issue 383293002: Start of adding enums for error codes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/services/public/interfaces/view_manager/view_manager.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | mojo/services/public/interfaces/view_manager/view_manager.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698