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

Side by Side Diff: components/nacl/renderer/manifest_service_channel.h

Issue 418423002: Pepper: Stop using SRPC for irt_open_resource(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 3 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
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 #ifndef COMPONENTS_NACL_RENDERER_MANIFEST_SERVICE_CHANNEL_H_ 5 #ifndef COMPONENTS_NACL_RENDERER_MANIFEST_SERVICE_CHANNEL_H_
6 #define COMPONENTS_NACL_RENDERER_MANIFEST_SERVICE_CHANNEL_H_ 6 #define COMPONENTS_NACL_RENDERER_MANIFEST_SERVICE_CHANNEL_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/files/file.h" 9 #include "base/files/file.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 10 matching lines...) Expand all
21 namespace IPC { 21 namespace IPC {
22 struct ChannelHandle; 22 struct ChannelHandle;
23 class Message; 23 class Message;
24 class SyncChannel; 24 class SyncChannel;
25 } // namespace IPC 25 } // namespace IPC
26 26
27 namespace nacl { 27 namespace nacl {
28 28
29 class ManifestServiceChannel : public IPC::Listener { 29 class ManifestServiceChannel : public IPC::Listener {
30 public: 30 public:
31 typedef base::Callback<void(base::File)> OpenResourceCallback; 31 typedef base::Callback<void(base::File, uint64_t, uint64_t)>
32 OpenResourceCallback;
32 33
33 class Delegate { 34 class Delegate {
34 public: 35 public:
35 virtual ~Delegate() {} 36 virtual ~Delegate() {}
36 37
37 // Called when PPAPI initialization in the NaCl plugin is finished. 38 // Called when PPAPI initialization in the NaCl plugin is finished.
38 virtual void StartupInitializationComplete() = 0; 39 virtual void StartupInitializationComplete() = 0;
39 40
40 // Called when irt_open_resource() is invoked in the NaCl plugin. 41 // Called when irt_open_resource() is invoked in the NaCl plugin.
41 // Upon completion, callback is invoked with the file. 42 // Upon completion, callback is invoked with the file.
(...skipping 12 matching lines...) Expand all
54 void Send(IPC::Message* message); 55 void Send(IPC::Message* message);
55 56
56 // Listener implementation. 57 // Listener implementation.
57 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 58 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
58 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; 59 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
59 virtual void OnChannelError() OVERRIDE; 60 virtual void OnChannelError() OVERRIDE;
60 61
61 private: 62 private:
62 void OnStartupInitializationComplete(); 63 void OnStartupInitializationComplete();
63 void OnOpenResource(const std::string& key, IPC::Message* reply); 64 void OnOpenResource(const std::string& key, IPC::Message* reply);
64 #if !defined(OS_WIN) 65 void DidOpenResource(IPC::Message* reply,
65 void DidOpenResource(IPC::Message* reply, base::File file); 66 base::File file,
66 #endif 67 uint64_t token_lo,
67 68 uint64_t token_hi);
68 base::Callback<void(int32_t)> connected_callback_; 69 base::Callback<void(int32_t)> connected_callback_;
69 scoped_ptr<Delegate> delegate_; 70 scoped_ptr<Delegate> delegate_;
70 scoped_ptr<IPC::SyncChannel> channel_; 71 scoped_ptr<IPC::SyncChannel> channel_;
71 72
73 base::ProcessId peer_pid_;
74
72 // Note: This should remain the last member so it'll be destroyed and 75 // Note: This should remain the last member so it'll be destroyed and
73 // invalidate the weak pointers before any other members are destroyed. 76 // invalidate the weak pointers before any other members are destroyed.
74 base::WeakPtrFactory<ManifestServiceChannel> weak_ptr_factory_; 77 base::WeakPtrFactory<ManifestServiceChannel> weak_ptr_factory_;
75 78
76 DISALLOW_COPY_AND_ASSIGN(ManifestServiceChannel); 79 DISALLOW_COPY_AND_ASSIGN(ManifestServiceChannel);
77 }; 80 };
78 81
79 } // namespace nacl 82 } // namespace nacl
80 83
81 #endif // COMPONENTS_NACL_RENDERER_MANIFEST_SERVICE_CHANNEL_H_ 84 #endif // COMPONENTS_NACL_RENDERER_MANIFEST_SERVICE_CHANNEL_H_
OLDNEW
« no previous file with comments | « components/nacl/loader/nacl_listener.cc ('k') | components/nacl/renderer/manifest_service_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698