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

Side by Side Diff: chrome/nacl/nacl_thread.cc

Issue 5978003: Make IPC::Channel::Listener:OnMessageReceived have a return value indicating ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 12 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
« no previous file with comments | « chrome/nacl/nacl_thread.h ('k') | chrome/plugin/command_buffer_stub.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/nacl/nacl_thread.h" 5 #include "chrome/nacl/nacl_thread.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/atomicops.h" 9 #include "base/atomicops.h"
10 #include "base/scoped_ptr.h" 10 #include "base/scoped_ptr.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 debug_enabled_ = debug ? 1 : 0; 69 debug_enabled_ = debug ? 1 : 0;
70 } 70 }
71 71
72 NaClThread::~NaClThread() { 72 NaClThread::~NaClThread() {
73 } 73 }
74 74
75 NaClThread* NaClThread::current() { 75 NaClThread* NaClThread::current() {
76 return static_cast<NaClThread*>(ChildThread::current()); 76 return static_cast<NaClThread*>(ChildThread::current());
77 } 77 }
78 78
79 void NaClThread::OnControlMessageReceived(const IPC::Message& msg) { 79 bool NaClThread::OnControlMessageReceived(const IPC::Message& msg) {
80 bool handled = true;
80 IPC_BEGIN_MESSAGE_MAP(NaClThread, msg) 81 IPC_BEGIN_MESSAGE_MAP(NaClThread, msg)
81 IPC_MESSAGE_HANDLER(NaClProcessMsg_Start, OnStartSelLdr) 82 IPC_MESSAGE_HANDLER(NaClProcessMsg_Start, OnStartSelLdr)
83 IPC_MESSAGE_UNHANDLED(handled = false)
82 IPC_END_MESSAGE_MAP() 84 IPC_END_MESSAGE_MAP()
85 return handled;
83 } 86 }
84 87
85 void NaClThread::OnStartSelLdr(std::vector<nacl::FileDescriptor> handles) { 88 void NaClThread::OnStartSelLdr(std::vector<nacl::FileDescriptor> handles) {
86 #if defined(OS_LINUX) 89 #if defined(OS_LINUX)
87 nacl::SetCreateMemoryObjectFunc( 90 nacl::SetCreateMemoryObjectFunc(
88 renderer_sandbox_support::MakeSharedMemorySegmentViaIPC); 91 renderer_sandbox_support::MakeSharedMemorySegmentViaIPC);
89 #elif defined(OS_MACOSX) 92 #elif defined(OS_MACOSX)
90 nacl::SetCreateMemoryObjectFunc(CreateMemoryObject); 93 nacl::SetCreateMemoryObjectFunc(CreateMemoryObject);
91 CHECK(handles.size() >= 1); 94 CHECK(handles.size() >= 1);
92 g_shm_fd = nacl::ToNativeHandle(handles[handles.size() - 1]); 95 g_shm_fd = nacl::ToNativeHandle(handles[handles.size() - 1]);
93 handles.pop_back(); 96 handles.pop_back();
94 #endif 97 #endif
95 scoped_array<NaClHandle> array(new NaClHandle[handles.size()]); 98 scoped_array<NaClHandle> array(new NaClHandle[handles.size()]);
96 for (size_t i = 0; i < handles.size(); i++) { 99 for (size_t i = 0; i < handles.size(); i++) {
97 array[i] = nacl::ToNativeHandle(handles[i]); 100 array[i] = nacl::ToNativeHandle(handles[i]);
98 } 101 }
99 NaClMainForChromium(static_cast<int>(handles.size()), array.get(), 102 NaClMainForChromium(static_cast<int>(handles.size()), array.get(),
100 debug_enabled_); 103 debug_enabled_);
101 } 104 }
OLDNEW
« no previous file with comments | « chrome/nacl/nacl_thread.h ('k') | chrome/plugin/command_buffer_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698