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

Side by Side Diff: components/nacl/renderer/ppb_nacl_private_impl.cc

Issue 2168523002: Use ChannelMojo for plugin-renderer channels. Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-nacl-ipc-fds
Patch Set: rebase Created 4 years, 5 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 | « no previous file | content/ppapi_plugin/ppapi_thread.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 #include "components/nacl/renderer/ppb_nacl_private.h" 5 #include "components/nacl/renderer/ppb_nacl_private.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 IPC::ChannelHandle channel_handle; 125 IPC::ChannelHandle channel_handle;
126 }; 126 };
127 127
128 class NaClPluginInstance { 128 class NaClPluginInstance {
129 public: 129 public:
130 explicit NaClPluginInstance(PP_Instance instance) 130 explicit NaClPluginInstance(PP_Instance instance)
131 : nexe_load_manager(instance), pexe_size(0) {} 131 : nexe_load_manager(instance), pexe_size(0) {}
132 ~NaClPluginInstance() { 132 ~NaClPluginInstance() {
133 // Make sure that we do not leak a file descriptor if the NaCl loader 133 // Make sure that we do not leak a file descriptor if the NaCl loader
134 // process never called ppapi_start() to initialize PPAPI. 134 // process never called ppapi_start() to initialize PPAPI.
135 if (instance_info) { 135 if (instance_info)
136 #if defined(OS_WIN) 136 instance_info->channel_handle.mojo_handle.Close();
137 base::win::ScopedHandle closer(instance_info->channel_handle.pipe.handle);
138 #else
139 base::ScopedFD closer(instance_info->channel_handle.socket.fd);
140 #endif
141 }
142 } 137 }
143 138
144 NexeLoadManager nexe_load_manager; 139 NexeLoadManager nexe_load_manager;
145 std::unique_ptr<JsonManifest> json_manifest; 140 std::unique_ptr<JsonManifest> json_manifest;
146 std::unique_ptr<InstanceInfo> instance_info; 141 std::unique_ptr<InstanceInfo> instance_info;
147 142
148 // When translation is complete, this records the size of the pexe in 143 // When translation is complete, this records the size of the pexe in
149 // bytes so that it can be reported in a later load event. 144 // bytes so that it can be reported in a later load event.
150 uint64_t pexe_size; 145 uint64_t pexe_size;
151 }; 146 };
(...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after
1735 // Mark the request as requesting a PNaCl bitcode file, 1730 // Mark the request as requesting a PNaCl bitcode file,
1736 // so that component updater can detect this user action. 1731 // so that component updater can detect this user action.
1737 url_request.addHTTPHeaderField( 1732 url_request.addHTTPHeaderField(
1738 blink::WebString::fromUTF8("Accept"), 1733 blink::WebString::fromUTF8("Accept"),
1739 blink::WebString::fromUTF8("application/x-pnacl, */*")); 1734 blink::WebString::fromUTF8("application/x-pnacl, */*"));
1740 url_request.setRequestContext(blink::WebURLRequest::RequestContextObject); 1735 url_request.setRequestContext(blink::WebURLRequest::RequestContextObject);
1741 downloader->Load(url_request); 1736 downloader->Load(url_request);
1742 } 1737 }
1743 1738
1744 } // namespace nacl 1739 } // namespace nacl
OLDNEW
« no previous file with comments | « no previous file | content/ppapi_plugin/ppapi_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698