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() {
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 --------------------------------------------------------
void BlinkTestRunner::DidClearWindowObject(WebLocalFrame* frame) {
......
......@@ -114,6 +114,9 @@ class BlinkTestRunner : public RenderViewObserver,
const GURL& origin,
const GURL& embedding_origin) override;
void ResetPermissions() override;
blink::WebLayer* InstantiateWebLayer(
scoped_refptr<cc::TextureLayer> layer) override;
cc::SharedBitmapManager* GetSharedBitmapManager() override;
void Reset();
......
......@@ -10,7 +10,6 @@
#include "base/memory/shared_memory.h"
#include "base/strings/stringprintf.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 "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h"
......@@ -223,7 +222,7 @@ bool TestPlugin::initialize(blink::WebPluginContainer* container) {
return false;
layer_ = cc::TextureLayer::CreateForMailbox(this);
web_layer_ = make_scoped_ptr(InstantiateWebLayer(layer_));
web_layer_ = make_scoped_ptr(delegate_->InstantiateWebLayer(layer_));
container_ = container;
container_->setWebLayer(web_layer_.get());
if (re_request_touch_events_) {
......@@ -312,7 +311,7 @@ void TestPlugin::updateGeometry(
texture_mailbox_ = cc::TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point);
} else {
scoped_ptr<cc::SharedBitmap> bitmap =
RenderThread::Get()->GetSharedBitmapManager()->AllocateSharedBitmap(
delegate_->GetSharedBitmapManager()->AllocateSharedBitmap(
gfx::Rect(rect_).size());
if (!bitmap) {
texture_mailbox_ = cc::TextureMailbox();
......
......@@ -11,7 +11,6 @@
#include "base/memory/scoped_ptr.h"
#include "cc/layers/texture_layer.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/WebExternalTextureLayerClient.h"
#include "third_party/WebKit/public/platform/WebExternalTextureMailbox.h"
......
......@@ -7,6 +7,7 @@
#include <string>
#include "base/memory/ref_counted.h"
#include "third_party/WebKit/public/platform/WebScreenOrientationType.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/platform/WebURL.h"
......@@ -22,11 +23,17 @@ class WebFrame;
class WebGamepad;
class WebGamepads;
class WebHistoryItem;
class WebLayer;
struct WebRect;
struct WebSize;
struct WebURLError;
}
namespace cc {
class TextureLayer;
class SharedBitmapManager;
}
namespace content {
class DeviceLightData;
......@@ -203,6 +210,12 @@ class WebTestDelegate {
// Clear all the permissions set via SetPermission().
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
......
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