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

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

Issue 2038423004: Use ChannelMojo for Browser-GPU and Renderer-GPU IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-utility-channel-mojo
Patch Set: fix pepper Created 4 years, 6 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/browser/gpu/browser_gpu_channel_host_factory.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 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 return channel_handle.mojo_handle.is_valid();
198 return false;
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 } 198 }
209 199
210 void PostPPCompletionCallback(PP_CompletionCallback callback, 200 void PostPPCompletionCallback(PP_CompletionCallback callback,
211 int32_t status) { 201 int32_t status) {
212 ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( 202 ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask(
213 FROM_HERE, 203 FROM_HERE,
214 base::Bind(callback.func, callback.user_data, status)); 204 base::Bind(callback.func, callback.user_data, status));
215 } 205 }
216 206
217 bool ManifestResolveKey(PP_Instance instance, 207 bool ManifestResolveKey(PP_Instance instance,
(...skipping 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after
1746 // Mark the request as requesting a PNaCl bitcode file, 1736 // Mark the request as requesting a PNaCl bitcode file,
1747 // so that component updater can detect this user action. 1737 // so that component updater can detect this user action.
1748 url_request.addHTTPHeaderField( 1738 url_request.addHTTPHeaderField(
1749 blink::WebString::fromUTF8("Accept"), 1739 blink::WebString::fromUTF8("Accept"),
1750 blink::WebString::fromUTF8("application/x-pnacl, */*")); 1740 blink::WebString::fromUTF8("application/x-pnacl, */*"));
1751 url_request.setRequestContext(blink::WebURLRequest::RequestContextObject); 1741 url_request.setRequestContext(blink::WebURLRequest::RequestContextObject);
1752 downloader->Load(url_request); 1742 downloader->Load(url_request);
1753 } 1743 }
1754 1744
1755 } // namespace nacl 1745 } // namespace nacl
OLDNEW
« no previous file with comments | « no previous file | content/browser/gpu/browser_gpu_channel_host_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698