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

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

Issue 2151153002: Use ChannelMojo for NaCl IRT channels in non-sfi mode. Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-nacl-channel-mojo
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
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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 DCHECK(content::RenderThread::Get()); 187 DCHECK(content::RenderThread::Get());
188 content::RendererPpapiHost* host = 188 content::RendererPpapiHost* host =
189 content::RendererPpapiHost::GetForPPInstance(instance); 189 content::RendererPpapiHost::GetForPPInstance(instance);
190 if (!host) 190 if (!host)
191 return 0; 191 return 0;
192 return host->GetRoutingIDForWidget(instance); 192 return host->GetRoutingIDForWidget(instance);
193 } 193 }
194 194
195 // Returns whether the channel_handle is valid or not. 195 // Returns whether the channel_handle is valid or not.
196 bool IsValidChannelHandle(const IPC::ChannelHandle& channel_handle) { 196 bool IsValidChannelHandle(const IPC::ChannelHandle& channel_handle) {
197 if (channel_handle.name.empty()) { 197 DCHECK(channel_handle.mojo_handle.is_valid());
198 return false; 198 return channel_handle.mojo_handle.is_valid();
199 }
200
201 #if defined(OS_POSIX)
202 if (channel_handle.socket.fd == -1) {
203 return false;
204 }
205 #endif
206
207 return true;
208 } 199 }
209 200
210 void PostPPCompletionCallback(PP_CompletionCallback callback, 201 void PostPPCompletionCallback(PP_CompletionCallback callback,
211 int32_t status) { 202 int32_t status) {
212 ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( 203 ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask(
213 FROM_HERE, 204 FROM_HERE,
214 base::Bind(callback.func, callback.user_data, status)); 205 base::Bind(callback.func, callback.user_data, status));
215 } 206 }
216 207
217 bool ManifestResolveKey(PP_Instance instance, 208 bool ManifestResolveKey(PP_Instance instance,
(...skipping 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1744 // Mark the request as requesting a PNaCl bitcode file, 1735 // Mark the request as requesting a PNaCl bitcode file,
1745 // so that component updater can detect this user action. 1736 // so that component updater can detect this user action.
1746 url_request.addHTTPHeaderField( 1737 url_request.addHTTPHeaderField(
1747 blink::WebString::fromUTF8("Accept"), 1738 blink::WebString::fromUTF8("Accept"),
1748 blink::WebString::fromUTF8("application/x-pnacl, */*")); 1739 blink::WebString::fromUTF8("application/x-pnacl, */*"));
1749 url_request.setRequestContext(blink::WebURLRequest::RequestContextObject); 1740 url_request.setRequestContext(blink::WebURLRequest::RequestContextObject);
1750 downloader->Load(url_request); 1741 downloader->Load(url_request);
1751 } 1742 }
1752 1743
1753 } // namespace nacl 1744 } // namespace nacl
OLDNEW
« no previous file with comments | « components/nacl/loader/nonsfi/nonsfi_listener.cc ('k') | content/renderer/pepper/host_dispatcher_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698