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

Side by Side Diff: components/nacl/loader/nacl_listener.h

Issue 728113002: obsolete: SFI NaCl: Batch-open resource files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 6 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 | « components/nacl/loader/nacl_ipc_adapter.cc ('k') | components/nacl/loader/nacl_listener.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CHROME_NACL_NACL_LISTENER_H_ 5 #ifndef CHROME_NACL_NACL_LISTENER_H_
6 #define CHROME_NACL_NACL_LISTENER_H_ 6 #define CHROME_NACL_NACL_LISTENER_H_
7 7
8 #include <map>
8 #include <vector> 9 #include <vector>
9 10
10 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/shared_memory.h" 12 #include "base/memory/shared_memory.h"
12 #include "base/synchronization/waitable_event.h" 13 #include "base/synchronization/waitable_event.h"
13 #include "base/threading/thread.h" 14 #include "base/threading/thread.h"
14 #include "components/nacl/common/nacl_types.h" 15 #include "components/nacl/common/nacl_types.h"
15 #include "components/nacl/loader/nacl_trusted_listener.h" 16 #include "components/nacl/loader/nacl_trusted_listener.h"
16 #include "ipc/ipc_listener.h" 17 #include "ipc/ipc_listener.h"
17 18
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 uint64_t token_hi, 55 uint64_t token_hi,
55 ResolveFileTokenCallback cb); 56 ResolveFileTokenCallback cb);
56 void OnFileTokenResolved(uint64_t token_lo, 57 void OnFileTokenResolved(uint64_t token_lo,
57 uint64_t token_hi, 58 uint64_t token_hi,
58 IPC::PlatformFileForTransit ipc_fd, 59 IPC::PlatformFileForTransit ipc_fd,
59 base::FilePath file_path); 60 base::FilePath file_path);
60 61
61 private: 62 private:
62 bool OnMessageReceived(const IPC::Message& msg) override; 63 bool OnMessageReceived(const IPC::Message& msg) override;
63 64
65 typedef base::Callback<void(const IPC::Message&,
66 IPC::PlatformFileForTransit,
67 base::FilePath)> OpenResourceReplyCallback;
68
69 bool OnOpenResource(const IPC::Message& msg,
70 const std::string& key,
71 OpenResourceReplyCallback cb);
72
64 void OnStart(const nacl::NaClStartParams& params); 73 void OnStart(const nacl::NaClStartParams& params);
65 74
66 // A channel back to the browser. 75 // A channel back to the browser.
67 scoped_ptr<IPC::SyncChannel> channel_; 76 scoped_ptr<IPC::SyncChannel> channel_;
68 77
69 // A filter that allows other threads to use the channel. 78 // A filter that allows other threads to use the channel.
70 scoped_refptr<IPC::SyncMessageFilter> filter_; 79 scoped_refptr<IPC::SyncMessageFilter> filter_;
71 80
72 base::WaitableEvent shutdown_event_; 81 base::WaitableEvent shutdown_event_;
73 base::Thread io_thread_; 82 base::Thread io_thread_;
(...skipping 12 matching lines...) Expand all
86 95
87 scoped_ptr<base::SharedMemory> crash_info_shmem_; 96 scoped_ptr<base::SharedMemory> crash_info_shmem_;
88 97
89 scoped_refptr<NaClTrustedListener> trusted_listener_; 98 scoped_refptr<NaClTrustedListener> trusted_listener_;
90 99
91 ResolveFileTokenCallback resolved_cb_; 100 ResolveFileTokenCallback resolved_cb_;
92 101
93 // Used to identify what thread we're on. 102 // Used to identify what thread we're on.
94 base::MessageLoop* main_loop_; 103 base::MessageLoop* main_loop_;
95 104
105 // Pre-opened resource descriptors.
106 std::map<
107 std::string, // key
108 std::pair<IPC::PlatformFileForTransit, base::FilePath> > resource_files_;
109
96 DISALLOW_COPY_AND_ASSIGN(NaClListener); 110 DISALLOW_COPY_AND_ASSIGN(NaClListener);
97 }; 111 };
98 112
99 #endif // CHROME_NACL_NACL_LISTENER_H_ 113 #endif // CHROME_NACL_NACL_LISTENER_H_
OLDNEW
« no previous file with comments | « components/nacl/loader/nacl_ipc_adapter.cc ('k') | components/nacl/loader/nacl_listener.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698