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

Side by Side Diff: content/ppapi_plugin/ppapi_thread.cc

Issue 6981001: Make the Pepper proxy support in-process font rendering. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/ppapi_plugin/ppapi_thread.h" 5 #include "content/ppapi_plugin/ppapi_thread.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "base/rand_util.h" 10 #include "base/rand_util.h"
11 #include "content/common/child_process.h" 11 #include "content/common/child_process.h"
12 #include "content/ppapi_plugin/broker_process_dispatcher.h" 12 #include "content/ppapi_plugin/broker_process_dispatcher.h"
13 #include "content/ppapi_plugin/plugin_process_dispatcher.h" 13 #include "content/ppapi_plugin/plugin_process_dispatcher.h"
14 #include "content/ppapi_plugin/ppapi_webkit_thread.h"
14 #include "ipc/ipc_channel_handle.h" 15 #include "ipc/ipc_channel_handle.h"
15 #include "ipc/ipc_sync_channel.h" 16 #include "ipc/ipc_sync_channel.h"
16 #include "ppapi/c/pp_errors.h" 17 #include "ppapi/c/pp_errors.h"
17 #include "ppapi/c/ppp.h" 18 #include "ppapi/c/ppp.h"
18 #include "ppapi/proxy/ppapi_messages.h" 19 #include "ppapi/proxy/ppapi_messages.h"
19 20
20 #if defined(OS_WIN) 21 #if defined(OS_WIN)
21 #include "sandbox/src/sandbox.h" 22 #include "sandbox/src/sandbox.h"
22 #endif 23 #endif
23 24
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 74 }
74 75
75 base::WaitableEvent* PpapiThread::GetShutdownEvent() { 76 base::WaitableEvent* PpapiThread::GetShutdownEvent() {
76 return ChildProcess::current()->GetShutDownEvent(); 77 return ChildProcess::current()->GetShutDownEvent();
77 } 78 }
78 79
79 std::set<PP_Instance>* PpapiThread::GetGloballySeenInstanceIDSet() { 80 std::set<PP_Instance>* PpapiThread::GetGloballySeenInstanceIDSet() {
80 return &globally_seen_instance_ids_; 81 return &globally_seen_instance_ids_;
81 } 82 }
82 83
84 void PpapiThread::PostToWebKitThread(const tracked_objects::Location& from_here,
85 const base::Closure& task) {
86 if (!webkit_thread_.get())
87 webkit_thread_.reset(new PpapiWebKitThread);
88 webkit_thread_->PostTask(from_here, task);
89 }
90
83 void PpapiThread::OnMsgLoadPlugin(const FilePath& path) { 91 void PpapiThread::OnMsgLoadPlugin(const FilePath& path) {
84 base::ScopedNativeLibrary library(base::LoadNativeLibrary(path, NULL)); 92 base::ScopedNativeLibrary library(base::LoadNativeLibrary(path, NULL));
85 93
86 #if defined(OS_WIN) 94 #if defined(OS_WIN)
87 // Once we lower the token the sandbox is locked down and no new modules 95 // Once we lower the token the sandbox is locked down and no new modules
88 // can be loaded. TODO(cpu): consider changing to the loading style of 96 // can be loaded. TODO(cpu): consider changing to the loading style of
89 // regular plugins. 97 // regular plugins.
90 if (g_target_services) 98 if (g_target_services)
91 g_target_services->LowerToken(); 99 g_target_services->LowerToken();
92 #endif 100 #endif
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 #if defined(OS_POSIX) 202 #if defined(OS_POSIX)
195 // On POSIX, pass the renderer-side FD. 203 // On POSIX, pass the renderer-side FD.
196 handle->socket = base::FileDescriptor(::dup(dispatcher->GetRendererFD()), 204 handle->socket = base::FileDescriptor(::dup(dispatcher->GetRendererFD()),
197 true); 205 true);
198 #endif 206 #endif
199 207
200 // From here, the dispatcher will manage its own lifetime according to the 208 // From here, the dispatcher will manage its own lifetime according to the
201 // lifetime of the attached channel. 209 // lifetime of the attached channel.
202 return true; 210 return true;
203 } 211 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698