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

Unified Diff: mojo/services/view_manager/view_manager_connection.cc

Issue 292813008: Implement SetViewContents in the client lib (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « mojo/services/view_manager/view_manager_connection.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/view_manager/view_manager_connection.cc
diff --git a/mojo/services/view_manager/view_manager_connection.cc b/mojo/services/view_manager/view_manager_connection.cc
index e8ce02c280dad7589340e7bed68235a1817c381b..76656b644c15e66e5f836a58149c9ba8b921c3ba 100644
--- a/mojo/services/view_manager/view_manager_connection.cc
+++ b/mojo/services/view_manager/view_manager_connection.cc
@@ -571,13 +571,17 @@ void ViewManagerConnection::SetView(
void ViewManagerConnection::SetViewContents(
TransportViewId view_id,
ScopedSharedBufferHandle buffer,
- uint32_t buffer_size) {
+ uint32_t buffer_size,
+ const Callback<void(bool)>& callback) {
View* view = GetView(ViewIdFromTransportId(view_id));
- if (!view)
+ if (!view) {
+ callback.Run(false);
return;
+ }
void* handle_data;
if (MapBuffer(buffer.get(), 0, buffer_size, &handle_data,
MOJO_MAP_BUFFER_FLAG_NONE) != MOJO_RESULT_OK) {
+ callback.Run(false);
return;
}
SkBitmap bitmap;
@@ -585,6 +589,7 @@ void ViewManagerConnection::SetViewContents(
buffer_size, &bitmap);
view->SetBitmap(bitmap);
UnmapBuffer(handle_data);
+ callback.Run(true);
}
void ViewManagerConnection::SetRoots(
« no previous file with comments | « mojo/services/view_manager/view_manager_connection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698