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

Side by Side Diff: mojo/services/view_manager/view_manager_connection.cc

Issue 296133012: Some security checks around destruction/setting bounds. (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/services/view_manager/view_manager_connection.h" 5 #include "mojo/services/view_manager/view_manager_connection.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "mojo/geometry/geometry_type_converters.h" 8 #include "mojo/geometry/geometry_type_converters.h"
9 #include "mojo/public/cpp/bindings/allocation_scope.h" 9 #include "mojo/public/cpp/bindings/allocation_scope.h"
10 #include "mojo/services/view_manager/node.h" 10 #include "mojo/services/view_manager/node.h"
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 const Node* parent = node->GetParent(); 442 const Node* parent = node->GetParent();
443 // If the parent isn't known, it means the parent is not visible to us (not 443 // If the parent isn't known, it means the parent is not visible to us (not
444 // in roots), and should not be sent over. 444 // in roots), and should not be sent over.
445 if (parent && known_nodes_.count(NodeIdToTransportId(parent->id())) == 0) 445 if (parent && known_nodes_.count(NodeIdToTransportId(parent->id())) == 0)
446 parent = NULL; 446 parent = NULL;
447 node_builder.set_parent_id(NodeIdToTransportId( 447 node_builder.set_parent_id(NodeIdToTransportId(
448 parent ? parent->id() : NodeId())); 448 parent ? parent->id() : NodeId()));
449 node_builder.set_node_id(NodeIdToTransportId(node->id())); 449 node_builder.set_node_id(NodeIdToTransportId(node->id()));
450 node_builder.set_view_id(ViewIdToTransportId( 450 node_builder.set_view_id(ViewIdToTransportId(
451 node->view() ? node->view()->id() : ViewId())); 451 node->view() ? node->view()->id() : ViewId()));
452 node_builder.set_bounds(node->bounds());
452 array_builder[i] = node_builder.Finish(); 453 array_builder[i] = node_builder.Finish();
453 } 454 }
454 return array_builder.Finish(); 455 return array_builder.Finish();
455 } 456 }
456 457
457 void ViewManagerConnection::CreateNode( 458 void ViewManagerConnection::CreateNode(
458 TransportNodeId transport_node_id, 459 TransportNodeId transport_node_id,
459 const Callback<void(bool)>& callback) { 460 const Callback<void(bool)>& callback) {
460 const NodeId node_id(NodeIdFromTransportId(transport_node_id)); 461 const NodeId node_id(NodeIdFromTransportId(transport_node_id));
461 if (node_id.connection_id != id_ || 462 if (node_id.connection_id != id_ ||
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 630
630 void ViewManagerConnection::OnNodeViewReplaced(const Node* node, 631 void ViewManagerConnection::OnNodeViewReplaced(const Node* node,
631 const View* new_view, 632 const View* new_view,
632 const View* old_view) { 633 const View* old_view) {
633 root_node_manager_->ProcessNodeViewReplaced(node, new_view, old_view); 634 root_node_manager_->ProcessNodeViewReplaced(node, new_view, old_view);
634 } 635 }
635 636
636 } // namespace service 637 } // namespace service
637 } // namespace view_manager 638 } // namespace view_manager
638 } // namespace mojo 639 } // namespace mojo
OLDNEW
« mojo/services/view_manager/node.h ('K') | « mojo/services/view_manager/node.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698