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

Side by Side Diff: mojo/edk/system/ports/node.cc

Issue 2522743002: Mojo EDK: Work around Nexus 9 hardware bug (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « mojo/edk/system/message_pipe_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/edk/system/ports/node.h" 5 #include "mojo/edk/system/ports/node.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/atomicops.h"
11 #include "base/logging.h" 12 #include "base/logging.h"
12 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
13 #include "base/synchronization/lock.h" 14 #include "base/synchronization/lock.h"
14 #include "mojo/edk/system/ports/node_delegate.h" 15 #include "mojo/edk/system/ports/node_delegate.h"
15 16
16 namespace mojo { 17 namespace mojo {
17 namespace edk { 18 namespace edk {
18 namespace ports { 19 namespace ports {
19 20
20 namespace { 21 namespace {
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 base::AutoLock lock(ports_lock_); 802 base::AutoLock lock(ports_lock_);
802 return GetPort_Locked(port_name); 803 return GetPort_Locked(port_name);
803 } 804 }
804 805
805 scoped_refptr<Port> Node::GetPort_Locked(const PortName& port_name) { 806 scoped_refptr<Port> Node::GetPort_Locked(const PortName& port_name) {
806 ports_lock_.AssertAcquired(); 807 ports_lock_.AssertAcquired();
807 auto iter = ports_.find(port_name); 808 auto iter = ports_.find(port_name);
808 if (iter == ports_.end()) 809 if (iter == ports_.end())
809 return nullptr; 810 return nullptr;
810 811
812 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARM64)
813 // Workaround for https://crbug.com/665869.
814 base::subtle::MemoryBarrier();
815 #endif
816
811 return iter->second; 817 return iter->second;
812 } 818 }
813 819
814 int Node::SendMessageInternal(const PortRef& port_ref, ScopedMessage* message) { 820 int Node::SendMessageInternal(const PortRef& port_ref, ScopedMessage* message) {
815 ScopedMessage& m = *message; 821 ScopedMessage& m = *message;
816 for (size_t i = 0; i < m->num_ports(); ++i) { 822 for (size_t i = 0; i < m->num_ports(); ++i) {
817 if (m->ports()[i] == port_ref.name()) 823 if (m->ports()[i] == port_ref.name())
818 return ERROR_PORT_CANNOT_SEND_SELF; 824 return ERROR_PORT_CANNOT_SEND_SELF;
819 } 825 }
820 826
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
1376 1382
1377 if (num_data_bytes) 1383 if (num_data_bytes)
1378 memcpy(header + 1, data, num_data_bytes); 1384 memcpy(header + 1, data, num_data_bytes);
1379 1385
1380 return message; 1386 return message;
1381 } 1387 }
1382 1388
1383 } // namespace ports 1389 } // namespace ports
1384 } // namespace edk 1390 } // namespace edk
1385 } // namespace mojo 1391 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/message_pipe_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698