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

Side by Side Diff: content/renderer/pepper_plugin_delegate_impl.cc

Issue 8229039: Make shared memory allocation possible for all child process types. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 | « content/renderer/gpu/command_buffer_proxy.cc ('k') | content/renderer/render_thread_impl.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 (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/renderer/pepper_plugin_delegate_impl.h" 5 #include "content/renderer/pepper_plugin_delegate_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <queue> 8 #include <queue>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/file_path.h" 13 #include "base/file_path.h"
14 #include "base/file_util_proxy.h" 14 #include "base/file_util_proxy.h"
15 #include "base/logging.h" 15 #include "base/logging.h"
16 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_ptr.h"
17 #include "base/string_split.h" 17 #include "base/string_split.h"
18 #include "base/sync_socket.h" 18 #include "base/sync_socket.h"
19 #include "base/task.h" 19 #include "base/task.h"
20 #include "base/time.h" 20 #include "base/time.h"
21 #include "content/common/child_process.h" 21 #include "content/common/child_process.h"
22 #include "content/common/child_process_messages.h"
22 #include "content/common/child_thread.h" 23 #include "content/common/child_thread.h"
23 #include "content/common/file_system/file_system_dispatcher.h" 24 #include "content/common/file_system/file_system_dispatcher.h"
24 #include "content/common/file_system_messages.h" 25 #include "content/common/file_system_messages.h"
25 #include "content/common/media/audio_messages.h" 26 #include "content/common/media/audio_messages.h"
26 #include "content/common/pepper_file_messages.h" 27 #include "content/common/pepper_file_messages.h"
27 #include "content/common/pepper_plugin_registry.h" 28 #include "content/common/pepper_plugin_registry.h"
28 #include "content/common/pepper_messages.h" 29 #include "content/common/pepper_messages.h"
29 #include "content/common/quota_dispatcher.h" 30 #include "content/common/quota_dispatcher.h"
30 #include "content/common/view_messages.h" 31 #include "content/common/view_messages.h"
31 #include "content/public/common/content_switches.h" 32 #include "content/public/common/content_switches.h"
(...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after
1649 return CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 1650 return CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
1650 switches::kPpapiFlashArgs); 1651 switches::kPpapiFlashArgs);
1651 } 1652 }
1652 1653
1653 base::SharedMemory* PepperPluginDelegateImpl::CreateAnonymousSharedMemory( 1654 base::SharedMemory* PepperPluginDelegateImpl::CreateAnonymousSharedMemory(
1654 uint32_t size) { 1655 uint32_t size) {
1655 if (size == 0) 1656 if (size == 0)
1656 return NULL; 1657 return NULL;
1657 base::SharedMemoryHandle handle; 1658 base::SharedMemoryHandle handle;
1658 if (!render_view_->Send( 1659 if (!render_view_->Send(
1659 new ViewHostMsg_AllocateSharedMemoryBuffer(size, &handle))) { 1660 new ChildProcessHostMsg_SyncAllocateSharedMemory(size, &handle))) {
1660 DLOG(WARNING) << "Browser allocation request message failed"; 1661 DLOG(WARNING) << "Browser allocation request message failed";
1661 return NULL; 1662 return NULL;
1662 } 1663 }
1663 if (!base::SharedMemory::IsHandleValid(handle)) { 1664 if (!base::SharedMemory::IsHandleValid(handle)) {
1664 DLOG(WARNING) << "Browser failed to allocate shared memory"; 1665 DLOG(WARNING) << "Browser failed to allocate shared memory";
1665 return NULL; 1666 return NULL;
1666 } 1667 }
1667 return new base::SharedMemory(handle, false); 1668 return new base::SharedMemory(handle, false);
1668 } 1669 }
1669 1670
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
1746 1747
1747 int PepperPluginDelegateImpl::GetRoutingId() const { 1748 int PepperPluginDelegateImpl::GetRoutingId() const {
1748 return render_view_->routing_id(); 1749 return render_view_->routing_id();
1749 } 1750 }
1750 1751
1751 void PepperPluginDelegateImpl::PublishInitialPolicy( 1752 void PepperPluginDelegateImpl::PublishInitialPolicy(
1752 scoped_refptr<webkit::ppapi::PluginInstance> instance, 1753 scoped_refptr<webkit::ppapi::PluginInstance> instance,
1753 const std::string& policy) { 1754 const std::string& policy) {
1754 instance->HandlePolicyUpdate(policy); 1755 instance->HandlePolicyUpdate(policy);
1755 } 1756 }
OLDNEW
« no previous file with comments | « content/renderer/gpu/command_buffer_proxy.cc ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698