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

Side by Side Diff: chrome/renderer/pepper/ppb_nacl_private_impl.cc

Issue 10843017: PPAPI/NaCl: Restrict ppapi messages to unblock only ppapi (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move RendererRestrictDispatchGroup to content/renderer/public Created 8 years, 4 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
« no previous file with comments | « no previous file | content/public/renderer/renderer_restrict_dispatch_group.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/renderer/pepper/ppb_nacl_private_impl.h" 5 #include "chrome/renderer/pepper/ppb_nacl_private_impl.h"
6 6
7 #ifndef DISABLE_NACL 7 #ifndef DISABLE_NACL
8 8
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include <fcntl.h> 10 #include <fcntl.h>
11 #include <io.h> 11 #include <io.h>
12 #endif 12 #endif
13 13
14 #include "base/command_line.h" 14 #include "base/command_line.h"
15 #include "base/lazy_instance.h" 15 #include "base/lazy_instance.h"
16 #include "base/logging.h" 16 #include "base/logging.h"
17 #include "base/message_loop.h" 17 #include "base/message_loop.h"
18 #include "base/rand_util.h" 18 #include "base/rand_util.h"
19 #include "chrome/common/chrome_switches.h" 19 #include "chrome/common/chrome_switches.h"
20 #include "chrome/common/render_messages.h" 20 #include "chrome/common/render_messages.h"
21 #include "content/public/common/content_client.h" 21 #include "content/public/common/content_client.h"
22 #include "content/public/common/content_switches.h" 22 #include "content/public/common/content_switches.h"
23 #include "content/public/common/sandbox_init.h" 23 #include "content/public/common/sandbox_init.h"
24 #include "content/public/renderer/render_thread.h" 24 #include "content/public/renderer/render_thread.h"
25 #include "content/public/renderer/render_view.h" 25 #include "content/public/renderer/render_view.h"
26 #include "content/public/renderer/renderer_restrict_dispatch_group.h"
26 #include "ipc/ipc_sync_message_filter.h" 27 #include "ipc/ipc_sync_message_filter.h"
27 #include "ppapi/c/private/ppb_nacl_private.h" 28 #include "ppapi/c/private/ppb_nacl_private.h"
28 #include "ppapi/native_client/src/trusted/plugin/nacl_entry_points.h" 29 #include "ppapi/native_client/src/trusted/plugin/nacl_entry_points.h"
29 #include "ppapi/proxy/host_dispatcher.h" 30 #include "ppapi/proxy/host_dispatcher.h"
30 #include "ppapi/proxy/proxy_channel.h" 31 #include "ppapi/proxy/proxy_channel.h"
31 #include "ppapi/shared_impl/ppapi_preferences.h" 32 #include "ppapi/shared_impl/ppapi_preferences.h"
32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" 33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" 34 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h"
34 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" 36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 169
169 if (!dispatcher_->InitHostWithChannel(dispatcher_delegate_.get(), 170 if (!dispatcher_->InitHostWithChannel(dispatcher_delegate_.get(),
170 channel_handle, 171 channel_handle,
171 true, // Client. 172 true, // Client.
172 preferences)) { 173 preferences)) {
173 dispatcher_.reset(); 174 dispatcher_.reset();
174 dispatcher_delegate_.reset(); 175 dispatcher_delegate_.reset();
175 return false; 176 return false;
176 } 177 }
177 178
179 // Make sure that incoming plugin->renderer "unblock" messages can ONLY
180 // unblock other pepper messages.
181 dispatcher_->channel()->SetRestrictDispatchChannelGroup(
182 content::kRendererRestrictDispatchGroup_Pepper);
178 return true; 183 return true;
179 } 184 }
180 185
181 // OutOfProcessProxy implementation. 186 // OutOfProcessProxy implementation.
182 virtual const void* GetProxiedInterface(const char* name) OVERRIDE { 187 virtual const void* GetProxiedInterface(const char* name) OVERRIDE {
183 return dispatcher_->GetProxiedInterface(name); 188 return dispatcher_->GetProxiedInterface(name);
184 } 189 }
185 virtual void AddInstance(PP_Instance instance) OVERRIDE { 190 virtual void AddInstance(PP_Instance instance) OVERRIDE {
186 ppapi::proxy::HostDispatcher::SetForInstance(instance, dispatcher_.get()); 191 ppapi::proxy::HostDispatcher::SetForInstance(instance, dispatcher_.get());
187 } 192 }
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 &GetReadonlyPnaclFD 314 &GetReadonlyPnaclFD
310 }; 315 };
311 316
312 } // namespace 317 } // namespace
313 318
314 const PPB_NaCl_Private* PPB_NaCl_Private_Impl::GetInterface() { 319 const PPB_NaCl_Private* PPB_NaCl_Private_Impl::GetInterface() {
315 return &nacl_interface; 320 return &nacl_interface;
316 } 321 }
317 322
318 #endif // DISABLE_NACL 323 #endif // DISABLE_NACL
OLDNEW
« no previous file with comments | « no previous file | content/public/renderer/renderer_restrict_dispatch_group.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698