Commit bc989439 authored by jochen's avatar jochen Committed by Commit bot

Plumb dependencies on content from test plugin through the delegate

R=mkwst@chromium.org
BUG=478250

Review URL: https://codereview.chromium.org/1142463002

Cr-Commit-Position: refs/heads/master@{#329802}
parent 9dd8083a
...@@ -628,6 +628,15 @@ void BlinkTestRunner::ResetPermissions() { ...@@ -628,6 +628,15 @@ void BlinkTestRunner::ResetPermissions() {
Send(new LayoutTestHostMsg_ResetPermissions(routing_id())); Send(new LayoutTestHostMsg_ResetPermissions(routing_id()));
} }
blink::WebLayer* BlinkTestRunner::InstantiateWebLayer(
scoped_refptr<cc::TextureLayer> layer) {
return ::content::InstantiateWebLayer(layer);
}
cc::SharedBitmapManager* BlinkTestRunner::GetSharedBitmapManager() {
return RenderThread::Get()->GetSharedBitmapManager();
}
// RenderViewObserver -------------------------------------------------------- // RenderViewObserver --------------------------------------------------------
void BlinkTestRunner::DidClearWindowObject(WebLocalFrame* frame) { void BlinkTestRunner::DidClearWindowObject(WebLocalFrame* frame) {
......
...@@ -114,6 +114,9 @@ class BlinkTestRunner : public RenderViewObserver, ...@@ -114,6 +114,9 @@ class BlinkTestRunner : public RenderViewObserver,
const GURL& origin, const GURL& origin,
const GURL& embedding_origin) override; const GURL& embedding_origin) override;
void ResetPermissions() override; void ResetPermissions() override;
blink::WebLayer* InstantiateWebLayer(
scoped_refptr<cc::TextureLayer> layer) override;
cc::SharedBitmapManager* GetSharedBitmapManager() override;
void Reset(); void Reset();
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "base/memory/shared_memory.h" #include "base/memory/shared_memory.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "cc/resources/shared_bitmap_manager.h" #include "cc/resources/shared_bitmap_manager.h"
#include "content/public/renderer/render_thread.h"
#include "content/shell/renderer/test_runner/web_test_delegate.h" #include "content/shell/renderer/test_runner/web_test_delegate.h"
#include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkCanvas.h"
...@@ -223,7 +222,7 @@ bool TestPlugin::initialize(blink::WebPluginContainer* container) { ...@@ -223,7 +222,7 @@ bool TestPlugin::initialize(blink::WebPluginContainer* container) {
return false; return false;
layer_ = cc::TextureLayer::CreateForMailbox(this); layer_ = cc::TextureLayer::CreateForMailbox(this);
web_layer_ = make_scoped_ptr(InstantiateWebLayer(layer_)); web_layer_ = make_scoped_ptr(delegate_->InstantiateWebLayer(layer_));
container_ = container; container_ = container;
container_->setWebLayer(web_layer_.get()); container_->setWebLayer(web_layer_.get());
if (re_request_touch_events_) { if (re_request_touch_events_) {
...@@ -312,7 +311,7 @@ void TestPlugin::updateGeometry( ...@@ -312,7 +311,7 @@ void TestPlugin::updateGeometry(
texture_mailbox_ = cc::TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point); texture_mailbox_ = cc::TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point);
} else { } else {
scoped_ptr<cc::SharedBitmap> bitmap = scoped_ptr<cc::SharedBitmap> bitmap =
RenderThread::Get()->GetSharedBitmapManager()->AllocateSharedBitmap( delegate_->GetSharedBitmapManager()->AllocateSharedBitmap(
gfx::Rect(rect_).size()); gfx::Rect(rect_).size());
if (!bitmap) { if (!bitmap) {
texture_mailbox_ = cc::TextureMailbox(); texture_mailbox_ = cc::TextureMailbox();
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "cc/layers/texture_layer.h" #include "cc/layers/texture_layer.h"
#include "cc/layers/texture_layer_client.h" #include "cc/layers/texture_layer_client.h"
#include "content/public/test/layouttest_support.h"
#include "third_party/WebKit/public/platform/WebExternalTextureLayer.h" #include "third_party/WebKit/public/platform/WebExternalTextureLayer.h"
#include "third_party/WebKit/public/platform/WebExternalTextureLayerClient.h" #include "third_party/WebKit/public/platform/WebExternalTextureLayerClient.h"
#include "third_party/WebKit/public/platform/WebExternalTextureMailbox.h" #include "third_party/WebKit/public/platform/WebExternalTextureMailbox.h"
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <string> #include <string>
#include "base/memory/ref_counted.h"
#include "third_party/WebKit/public/platform/WebScreenOrientationType.h" #include "third_party/WebKit/public/platform/WebScreenOrientationType.h"
#include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/platform/WebURL.h" #include "third_party/WebKit/public/platform/WebURL.h"
...@@ -22,11 +23,17 @@ class WebFrame; ...@@ -22,11 +23,17 @@ class WebFrame;
class WebGamepad; class WebGamepad;
class WebGamepads; class WebGamepads;
class WebHistoryItem; class WebHistoryItem;
class WebLayer;
struct WebRect; struct WebRect;
struct WebSize; struct WebSize;
struct WebURLError; struct WebURLError;
} }
namespace cc {
class TextureLayer;
class SharedBitmapManager;
}
namespace content { namespace content {
class DeviceLightData; class DeviceLightData;
...@@ -203,6 +210,12 @@ class WebTestDelegate { ...@@ -203,6 +210,12 @@ class WebTestDelegate {
// Clear all the permissions set via SetPermission(). // Clear all the permissions set via SetPermission().
virtual void ResetPermissions() = 0; virtual void ResetPermissions() = 0;
// Instantiates WebLayerImpl for TestPlugin.
virtual blink::WebLayer* InstantiateWebLayer(
scoped_refptr<cc::TextureLayer> layer) = 0;
virtual cc::SharedBitmapManager* GetSharedBitmapManager() = 0;
}; };
} // namespace content } // namespace content
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment