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

Side by Side Diff: chrome/renderer/renderer_glue.cc

Issue 5933004: Add a webkit_glue API for lanching NaCl's sel_ldr. NaCl will call this API v... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // This file provides the embedder's side of random webkit glue functions. 5 // This file provides the embedder's side of random webkit glue functions.
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include <windows.h> 10 #include <windows.h>
(...skipping 10 matching lines...) Expand all
21 #include "chrome/common/chrome_switches.h" 21 #include "chrome/common/chrome_switches.h"
22 #include "chrome/common/chrome_version_info.h" 22 #include "chrome/common/chrome_version_info.h"
23 #include "chrome/common/render_messages.h" 23 #include "chrome/common/render_messages.h"
24 #include "chrome/common/socket_stream_dispatcher.h" 24 #include "chrome/common/socket_stream_dispatcher.h"
25 #include "chrome/common/url_constants.h" 25 #include "chrome/common/url_constants.h"
26 #include "chrome/plugin/npobject_util.h" 26 #include "chrome/plugin/npobject_util.h"
27 #include "chrome/renderer/net/renderer_net_predictor.h" 27 #include "chrome/renderer/net/renderer_net_predictor.h"
28 #include "chrome/renderer/render_process.h" 28 #include "chrome/renderer/render_process.h"
29 #include "chrome/renderer/render_thread.h" 29 #include "chrome/renderer/render_thread.h"
30 #include "googleurl/src/url_util.h" 30 #include "googleurl/src/url_util.h"
31 #include "native_client/src/shared/imc/nacl_imc.h"
noelallen_use_chromium 2010/12/17 19:52:22 #ifdef this as well? So that someone could compil
32 #include "native_client/src/trusted/plugin/nacl_entry_points.h"
31 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" 33 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h"
32 #include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h" 34 #include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h"
33 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" 35 #include "third_party/WebKit/WebKit/chromium/public/WebString.h"
34 #include "third_party/skia/include/core/SkBitmap.h" 36 #include "third_party/skia/include/core/SkBitmap.h"
35 #include "webkit/glue/scoped_clipboard_writer_glue.h" 37 #include "webkit/glue/scoped_clipboard_writer_glue.h"
36 #include "webkit/glue/webkit_glue.h" 38 #include "webkit/glue/webkit_glue.h"
37 #include "webkit/glue/websocketstreamhandle_bridge.h" 39 #include "webkit/glue/websocketstreamhandle_bridge.h"
38 40
39 #if defined(OS_WIN) 41 #if defined(OS_WIN)
40 #include <strsafe.h> // note: per msdn docs, this must *follow* other includes 42 #include <strsafe.h> // note: per msdn docs, this must *follow* other includes
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 269
268 void EnableSpdy(bool enable) { 270 void EnableSpdy(bool enable) {
269 RenderThread::current()->EnableSpdy(enable); 271 RenderThread::current()->EnableSpdy(enable);
270 } 272 }
271 273
272 void UserMetricsRecordAction(const std::string& action) { 274 void UserMetricsRecordAction(const std::string& action) {
273 RenderThread::current()->Send( 275 RenderThread::current()->Send(
274 new ViewHostMsg_UserMetricsRecordAction(action)); 276 new ViewHostMsg_UserMetricsRecordAction(action));
275 } 277 }
276 278
279 #if !defined(DISABLE_NACL)
280 bool LaunchSelLdr(const char* alleged_url, int socket_count, void* imc_handles,
281 void* nacl_process_handle, int* nacl_process_id) {
282 std::vector<nacl::FileDescriptor> sockets;
283 base::ProcessHandle nacl_process;
284 if (!RenderThread::current()->Send(
285 new ViewHostMsg_LaunchNaCl(
286 ASCIIToWide(alleged_url),
287 socket_count,
288 &sockets,
289 &nacl_process,
290 reinterpret_cast<base::ProcessId*>(nacl_process_id)))) {
291 return false;
292 }
293 CHECK(static_cast<int>(sockets.size()) == socket_count);
294 for (int i = 0; i < socket_count; i++) {
295 static_cast<nacl::Handle*>(imc_handles)[i] =
296 nacl::ToNativeHandle(sockets[i]);
297 }
298 *static_cast<nacl::Handle*>(nacl_process_handle) = nacl_process;
299 return true;
300 }
301 #endif
302
277 #if defined(OS_LINUX) 303 #if defined(OS_LINUX)
278 int MatchFontWithFallback(const std::string& face, bool bold, 304 int MatchFontWithFallback(const std::string& face, bool bold,
279 bool italic, int charset) { 305 bool italic, int charset) {
280 return renderer_sandbox_support::MatchFontWithFallback( 306 return renderer_sandbox_support::MatchFontWithFallback(
281 face, bold, italic, charset); 307 face, bold, italic, charset);
282 } 308 }
283 309
284 bool GetFontTable(int fd, uint32_t table, uint8_t* output, 310 bool GetFontTable(int fd, uint32_t table, uint8_t* output,
285 size_t* output_length) { 311 size_t* output_length) {
286 return renderer_sandbox_support::GetFontTable( 312 return renderer_sandbox_support::GetFontTable(
287 fd, table, output, output_length); 313 fd, table, output, output_length);
288 } 314 }
289 #endif 315 #endif
290 316
291 } // namespace webkit_glue 317 } // namespace webkit_glue
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698