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

Side by Side Diff: ppapi/nacl_irt/manifest_service.cc

Issue 1097393007: Update {virtual,override} to follow C++11 style in ppapi. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split off one file into separate review. Created 5 years, 8 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
« no previous file with comments | « ppapi/host/resource_message_filter_unittest.cc ('k') | ppapi/nacl_irt/ppapi_dispatcher.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 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 "base/message_loop/message_loop_proxy.h" 7 #include "base/message_loop/message_loop_proxy.h"
8 #include "ipc/ipc_channel_handle.h" 8 #include "ipc/ipc_channel_handle.h"
9 #include "ipc/ipc_channel_proxy.h" 9 #include "ipc/ipc_channel_proxy.h"
10 #include "ipc/ipc_sync_message_filter.h" 10 #include "ipc/ipc_sync_message_filter.h"
(...skipping 15 matching lines...) Expand all
26 // established. In such a case, it is necessary to wait for the set up 26 // established. In such a case, it is necessary to wait for the set up
27 // completion. 27 // completion.
28 class ManifestMessageFilter : public IPC::SyncMessageFilter { 28 class ManifestMessageFilter : public IPC::SyncMessageFilter {
29 public: 29 public:
30 ManifestMessageFilter(base::WaitableEvent* shutdown_event) 30 ManifestMessageFilter(base::WaitableEvent* shutdown_event)
31 : SyncMessageFilter(shutdown_event), 31 : SyncMessageFilter(shutdown_event),
32 connected_event_( 32 connected_event_(
33 true /* manual_reset */, false /* initially_signaled */) { 33 true /* manual_reset */, false /* initially_signaled */) {
34 } 34 }
35 35
36 virtual bool Send(IPC::Message* message) override { 36 bool Send(IPC::Message* message) override {
37 // Wait until set up is actually done. 37 // Wait until set up is actually done.
38 connected_event_.Wait(); 38 connected_event_.Wait();
39 return SyncMessageFilter::Send(message); 39 return SyncMessageFilter::Send(message);
40 } 40 }
41 41
42 // When set up is done, OnFilterAdded is called on IO thread. Unblocks the 42 // When set up is done, OnFilterAdded is called on IO thread. Unblocks the
43 // Send(). 43 // Send().
44 virtual void OnFilterAdded(IPC::Sender* sender) override { 44 void OnFilterAdded(IPC::Sender* sender) override {
45 SyncMessageFilter::OnFilterAdded(sender); 45 SyncMessageFilter::OnFilterAdded(sender);
46 connected_event_.Signal(); 46 connected_event_.Signal();
47 } 47 }
48 48
49 // If an error is found, unblocks the Send(), too, to return an error. 49 // If an error is found, unblocks the Send(), too, to return an error.
50 virtual void OnChannelError() override { 50 void OnChannelError() override {
51 SyncMessageFilter::OnChannelError(); 51 SyncMessageFilter::OnChannelError();
52 connected_event_.Signal(); 52 connected_event_.Signal();
53 } 53 }
54 54
55 // Similar to OnChannelError, unblocks the Send() on the channel closing. 55 // Similar to OnChannelError, unblocks the Send() on the channel closing.
56 virtual void OnChannelClosing() override { 56 void OnChannelClosing() override {
57 SyncMessageFilter::OnChannelClosing(); 57 SyncMessageFilter::OnChannelClosing();
58 connected_event_.Signal(); 58 connected_event_.Signal();
59 } 59 }
60 60
61 private: 61 private:
62 base::WaitableEvent connected_event_; 62 base::WaitableEvent connected_event_;
63 63
64 DISALLOW_COPY_AND_ASSIGN(ManifestMessageFilter); 64 DISALLOW_COPY_AND_ASSIGN(ManifestMessageFilter);
65 }; 65 };
66 66
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 163
164 ManifestService* manifest_service = GetManifestService(); 164 ManifestService* manifest_service = GetManifestService();
165 if (manifest_service == NULL || 165 if (manifest_service == NULL ||
166 !manifest_service->OpenResource(file, fd)) { 166 !manifest_service->OpenResource(file, fd)) {
167 return NACL_ABI_EIO; 167 return NACL_ABI_EIO;
168 } 168 }
169 return (*fd == -1) ? NACL_ABI_ENOENT : 0; 169 return (*fd == -1) ? NACL_ABI_ENOENT : 0;
170 } 170 }
171 171
172 } // namespace ppapi 172 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/host/resource_message_filter_unittest.cc ('k') | ppapi/nacl_irt/ppapi_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698