summaryrefslogtreecommitdiff
path: root/chromium/content/renderer
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/content/renderer')
-rw-r--r--chromium/content/renderer/gpu/mailbox_output_surface.cc1
-rw-r--r--chromium/content/renderer/media/media_stream_dispatcher.cc31
-rw-r--r--chromium/content/renderer/media/media_stream_dispatcher.h31
-rw-r--r--chromium/content/renderer/npapi/webplugin_delegate_proxy.cc2
-rw-r--r--chromium/content/renderer/pepper/message_channel.cc12
-rw-r--r--chromium/content/renderer/pepper/message_channel.h18
-rw-r--r--chromium/content/renderer/pepper/pepper_platform_context_3d.cc10
-rw-r--r--chromium/content/renderer/pepper/pepper_platform_context_3d.h7
-rw-r--r--chromium/content/renderer/pepper/pepper_plugin_instance_impl.cc24
-rw-r--r--chromium/content/renderer/pepper/ppb_graphics_3d_impl.cc4
-rw-r--r--chromium/content/renderer/render_thread_impl.cc2
-rw-r--r--chromium/content/renderer/renderer_main.cc3
-rw-r--r--chromium/content/renderer/renderer_webcolorchooser_impl.h5
13 files changed, 95 insertions, 55 deletions
diff --git a/chromium/content/renderer/gpu/mailbox_output_surface.cc b/chromium/content/renderer/gpu/mailbox_output_surface.cc
index b23575da9ac..09e1ec0f7ac 100644
--- a/chromium/content/renderer/gpu/mailbox_output_surface.cc
+++ b/chromium/content/renderer/gpu/mailbox_output_surface.cc
@@ -5,7 +5,6 @@
#include "content/renderer/gpu/mailbox_output_surface.h"
#include "base/logging.h"
-#include "cc/base/util.h"
#include "cc/output/compositor_frame.h"
#include "cc/output/compositor_frame_ack.h"
#include "cc/output/gl_frame_data.h"
diff --git a/chromium/content/renderer/media/media_stream_dispatcher.cc b/chromium/content/renderer/media/media_stream_dispatcher.cc
index 96f92fbfa9c..6890ffc5d6f 100644
--- a/chromium/content/renderer/media/media_stream_dispatcher.cc
+++ b/chromium/content/renderer/media/media_stream_dispatcher.cc
@@ -30,6 +30,37 @@ bool RemoveStreamDeviceFromArray(const StreamDeviceInfo device_info,
} // namespace
+// A request is identified by pair (request_id, handler), or ipc_request.
+// There could be multiple clients making requests and each has its own
+// request_id sequence.
+// The ipc_request is garanteed to be unique when it's created in
+// MediaStreamDispatcher.
+struct MediaStreamDispatcher::Request {
+ Request(const base::WeakPtr<MediaStreamDispatcherEventHandler>& handler,
+ int request_id,
+ int ipc_request)
+ : handler(handler),
+ request_id(request_id),
+ ipc_request(ipc_request) {
+ }
+ bool IsThisRequest(
+ int request_id1,
+ const base::WeakPtr<MediaStreamDispatcherEventHandler>& handler1) {
+ return (request_id1 == request_id && handler1.get() == handler.get());
+ }
+ base::WeakPtr<MediaStreamDispatcherEventHandler> handler;
+ int request_id;
+ int ipc_request;
+};
+
+struct MediaStreamDispatcher::Stream {
+ Stream() {}
+ ~Stream() {}
+ base::WeakPtr<MediaStreamDispatcherEventHandler> handler;
+ StreamDeviceInfoArray audio_array;
+ StreamDeviceInfoArray video_array;
+};
+
MediaStreamDispatcher::MediaStreamDispatcher(RenderViewImpl* render_view)
: RenderViewObserver(render_view),
main_loop_(base::MessageLoopProxy::current()),
diff --git a/chromium/content/renderer/media/media_stream_dispatcher.h b/chromium/content/renderer/media/media_stream_dispatcher.h
index 4c08958488a..89d7c0daafa 100644
--- a/chromium/content/renderer/media/media_stream_dispatcher.h
+++ b/chromium/content/renderer/media/media_stream_dispatcher.h
@@ -99,38 +99,11 @@ class CONTENT_EXPORT MediaStreamDispatcher
FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, TestFailure);
FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, CancelGenerateStream);
- // A request is identified by pair (request_id, handler), or ipc_request.
- // There could be multiple clients making requests and each has its own
- // request_id sequence.
- // The ipc_request is garanteed to be unique when it's created in
- // MediaStreamDispatcher.
- struct Request {
- Request(const base::WeakPtr<MediaStreamDispatcherEventHandler>& handler,
- int request_id,
- int ipc_request)
- : handler(handler),
- request_id(request_id),
- ipc_request(ipc_request) {
- }
- bool IsThisRequest(
- int request_id1,
- const base::WeakPtr<MediaStreamDispatcherEventHandler>& handler1) {
- return (request_id1 == request_id && handler1.get() == handler.get());
- }
- base::WeakPtr<MediaStreamDispatcherEventHandler> handler;
- int request_id;
- int ipc_request;
- };
+ struct Request;
// Private class for keeping track of opened devices and who have
// opened it.
- struct Stream {
- Stream() {}
- ~Stream() {}
- base::WeakPtr<MediaStreamDispatcherEventHandler> handler;
- StreamDeviceInfoArray audio_array;
- StreamDeviceInfoArray video_array;
- };
+ struct Stream;
// RenderViewObserver OVERRIDE.
virtual bool Send(IPC::Message* message) OVERRIDE;
diff --git a/chromium/content/renderer/npapi/webplugin_delegate_proxy.cc b/chromium/content/renderer/npapi/webplugin_delegate_proxy.cc
index a6418fb5a8f..d7f847240b0 100644
--- a/chromium/content/renderer/npapi/webplugin_delegate_proxy.cc
+++ b/chromium/content/renderer/npapi/webplugin_delegate_proxy.cc
@@ -6,7 +6,7 @@
#if defined(TOOLKIT_GTK)
#include <gtk/gtk.h>
-#elif defined(USE_CAIRO)
+#elif defined(USE_X11)
#include <cairo/cairo.h>
#endif
diff --git a/chromium/content/renderer/pepper/message_channel.cc b/chromium/content/renderer/pepper/message_channel.cc
index 7c5961cfbe2..51132a6dc42 100644
--- a/chromium/content/renderer/pepper/message_channel.cc
+++ b/chromium/content/renderer/pepper/message_channel.cc
@@ -292,6 +292,18 @@ NPClass message_channel_class = {
} // namespace
// MessageChannel --------------------------------------------------------------
+struct MessageChannel::VarConversionResult {
+ VarConversionResult(const ppapi::ScopedPPVar& r, bool s)
+ : result(r),
+ success(s),
+ conversion_completed(true) {}
+ VarConversionResult()
+ : success(false),
+ conversion_completed(false) {}
+ ppapi::ScopedPPVar result;
+ bool success;
+ bool conversion_completed;
+};
MessageChannel::MessageChannelNPObject::MessageChannelNPObject() {
}
diff --git a/chromium/content/renderer/pepper/message_channel.h b/chromium/content/renderer/pepper/message_channel.h
index 43aa0f95a62..e0020e688c1 100644
--- a/chromium/content/renderer/pepper/message_channel.h
+++ b/chromium/content/renderer/pepper/message_channel.h
@@ -11,12 +11,15 @@
#include "base/memory/weak_ptr.h"
#include "ppapi/shared_impl/resource.h"
-#include "ppapi/shared_impl/scoped_pp_var.h"
#include "third_party/WebKit/public/web/WebSerializedScriptValue.h"
#include "third_party/npapi/bindings/npruntime.h"
struct PP_Var;
+namespace ppapi {
+class ScopedPPVar;
+}
+
namespace content {
class PepperPluginInstanceImpl;
@@ -87,18 +90,7 @@ class MessageChannel {
private:
// Struct for storing the result of a NPVariant being converted to a PP_Var.
- struct VarConversionResult {
- VarConversionResult(const ppapi::ScopedPPVar& r, bool s)
- : result(r),
- success(s),
- conversion_completed(true) {}
- VarConversionResult()
- : success(false),
- conversion_completed(false) {}
- ppapi::ScopedPPVar result;
- bool success;
- bool conversion_completed;
- };
+ struct VarConversionResult;
// This is called when an NPVariant is finished being converted.
// |result_iteartor| is an iterator into |converted_var_queue_| where the
diff --git a/chromium/content/renderer/pepper/pepper_platform_context_3d.cc b/chromium/content/renderer/pepper/pepper_platform_context_3d.cc
index b9fd07b67d5..6c3408bd429 100644
--- a/chromium/content/renderer/pepper/pepper_platform_context_3d.cc
+++ b/chromium/content/renderer/pepper/pepper_platform_context_3d.cc
@@ -107,6 +107,7 @@ bool PlatformContext3D::Init(const int32* attrib_list,
if (!command_buffer_->ProduceFrontBuffer(names[0]))
return false;
mailbox_ = names[0];
+ sync_point_ = command_buffer_->InsertSyncPoint();
command_buffer_->SetChannelErrorCallback(
base::Bind(&PlatformContext3D::OnContextLost,
@@ -118,8 +119,15 @@ bool PlatformContext3D::Init(const int32* attrib_list,
return true;
}
-void PlatformContext3D::GetBackingMailbox(gpu::Mailbox* mailbox) {
+void PlatformContext3D::GetBackingMailbox(gpu::Mailbox* mailbox,
+ uint32* sync_point) {
*mailbox = mailbox_;
+ *sync_point = sync_point_;
+}
+
+void PlatformContext3D::InsertSyncPointForBackingMailbox() {
+ DCHECK(command_buffer_);
+ sync_point_ = command_buffer_->InsertSyncPoint();
}
bool PlatformContext3D::IsOpaque() {
diff --git a/chromium/content/renderer/pepper/pepper_platform_context_3d.h b/chromium/content/renderer/pepper/pepper_platform_context_3d.h
index 2520bbd65da..dcd42caa611 100644
--- a/chromium/content/renderer/pepper/pepper_platform_context_3d.h
+++ b/chromium/content/renderer/pepper/pepper_platform_context_3d.h
@@ -31,7 +31,11 @@ class PlatformContext3D {
bool Init(const int32* attrib_list, PlatformContext3D* share_context);
// Retrieves the mailbox name for the front buffer backing the context.
- void GetBackingMailbox(gpu::Mailbox* mailbox);
+ void GetBackingMailbox(gpu::Mailbox* mailbox, uint32* sync_point);
+
+ // Inserts a new sync point to associate with the backing mailbox, that should
+ // be waited on before using the mailbox.
+ void InsertSyncPointForBackingMailbox();
// Returns true if the backing texture is always opaque.
bool IsOpaque();
@@ -68,6 +72,7 @@ class PlatformContext3D {
scoped_refptr<GpuChannelHost> channel_;
gpu::Mailbox mailbox_;
+ uint32 sync_point_;
bool has_alpha_;
CommandBufferProxyImpl* command_buffer_;
base::Closure context_lost_callback_;
diff --git a/chromium/content/renderer/pepper/pepper_plugin_instance_impl.cc b/chromium/content/renderer/pepper/pepper_plugin_instance_impl.cc
index c6d6582132c..405d6ceb4c4 100644
--- a/chromium/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/chromium/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -700,9 +700,21 @@ void PepperPluginInstanceImpl::ScrollRect(int dx,
}
}
+static void IgnoreCallback(unsigned, bool) {}
+
void PepperPluginInstanceImpl::CommitBackingTexture() {
- if (texture_layer_.get())
- texture_layer_->SetNeedsDisplay();
+ if (!texture_layer_.get())
+ return;
+ PlatformContext3D* context = bound_graphics_3d_->platform_context();
+ gpu::Mailbox mailbox;
+ uint32 sync_point = 0;
+ context->GetBackingMailbox(&mailbox, &sync_point);
+ DCHECK(!mailbox.IsZero());
+ DCHECK_NE(sync_point, 0u);
+ texture_layer_->SetTextureMailbox(
+ cc::TextureMailbox(mailbox, sync_point),
+ cc::SingleReleaseCallback::Create(base::Bind(&IgnoreCallback)));
+ texture_layer_->SetNeedsDisplay();
}
void PepperPluginInstanceImpl::InstanceCrashed() {
@@ -1857,16 +1869,16 @@ bool PepperPluginInstanceImpl::PrintPDFOutput(PP_Resource print_output,
#endif
}
-static void IgnoreCallback(unsigned, bool) {}
-
void PepperPluginInstanceImpl::UpdateLayer() {
if (!container_)
return;
gpu::Mailbox mailbox;
+ uint32 sync_point = 0;
if (bound_graphics_3d_.get()) {
PlatformContext3D* context = bound_graphics_3d_->platform_context();
- context->GetBackingMailbox(&mailbox);
+ context->GetBackingMailbox(&mailbox, &sync_point);
+ DCHECK_EQ(mailbox.IsZero(), sync_point == 0);
}
bool want_3d_layer = !mailbox.IsZero();
bool want_2d_layer = bound_graphics_2d_platform_ &&
@@ -1895,7 +1907,7 @@ void PepperPluginInstanceImpl::UpdateLayer() {
texture_layer_ = cc::TextureLayer::CreateForMailbox(NULL);
opaque = bound_graphics_3d_->IsOpaque();
texture_layer_->SetTextureMailbox(
- cc::TextureMailbox(mailbox, 0),
+ cc::TextureMailbox(mailbox, sync_point),
cc::SingleReleaseCallback::Create(base::Bind(&IgnoreCallback)));
} else {
DCHECK(bound_graphics_2d_platform_);
diff --git a/chromium/content/renderer/pepper/ppb_graphics_3d_impl.cc b/chromium/content/renderer/pepper/ppb_graphics_3d_impl.cc
index 1564279f7b4..989b9994395 100644
--- a/chromium/content/renderer/pepper/ppb_graphics_3d_impl.cc
+++ b/chromium/content/renderer/pepper/ppb_graphics_3d_impl.cc
@@ -197,6 +197,10 @@ int32 PPB_Graphics3D_Impl::DoSwapBuffers() {
if (gles2_impl())
gles2_impl()->SwapBuffers();
+ // Since the backing texture has been updated, a new sync point should be
+ // inserted.
+ platform_context_->InsertSyncPointForBackingMailbox();
+
if (bound_to_instance_) {
// If we are bound to the instance, we need to ask the compositor
// to commit our backing texture so that the graphics appears on the page.
diff --git a/chromium/content/renderer/render_thread_impl.cc b/chromium/content/renderer/render_thread_impl.cc
index 609b965f468..e910b8bf80d 100644
--- a/chromium/content/renderer/render_thread_impl.cc
+++ b/chromium/content/renderer/render_thread_impl.cc
@@ -314,7 +314,7 @@ void RenderThreadImpl::Init() {
v8::V8::SetCreateHistogramFunction(CreateHistogram);
v8::V8::SetAddHistogramSampleFunction(AddHistogramSample);
-#if (defined(OS_MACOSX) || defined(OS_ANDROID)) && !defined(TOOLKIT_QT)
+#if defined(OS_MACOSX) || defined(OS_ANDROID)
// On Mac and Android, the select popups are rendered by the browser.
blink::WebView::setUseExternalPopupMenus(true);
#endif
diff --git a/chromium/content/renderer/renderer_main.cc b/chromium/content/renderer/renderer_main.cc
index 5330d21a564..63c72ae934b 100644
--- a/chromium/content/renderer/renderer_main.cc
+++ b/chromium/content/renderer/renderer_main.cc
@@ -161,8 +161,6 @@ int RendererMain(const MainFunctionParams& parameters) {
// As long as we use Cocoa in the renderer (for the forseeable future as of
// now; see http://crbug.com/306348 for info) we need to have a UI loop.
base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI);
-#elif defined(OS_WIN) && defined(TOOLKIT_QT)
- base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT);
#else
// The main message loop of the renderer services doesn't have IO or UI tasks,
// unless in-process-plugins is used.
@@ -225,6 +223,7 @@ int RendererMain(const MainFunctionParams& parameters) {
if (!no_sandbox) {
run_loop = platform.EnableSandbox();
} else {
+ LOG(ERROR) << "Running without renderer sandbox";
#ifndef NDEBUG
// For convenience, we print the stack trace for crashes. We can't get
// symbols when the sandbox is enabled, so only try when the sandbox is
diff --git a/chromium/content/renderer/renderer_webcolorchooser_impl.h b/chromium/content/renderer/renderer_webcolorchooser_impl.h
index d7534788738..0fa608f4359 100644
--- a/chromium/content/renderer/renderer_webcolorchooser_impl.h
+++ b/chromium/content/renderer/renderer_webcolorchooser_impl.h
@@ -36,6 +36,11 @@ class RendererWebColorChooserImpl : public blink::WebColorChooser,
blink::WebColorChooserClient* client() { return client_; }
+ // Don't destroy the RendererWebColorChooserImpl when the RenderViewImpl goes
+ // away. RendererWebColorChooserImpl is owned by
+ // blink::ColorChooserUIController.
+ virtual void OnDestruct() OVERRIDE {}
+
private:
// RenderViewObserver implementation.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;