diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-08-08 14:30:41 +0200 |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-08-12 13:49:54 +0200 |
commit | ab0a50979b9eb4dfa3320eff7e187e41efedf7a9 (patch) | |
tree | 498dfb8a97ff3361a9f7486863a52bb4e26bb898 /chromium/content/plugin | |
parent | 4ce69f7403811819800e7c5ae1318b2647e778d1 (diff) |
Update Chromium to beta version 37.0.2062.68
Change-Id: I188e3b5aff1bec75566014291b654eb19f5bc8ca
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'chromium/content/plugin')
-rw-r--r-- | chromium/content/plugin/BUILD.gn | 44 | ||||
-rw-r--r-- | chromium/content/plugin/DEPS | 1 | ||||
-rw-r--r-- | chromium/content/plugin/plugin_channel.cc | 15 | ||||
-rw-r--r-- | chromium/content/plugin/plugin_channel.h | 1 | ||||
-rw-r--r-- | chromium/content/plugin/plugin_main.cc | 13 | ||||
-rw-r--r-- | chromium/content/plugin/plugin_main_linux.cc | 74 | ||||
-rw-r--r-- | chromium/content/plugin/plugin_thread.cc | 53 | ||||
-rw-r--r-- | chromium/content/plugin/plugin_thread.h | 3 | ||||
-rw-r--r-- | chromium/content/plugin/webplugin_accelerated_surface_proxy_mac.cc | 5 | ||||
-rw-r--r-- | chromium/content/plugin/webplugin_delegate_stub.cc | 7 | ||||
-rw-r--r-- | chromium/content/plugin/webplugin_delegate_stub.h | 2 | ||||
-rw-r--r-- | chromium/content/plugin/webplugin_proxy.cc | 117 | ||||
-rw-r--r-- | chromium/content/plugin/webplugin_proxy.h | 31 |
13 files changed, 76 insertions, 290 deletions
diff --git a/chromium/content/plugin/BUILD.gn b/chromium/content/plugin/BUILD.gn new file mode 100644 index 00000000000..6235dbf6650 --- /dev/null +++ b/chromium/content/plugin/BUILD.gn @@ -0,0 +1,44 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") + +# This is the NPAPI plugin process. It isn't used on Linux. +if (enable_plugins && !is_linux) { + source_set("plugin") { + visibility = "//content/*" + sources = [ + "plugin_channel.cc", + "plugin_channel.h", + "plugin_interpose_util_mac.mm", + "plugin_interpose_util_mac.h", + "plugin_main.cc", + "plugin_main_mac.mm", + "plugin_thread.cc", + "plugin_thread.h", + "webplugin_accelerated_surface_proxy_mac.cc", + "webplugin_accelerated_surface_proxy_mac.h", + "webplugin_delegate_stub.cc", + "webplugin_delegate_stub.h", + "webplugin_proxy.cc", + "webplugin_proxy.h", + ] + + configs += [ "//content:content_implementation" ] + + deps = [ + "//content:export", + "//mojo/public/interfaces/service_provider", + "//skia", + "//third_party/npapi", + #"//third_party/WebKit/public:blink", TODO(GYP) + # TODO(GYP) remove this when blink is enabled: + "//third_party/WebKit/public:blink_headers", + ] + } +} else { + # This way it can be unconditionally depended on. + group("plugin") { + } +} diff --git a/chromium/content/plugin/DEPS b/chromium/content/plugin/DEPS index a87bacc2e3b..9fc12edd0d2 100644 --- a/chromium/content/plugin/DEPS +++ b/chromium/content/plugin/DEPS @@ -5,6 +5,5 @@ include_rules = [ "+sandbox/win/src", "+skia/ext", "+third_party/npapi", - "+webkit/glue", ] diff --git a/chromium/content/plugin/plugin_channel.cc b/chromium/content/plugin/plugin_channel.cc index 1ba88781856..0f960442ae5 100644 --- a/chromium/content/plugin/plugin_channel.cc +++ b/chromium/content/plugin/plugin_channel.cc @@ -20,6 +20,7 @@ #include "content/plugin/webplugin_delegate_stub.h" #include "content/plugin/webplugin_proxy.h" #include "content/public/common/content_switches.h" +#include "ipc/message_filter.h" #include "third_party/WebKit/public/web/WebBindings.h" #if defined(OS_POSIX) @@ -40,9 +41,9 @@ const int kPluginReleaseTimeMinutes = 5; // If a sync call to the renderer results in a modal dialog, we need to have a // way to know so that we can run a nested message loop to simulate what would // happen in a single process browser and avoid deadlock. -class PluginChannel::MessageFilter : public IPC::ChannelProxy::MessageFilter { +class PluginChannel::MessageFilter : public IPC::MessageFilter { public: - MessageFilter() : channel_(NULL) { } + MessageFilter() : sender_(NULL) { } base::WaitableEvent* GetModalDialogEvent(int render_view_id) { base::AutoLock auto_lock(modal_dialog_event_map_lock_); @@ -74,12 +75,12 @@ class PluginChannel::MessageFilter : public IPC::ChannelProxy::MessageFilter { bool Send(IPC::Message* message) { // Need this function for the IPC_MESSAGE_HANDLER_DELAY_REPLY macro. - return channel_->Send(message); + return sender_->Send(message); } - // IPC::ChannelProxy::MessageFilter: - virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE { - channel_ = channel; + // IPC::MessageFilter: + virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE { + sender_ = sender; } virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { @@ -137,7 +138,7 @@ class PluginChannel::MessageFilter : public IPC::ChannelProxy::MessageFilter { ModalDialogEventMap modal_dialog_event_map_; base::Lock modal_dialog_event_map_lock_; - IPC::Channel* channel_; + IPC::Sender* sender_; }; PluginChannel* PluginChannel::GetPluginChannel( diff --git a/chromium/content/plugin/plugin_channel.h b/chromium/content/plugin/plugin_channel.h index 75359449ff1..ffe5c79cc9b 100644 --- a/chromium/content/plugin/plugin_channel.h +++ b/chromium/content/plugin/plugin_channel.h @@ -7,7 +7,6 @@ #include <vector> #include "base/memory/ref_counted.h" -#include "base/memory/scoped_handle.h" #include "base/process/process.h" #include "build/build_config.h" #include "content/child/npapi/np_channel_base.h" diff --git a/chromium/content/plugin/plugin_main.cc b/chromium/content/plugin/plugin_main.cc index e55d2356a05..bcf8856561e 100644 --- a/chromium/content/plugin/plugin_main.cc +++ b/chromium/content/plugin/plugin_main.cc @@ -38,9 +38,6 @@ void TrimInterposeEnvironment(); // Initializes the global Cocoa application object. void InitializeChromeApplication(); -#elif defined(OS_LINUX) -// Work around an unimplemented instruction in 64-bit Flash. -void WorkaroundFlashLAHF(); #endif // main() routine for running as the plugin process. @@ -52,7 +49,7 @@ int PluginMain(const MainFunctionParams& parameters) { #endif InitializeChromeApplication(); #endif - base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI); + base::MessageLoopForUI main_message_loop; base::PlatformThread::SetName("CrPluginMain"); base::debug::TraceLog::GetInstance()->SetProcessName("Plugin Process"); base::debug::TraceLog::GetInstance()->SetProcessSortIndex( @@ -60,13 +57,7 @@ int PluginMain(const MainFunctionParams& parameters) { const CommandLine& parsed_command_line = parameters.command_line; -#if defined(OS_LINUX) - -#if defined(ARCH_CPU_64_BITS) - WorkaroundFlashLAHF(); -#endif - -#elif defined(OS_WIN) +#if defined(OS_WIN) base::win::ScopedCOMInitializer com_initializer; #endif diff --git a/chromium/content/plugin/plugin_main_linux.cc b/chromium/content/plugin/plugin_main_linux.cc deleted file mode 100644 index 7566b13c52a..00000000000 --- a/chromium/content/plugin/plugin_main_linux.cc +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include <signal.h> -#include <string.h> -#include <sys/types.h> -#include <syscall.h> -#include <unistd.h> - -#include "build/build_config.h" - -// This whole file is only useful on 64-bit architectures. -#if defined(ARCH_CPU_64_BITS) - -namespace content { - -namespace { - -// Signal handler for SIGILL; see WorkaroundFlashLAHF(). -void SignalHandler(int signum, siginfo_t* info, void* void_context) { - const char kLAHFInstruction = 0x9f; - ucontext_t* context = static_cast<ucontext_t*>(void_context); - greg_t* regs = context->uc_mcontext.gregs; - char instruction = *reinterpret_cast<char*>(regs[REG_RIP]); - - // Check whether this is the kind of SIGILL we care about. - // (info->si_addr can be NULL when we get a SIGILL via other means, - // like with kill.) - if (signum != SIGILL || instruction != kLAHFInstruction) { - // Not the problem we're interested in. Reraise the signal. We - // need to be careful to handle threads etc. properly. - - struct sigaction sa = { { NULL } }; - sigemptyset(&sa.sa_mask); - sa.sa_handler = SIG_DFL; - sigaction(signum, &sa, NULL); - - // block the current signal - sigset_t block_set; - sigemptyset(&block_set); - sigaddset(&block_set, signum); - sigprocmask(SIG_BLOCK, &block_set, NULL); - - // Re-raise signal. It won't be delivered until we return. - syscall(SYS_tkill, syscall(SYS_gettid), signum); - return; - } - - // LAHF moves the low byte of the EFLAGS register to AH. Emulate that. - reinterpret_cast<char*>(®s[REG_RAX])[1] = - reinterpret_cast<char*>(®s[REG_EFL])[0]; - // And advance the instruction pointer past the (one-byte) instruction. - ++regs[REG_RIP]; -} - -} // namespace - -// 64-bit Flash sometimes uses the LAHF instruction which isn't -// available on some CPUs. We can work around it by catching SIGILL -// (illegal instruction), checking if the signal was caused by this -// particular circumstance, emulating the instruction, and resuming. -// This function registers the signal handler. -void WorkaroundFlashLAHF() { - struct sigaction action = { { NULL } }; - action.sa_flags = SA_SIGINFO; - action.sa_sigaction = &SignalHandler; - - sigaction(SIGILL, &action, NULL); -} - -} // namespace content - -#endif // defined(ARCH_CPU_64_BITS) diff --git a/chromium/content/plugin/plugin_thread.cc b/chromium/content/plugin/plugin_thread.cc index 72fd3cb9134..bec0f98d887 100644 --- a/chromium/content/plugin/plugin_thread.cc +++ b/chromium/content/plugin/plugin_thread.cc @@ -6,9 +6,7 @@ #include "build/build_config.h" -#if defined(TOOLKIT_GTK) -#include <gtk/gtk.h> -#elif defined(OS_MACOSX) +#if defined(OS_MACOSX) #include <CoreFoundation/CoreFoundation.h> #endif @@ -21,34 +19,29 @@ #include "base/process/kill.h" #include "base/process/process_handle.h" #include "base/threading/thread_local.h" +#include "content/child/blink_platform_impl.h" #include "content/child/child_process.h" #include "content/child/npapi/npobject_util.h" #include "content/child/npapi/plugin_lib.h" #include "content/common/plugin_process_messages.h" #include "content/public/common/content_switches.h" #include "content/public/plugin/content_plugin_client.h" +#include "third_party/WebKit/public/web/WebKit.h" #include "ipc/ipc_channel_handle.h" - -#if defined(TOOLKIT_GTK) -#include "ui/gfx/gtk_util.h" -#endif - -#if defined(USE_X11) -#include "ui/base/x/x11_util.h" -#endif +#include "ipc/message_filter.h" namespace content { namespace { -class EnsureTerminateMessageFilter : public IPC::ChannelProxy::MessageFilter { +class EnsureTerminateMessageFilter : public IPC::MessageFilter { public: EnsureTerminateMessageFilter() {} protected: virtual ~EnsureTerminateMessageFilter() {} - // IPC::ChannelProxy::MessageFilter: + // IPC::MessageFilter: virtual void OnChannelError() OVERRIDE { // How long we wait before forcibly shutting down the process. const base::TimeDelta kPluginProcessTerminateTimeout = @@ -81,33 +74,6 @@ PluginThread::PluginThread() switches::kPluginPath); lazy_tls.Pointer()->Set(this); -#if defined(USE_AURA) - // TODO(saintlou): -#elif defined(TOOLKIT_GTK) - { - // XEmbed plugins assume they are hosted in a Gtk application, so we need - // to initialize Gtk in the plugin process. - // g_thread_init API is deprecated since glib 2.31.0, see release note: - // http://mail.gnome.org/archives/gnome-announce-list/2011-October/msg00041.html -#if !(GLIB_CHECK_VERSION(2, 31, 0)) - g_thread_init(NULL); -#endif - - // Flash has problems receiving clicks with newer GTKs due to the - // client-side windows change. To be safe, we just always set the - // backwards-compat environment variable. - setenv("GDK_NATIVE_WINDOWS", "1", 1); - - gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); - - // GTK after 2.18 resets the environment variable. But if we're using - // nspluginwrapper, that means it'll spawn its subprocess without the - // environment variable! So set it again. - setenv("GDK_NATIVE_WINDOWS", "1", 1); - } - - ui::SetDefaultX11ErrorHandlers(); -#endif PatchNPNFunctions(); @@ -125,10 +91,11 @@ PluginThread::PluginThread() GetContentClient()->plugin()->PluginProcessStarted( plugin.get() ? plugin->plugin_info().name : base::string16()); - // Certain plugins, such as flash, steal the unhandled exception filter - // thus we never get crash reports when they fault. This call fixes it. - message_loop()->set_exception_restoration(true); channel()->AddFilter(new EnsureTerminateMessageFilter()); + + // This is needed because we call some code which uses WebKit strings. + webkit_platform_support_.reset(new BlinkPlatformImpl); + blink::initialize(webkit_platform_support_.get()); } PluginThread::~PluginThread() { diff --git a/chromium/content/plugin/plugin_thread.h b/chromium/content/plugin/plugin_thread.h index 5ca2c02e2e4..f76cfa1b3a1 100644 --- a/chromium/content/plugin/plugin_thread.h +++ b/chromium/content/plugin/plugin_thread.h @@ -17,6 +17,7 @@ #endif namespace content { +class BlinkPlatformImpl; // The PluginThread class represents a background thread where plugin instances // live. Communication occurs between WebPluginDelegateProxy in the renderer @@ -51,6 +52,8 @@ class PluginThread : public ChildThread { bool forcefully_terminate_plugin_process_; + scoped_ptr<BlinkPlatformImpl> webkit_platform_support_; + DISALLOW_COPY_AND_ASSIGN(PluginThread); }; diff --git a/chromium/content/plugin/webplugin_accelerated_surface_proxy_mac.cc b/chromium/content/plugin/webplugin_accelerated_surface_proxy_mac.cc index 3397b4196c5..f01131302cd 100644 --- a/chromium/content/plugin/webplugin_accelerated_surface_proxy_mac.cc +++ b/chromium/content/plugin/webplugin_accelerated_surface_proxy_mac.cc @@ -10,7 +10,6 @@ #include "base/command_line.h" #include "content/plugin/webplugin_proxy.h" #include "content/public/common/content_switches.h" -#include "ui/gl/io_surface_support_mac.h" #include "ui/surface/accelerated_surface_mac.h" #include "ui/surface/transport_dib.h" @@ -24,10 +23,6 @@ WebPluginAcceleratedSurfaceProxy* WebPluginAcceleratedSurfaceProxy::Create( DCHECK(!CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableCoreAnimationPlugins)); - // Require IOSurface support for drawing Core Animation plugins. - if (!IOSurfaceSupport::Initialize()) - return NULL; - AcceleratedSurface* surface = new AcceleratedSurface; // It's possible for OpenGL to fail to initialize (e.g., if an incompatible // mode is forced via flags), so handle that gracefully. diff --git a/chromium/content/plugin/webplugin_delegate_stub.cc b/chromium/content/plugin/webplugin_delegate_stub.cc index fd4827d320b..81267b5f64f 100644 --- a/chromium/content/plugin/webplugin_delegate_stub.cc +++ b/chromium/content/plugin/webplugin_delegate_stub.cc @@ -13,6 +13,7 @@ #include "content/child/npapi/webplugin_delegate_impl.h" #include "content/child/npapi/webplugin_resource_client.h" #include "content/child/plugin_messages.h" +#include "content/common/cursors/webcursor.h" #include "content/plugin/plugin_channel.h" #include "content/plugin/plugin_thread.h" #include "content/plugin/webplugin_proxy.h" @@ -24,7 +25,6 @@ #include "third_party/WebKit/public/web/WebBindings.h" #include "third_party/npapi/bindings/npapi.h" #include "third_party/npapi/bindings/npruntime.h" -#include "webkit/common/cursors/webcursor.h" using blink::WebBindings; using blink::WebCursorInfo; @@ -345,9 +345,7 @@ void WebPluginDelegateStub::OnImeCompositionUpdated( int cursor_position) { if (delegate_) delegate_->ImeCompositionUpdated(text, clauses, target, cursor_position); -#if defined(OS_WIN) && !defined(USE_AURA) webplugin_->UpdateIMEStatus(); -#endif } void WebPluginDelegateStub::OnImeCompositionCompleted( @@ -444,7 +442,8 @@ void WebPluginDelegateStub::OnFetchURL( params.notify_redirect, params.is_plugin_src_load, channel_->renderer_id(), - params.render_view_id); + params.render_frame_id, + webplugin_->host_render_view_routing_id()); } } // namespace content diff --git a/chromium/content/plugin/webplugin_delegate_stub.h b/chromium/content/plugin/webplugin_delegate_stub.h index 8787f2524b1..e0f6526f8b0 100644 --- a/chromium/content/plugin/webplugin_delegate_stub.h +++ b/chromium/content/plugin/webplugin_delegate_stub.h @@ -21,7 +21,6 @@ struct PluginMsg_Init_Params; struct PluginMsg_DidReceiveResponseParams; struct PluginMsg_FetchURL_Params; struct PluginMsg_UpdateGeometry_Param; -class WebCursor; namespace blink { class WebInputEvent; @@ -29,6 +28,7 @@ class WebInputEvent; namespace content { class PluginChannel; +class WebCursor; class WebPluginDelegateImpl; class WebPluginProxy; diff --git a/chromium/content/plugin/webplugin_proxy.cc b/chromium/content/plugin/webplugin_proxy.cc index c87aac263f9..81003fccb04 100644 --- a/chromium/content/plugin/webplugin_proxy.cc +++ b/chromium/content/plugin/webplugin_proxy.cc @@ -8,7 +8,6 @@ #include "base/bind.h" #include "base/lazy_instance.h" -#include "base/memory/scoped_handle.h" #include "base/memory/shared_memory.h" #include "build/build_config.h" #include "content/child/npapi/npobject_proxy.h" @@ -19,12 +18,12 @@ #include "content/plugin/plugin_channel.h" #include "content/plugin/plugin_thread.h" #include "content/public/common/content_client.h" -#include "content/public/common/url_constants.h" #include "skia/ext/platform_canvas.h" #include "skia/ext/platform_device.h" #include "third_party/WebKit/public/web/WebBindings.h" #include "ui/gfx/blit.h" #include "ui/gfx/canvas.h" +#include "url/url_constants.h" #if defined(OS_MACOSX) #include "base/mac/mac_util.h" @@ -32,10 +31,6 @@ #include "content/plugin/webplugin_accelerated_surface_proxy_mac.h" #endif -#if defined(USE_X11) -#include "ui/base/x/x11_util_internal.h" -#endif - #if defined(OS_WIN) #include "content/common/plugin_process_messages.h" #include "content/public/common/sandbox_init.h" @@ -67,36 +62,9 @@ WebPluginProxy::WebPluginProxy( windowless_buffer_index_(0), host_render_view_routing_id_(host_render_view_routing_id), weak_factory_(this) { -#if defined(USE_X11) - windowless_shm_pixmaps_[0] = None; - windowless_shm_pixmaps_[1] = None; - use_shm_pixmap_ = false; - - // If the X server supports SHM pixmaps - // and the color depth and masks match, - // then consider using SHM pixmaps for windowless plugin painting. - XDisplay* display = gfx::GetXDisplay(); - if (ui::QuerySharedMemorySupport(display) == ui::SHARED_MEMORY_PIXMAP && - gfx::BitsPerPixelForPixmapDepth( - display, DefaultDepth(display, DefaultScreen(display))) == 32) { - Visual* vis = DefaultVisual(display, DefaultScreen(display)); - - if (vis->red_mask == 0xff0000 && - vis->green_mask == 0xff00 && - vis->blue_mask == 0xff) - use_shm_pixmap_ = true; - } -#endif } WebPluginProxy::~WebPluginProxy() { -#if defined(USE_X11) - if (windowless_shm_pixmaps_[0] != None) - XFreePixmap(gfx::GetXDisplay(), windowless_shm_pixmaps_[0]); - if (windowless_shm_pixmaps_[1] != None) - XFreePixmap(gfx::GetXDisplay(), windowless_shm_pixmaps_[1]); -#endif - #if defined(OS_MACOSX) // Destroy the surface early, since it may send messages during cleanup. if (accelerated_surface_) @@ -126,8 +94,6 @@ void WebPluginProxy::WillDestroyWindow(gfx::PluginWindowHandle window) { PluginThread::current()->Send( new PluginProcessHostMsg_PluginWindowDestroyed( window, ::GetParent(window))); -#elif defined(USE_X11) - // Nothing to do. #else NOTIMPLEMENTED(); #endif @@ -321,9 +287,9 @@ void WebPluginProxy::HandleURLRequest(const char* url, if (delegate_->GetQuirks() & WebPluginDelegateImpl::PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS) { GURL request_url(url); - if (!request_url.SchemeIs(kHttpScheme) && - !request_url.SchemeIs(kHttpsScheme) && - !request_url.SchemeIs(kFtpScheme)) { + if (!request_url.SchemeIs(url::kHttpScheme) && + !request_url.SchemeIs(url::kHttpsScheme) && + !request_url.SchemeIs(url::kFtpScheme)) { return; } } @@ -384,10 +350,6 @@ void WebPluginProxy::Paint(const gfx::Rect& rect) { // See above comment about windowless_context_ changing. // http::/crbug.com/139462 skia::RefPtr<skia::PlatformCanvas> saved_canvas = windowless_canvas(); -#if defined(USE_X11) - scoped_refptr<SharedTransportDIB> local_dib_ref( - windowless_dibs_[windowless_buffer_index_]); -#endif saved_canvas->save(); @@ -437,9 +399,6 @@ void WebPluginProxy::UpdateGeometry( DCHECK(0 <= windowless_buffer_index && windowless_buffer_index <= 1); windowless_buffer_index_ = windowless_buffer_index; -#if defined(USE_X11) - delegate_->SetWindowlessShmPixmap(windowless_shm_pixmap()); -#endif #if defined(OS_MACOSX) delegate_->UpdateGeometryAndContext( @@ -533,72 +492,6 @@ void WebPluginProxy::SetWindowlessBuffers( &windowless_contexts_[1]); } -#elif defined(TOOLKIT_GTK) - -void WebPluginProxy::CreateDIBAndCanvasFromHandle( - const TransportDIB::Handle& dib_handle, - const gfx::Rect& window_rect, - scoped_refptr<SharedTransportDIB>* dib_out, - skia::RefPtr<skia::PlatformCanvas>* canvas) { - TransportDIB* dib = TransportDIB::Map(dib_handle); - // dib may be NULL if the renderer has already destroyed the TransportDIB by - // the time we receive the handle, e.g. in case of multiple resizes. - if (dib) { - *canvas = skia::AdoptRef( - dib->GetPlatformCanvas(window_rect.width(), window_rect.height())); - } else { - canvas->clear(); - } - *dib_out = new SharedTransportDIB(dib); -} - -void WebPluginProxy::CreateShmPixmapFromDIB( - TransportDIB* dib, - const gfx::Rect& window_rect, - XID* pixmap_out) { - if (dib) { - XDisplay* display = gfx::GetXDisplay(); - XID root_window = ui::GetX11RootWindow(); - XShmSegmentInfo shminfo = {0}; - - if (*pixmap_out != None) - XFreePixmap(display, *pixmap_out); - - shminfo.shmseg = dib->MapToX(display); - // Create a shared memory pixmap based on the image buffer. - *pixmap_out = XShmCreatePixmap(display, root_window, - NULL, &shminfo, - window_rect.width(), window_rect.height(), - DefaultDepth(display, - DefaultScreen(display))); - } -} - -void WebPluginProxy::SetWindowlessBuffers( - const TransportDIB::Handle& windowless_buffer0, - const TransportDIB::Handle& windowless_buffer1, - const gfx::Rect& window_rect) { - CreateDIBAndCanvasFromHandle(windowless_buffer0, - window_rect, - &windowless_dibs_[0], - &windowless_canvases_[0]); - CreateDIBAndCanvasFromHandle(windowless_buffer1, - window_rect, - &windowless_dibs_[1], - &windowless_canvases_[1]); - - // If SHM pixmaps support is available, create SHM pixmaps to pass to the - // delegate for windowless plugin painting. - if (delegate_->IsWindowless() && use_shm_pixmap_) { - CreateShmPixmapFromDIB(windowless_dibs_[0]->dib(), - window_rect, - &windowless_shm_pixmaps_[0]); - CreateShmPixmapFromDIB(windowless_dibs_[1]->dib(), - window_rect, - &windowless_shm_pixmaps_[1]); - } -} - #else void WebPluginProxy::SetWindowlessBuffers( @@ -706,7 +599,7 @@ void WebPluginProxy::URLRedirectResponse(bool allow, int resource_id) { bool WebPluginProxy::CheckIfRunInsecureContent(const GURL& url) { bool result = true; Send(new PluginHostMsg_CheckIfRunInsecureContent( - host_render_view_routing_id_, url, &result)); + route_id_, url, &result)); return result; } diff --git a/chromium/content/plugin/webplugin_proxy.h b/chromium/content/plugin/webplugin_proxy.h index dfa06c57b72..5cece13893e 100644 --- a/chromium/content/plugin/webplugin_proxy.h +++ b/chromium/content/plugin/webplugin_proxy.h @@ -12,7 +12,6 @@ #if defined(OS_MACOSX) #include "base/mac/scoped_cftyperef.h" #endif -#include "base/memory/scoped_handle.h" #include "base/memory/scoped_ptr.h" #include "base/memory/shared_memory.h" #include "base/memory/weak_ptr.h" @@ -23,9 +22,6 @@ #include "skia/ext/refptr.h" #include "third_party/skia/include/core/SkCanvas.h" #include "url/gurl.h" -#if defined(USE_X11) -#include "ui/base/x/x11_util.h" -#endif #include "ui/gl/gpu_preference.h" #include "ui/surface/transport_dib.h" @@ -170,17 +166,6 @@ class WebPluginProxy : public WebPlugin, const gfx::Rect& window_rect, scoped_ptr<TransportDIB>* dib_out, base::ScopedCFTypeRef<CGContextRef>* cg_context_out); -#elif defined(USE_X11) - static void CreateDIBAndCanvasFromHandle( - const TransportDIB::Handle& dib_handle, - const gfx::Rect& window_rect, - scoped_refptr<SharedTransportDIB>* dib_out, - skia::RefPtr<SkCanvas>* canvas); - - static void CreateShmPixmapFromDIB( - TransportDIB* dib, - const gfx::Rect& window_rect, - XID* pixmap_out); #endif // Updates the shared memory sections where windowless plugins paint. @@ -196,13 +181,6 @@ class WebPluginProxy : public WebPlugin, skia::RefPtr<SkCanvas> windowless_canvas() const { return windowless_canvases_[windowless_buffer_index_]; } - -#if defined(USE_X11) - XID windowless_shm_pixmap() const { - return windowless_shm_pixmaps_[windowless_buffer_index_]; - } -#endif - #endif typedef base::hash_map<int, WebPluginResourceClient*> ResourceClientMap; @@ -230,15 +208,6 @@ class WebPluginProxy : public WebPlugin, scoped_ptr<WebPluginAcceleratedSurfaceProxy> accelerated_surface_; #else skia::RefPtr<SkCanvas> windowless_canvases_[2]; - -#if defined(USE_X11) - scoped_refptr<SharedTransportDIB> windowless_dibs_[2]; - // If we can use SHM pixmaps for windowless plugin painting or not. - bool use_shm_pixmap_; - // The SHM pixmaps for windowless plugin painting. - XID windowless_shm_pixmaps_[2]; -#endif - #endif // Contains the routing id of the host render view. |