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

Unified Diff: chrome/plugin/command_buffer_stub.cc

Issue 6588029: Moved creation of GPU command buffer shared memory into the browser process.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/plugin/command_buffer_stub.h ('k') | chrome/renderer/command_buffer_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/plugin/command_buffer_stub.cc
===================================================================
--- chrome/plugin/command_buffer_stub.cc (revision 76263)
+++ chrome/plugin/command_buffer_stub.cc (working copy)
@@ -2,12 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/plugin/command_buffer_stub.h"
+
#include "base/callback.h"
#include "base/scoped_open_process.h"
#include "base/shared_memory.h"
#include "chrome/common/gpu_messages.h"
#include "chrome/common/plugin_messages.h"
-#include "chrome/plugin/command_buffer_stub.h"
#include "chrome/plugin/plugin_channel.h"
using gpu::Buffer;
@@ -67,66 +68,13 @@
Send(new GpuCommandBufferMsg_NotifyRepaint(route_id_));
}
-void CommandBufferStub::OnInitialize(int32 size,
- base::SharedMemoryHandle* ring_buffer) {
- DCHECK(!command_buffer_.get());
-
- *ring_buffer = base::SharedMemory::NULLHandle();
-
- // Assume service is responsible for duplicating the handle from the calling
- // process.
- base::ScopedOpenProcess peer_process;
- if (!peer_process.Open(channel_->peer_pid()))
- return;
-
- command_buffer_.reset(new gpu::CommandBufferService);
-
- // Initialize the CommandBufferService.
- if (!command_buffer_->Initialize(size)) {
- Destroy();
- return;
- }
-
- // Get the ring buffer.
- Buffer buffer = command_buffer_->GetRingBuffer();
- if (!buffer.shared_memory) {
- Destroy();
- return;
- }
-
- // Initialize the GPUProcessor.
- processor_.reset(new gpu::GPUProcessor(command_buffer_.get(), NULL));
- if (!processor_->Initialize(window_, gfx::Size(), NULL, std::vector<int32>(),
- NULL, 0)) {
- Destroy();
- return;
- }
-
- // Perform platform specific initialization.
- if (!InitializePlatformSpecific()) {
- Destroy();
- return;
- }
-
- // Share the ring buffer to the client process.
- if (!buffer.shared_memory->ShareToProcess(peer_process.handle(),
- ring_buffer)) {
- Destroy();
- return;
- }
-
- // Setup callbacks for events.
- command_buffer_->SetPutOffsetChangeCallback(
- NewCallback(processor_.get(),
- &gpu::GPUProcessor::ProcessCommands));
-#if defined(OS_MACOSX)
- processor_->SetSwapBuffersCallback(
- NewCallback(this,
- &CommandBufferStub::SwapBuffersCallback));
- processor_->SetTransportDIBAllocAndFree(
- NewCallback(this, &CommandBufferStub::AllocTransportDIB),
- NewCallback(this, &CommandBufferStub::FreeTransportDIB));
-#endif
+void CommandBufferStub::OnInitialize(base::SharedMemoryHandle ring_buffer,
+ int32 size,
+ bool* result) {
+ // TODO(apatrick): Pepper3D v1 is not used anymore. This function is never
+ // called. Delete the GPU plugin.
+ NOTREACHED();
+ *result = false;
}
void CommandBufferStub::OnGetState(gpu::CommandBuffer::State* state) {
« no previous file with comments | « chrome/plugin/command_buffer_stub.h ('k') | chrome/renderer/command_buffer_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698