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

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
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/content_switches.h" 24 #include "content/common/content_switches.h"
24 #include "content/common/file_system/file_system_dispatcher.h" 25 #include "content/common/file_system/file_system_dispatcher.h"
25 #include "content/common/file_system_messages.h" 26 #include "content/common/file_system_messages.h"
26 #include "content/common/media/audio_messages.h" 27 #include "content/common/media/audio_messages.h"
27 #include "content/common/pepper_file_messages.h" 28 #include "content/common/pepper_file_messages.h"
28 #include "content/common/pepper_plugin_registry.h" 29 #include "content/common/pepper_plugin_registry.h"
29 #include "content/common/pepper_messages.h" 30 #include "content/common/pepper_messages.h"
30 #include "content/common/quota_dispatcher.h" 31 #include "content/common/quota_dispatcher.h"
31 #include "content/common/view_messages.h" 32 #include "content/common/view_messages.h"
(...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after
1551 return CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 1552 return CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
1552 switches::kPpapiFlashArgs); 1553 switches::kPpapiFlashArgs);
1553 } 1554 }
1554 1555
1555 base::SharedMemory* PepperPluginDelegateImpl::CreateAnonymousSharedMemory( 1556 base::SharedMemory* PepperPluginDelegateImpl::CreateAnonymousSharedMemory(
1556 uint32_t size) { 1557 uint32_t size) {
1557 if (size == 0) 1558 if (size == 0)
1558 return NULL; 1559 return NULL;
1559 base::SharedMemoryHandle handle; 1560 base::SharedMemoryHandle handle;
1560 if (!render_view_->Send( 1561 if (!render_view_->Send(
1561 new ViewHostMsg_AllocateSharedMemoryBuffer(size, &handle))) { 1562 new ChildProcessHostMsg_SyncAllocateSharedMemory(size, &handle))) {
1562 DLOG(WARNING) << "Browser allocation request message failed"; 1563 DLOG(WARNING) << "Browser allocation request message failed";
1563 return NULL; 1564 return NULL;
1564 } 1565 }
1565 if (!base::SharedMemory::IsHandleValid(handle)) { 1566 if (!base::SharedMemory::IsHandleValid(handle)) {
1566 DLOG(WARNING) << "Browser failed to allocate shared memory"; 1567 DLOG(WARNING) << "Browser failed to allocate shared memory";
1567 return NULL; 1568 return NULL;
1568 } 1569 }
1569 return new base::SharedMemory(handle, false); 1570 return new base::SharedMemory(handle, false);
1570 } 1571 }
1571 1572
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
1644 1645
1645 int PepperPluginDelegateImpl::GetRoutingId() const { 1646 int PepperPluginDelegateImpl::GetRoutingId() const {
1646 return render_view_->routing_id(); 1647 return render_view_->routing_id();
1647 } 1648 }
1648 1649
1649 void PepperPluginDelegateImpl::PublishInitialPolicy( 1650 void PepperPluginDelegateImpl::PublishInitialPolicy(
1650 scoped_refptr<webkit::ppapi::PluginInstance> instance, 1651 scoped_refptr<webkit::ppapi::PluginInstance> instance,
1651 const std::string& policy) { 1652 const std::string& policy) {
1652 instance->HandlePolicyUpdate(policy); 1653 instance->HandlePolicyUpdate(policy);
1653 } 1654 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698