| OLD | NEW |
| 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 "ppapi/nacl_irt/manifest_service.h" | 5 #include "ppapi/nacl_irt/manifest_service.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 base::WaitableEvent::InitialState::NOT_SIGNALED) {} | 37 base::WaitableEvent::InitialState::NOT_SIGNALED) {} |
| 38 | 38 |
| 39 bool Send(IPC::Message* message) override { | 39 bool Send(IPC::Message* message) override { |
| 40 // Wait until set up is actually done. | 40 // Wait until set up is actually done. |
| 41 connected_event_.Wait(); | 41 connected_event_.Wait(); |
| 42 return SyncMessageFilter::Send(message); | 42 return SyncMessageFilter::Send(message); |
| 43 } | 43 } |
| 44 | 44 |
| 45 // When set up is done, OnFilterAdded is called on IO thread. Unblocks the | 45 // When set up is done, OnFilterAdded is called on IO thread. Unblocks the |
| 46 // Send(). | 46 // Send(). |
| 47 void OnFilterAdded(IPC::Sender* sender) override { | 47 void OnFilterAdded(IPC::Channel* channel) override { |
| 48 SyncMessageFilter::OnFilterAdded(sender); | 48 SyncMessageFilter::OnFilterAdded(channel); |
| 49 connected_event_.Signal(); | 49 connected_event_.Signal(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 // If an error is found, unblocks the Send(), too, to return an error. | 52 // If an error is found, unblocks the Send(), too, to return an error. |
| 53 void OnChannelError() override { | 53 void OnChannelError() override { |
| 54 SyncMessageFilter::OnChannelError(); | 54 SyncMessageFilter::OnChannelError(); |
| 55 connected_event_.Signal(); | 55 connected_event_.Signal(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 // Similar to OnChannelError, unblocks the Send() on the channel closing. | 58 // Similar to OnChannelError, unblocks the Send() on the channel closing. |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 162 |
| 163 ManifestService* manifest_service = GetManifestService(); | 163 ManifestService* manifest_service = GetManifestService(); |
| 164 if (manifest_service == NULL || | 164 if (manifest_service == NULL || |
| 165 !manifest_service->OpenResource(file, fd)) { | 165 !manifest_service->OpenResource(file, fd)) { |
| 166 return NACL_ABI_EIO; | 166 return NACL_ABI_EIO; |
| 167 } | 167 } |
| 168 return (*fd == -1) ? NACL_ABI_ENOENT : 0; | 168 return (*fd == -1) ? NACL_ABI_ENOENT : 0; |
| 169 } | 169 } |
| 170 | 170 |
| 171 } // namespace ppapi | 171 } // namespace ppapi |
| OLD | NEW |