| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/test_runner/test_plugin.h" | 5 #include "components/test_runner/test_plugin.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "cc/resources/shared_bitmap_manager.h" | 12 #include "cc/resources/shared_bitmap_manager.h" |
| 13 #include "components/test_runner/web_test_delegate.h" | 13 #include "components/test_runner/web_test_delegate.h" |
| 14 #include "third_party/WebKit/public/platform/Platform.h" | 14 #include "third_party/WebKit/public/platform/Platform.h" |
| 15 #include "third_party/WebKit/public/platform/WebCompositorSupport.h" | 15 #include "third_party/WebKit/public/platform/WebCompositorSupport.h" |
| 16 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 16 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
| 17 #include "third_party/WebKit/public/platform/WebTaskRunner.h" |
| 17 #include "third_party/WebKit/public/platform/WebThread.h" | 18 #include "third_party/WebKit/public/platform/WebThread.h" |
| 18 #include "third_party/WebKit/public/platform/WebTraceLocation.h" | 19 #include "third_party/WebKit/public/platform/WebTraceLocation.h" |
| 19 #include "third_party/WebKit/public/web/WebFrame.h" | 20 #include "third_party/WebKit/public/web/WebFrame.h" |
| 20 #include "third_party/WebKit/public/web/WebInputEvent.h" | 21 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 21 #include "third_party/WebKit/public/web/WebKit.h" | 22 #include "third_party/WebKit/public/web/WebKit.h" |
| 22 #include "third_party/WebKit/public/web/WebPluginParams.h" | 23 #include "third_party/WebKit/public/web/WebPluginParams.h" |
| 23 #include "third_party/WebKit/public/web/WebTouchPoint.h" | 24 #include "third_party/WebKit/public/web/WebTouchPoint.h" |
| 24 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" | 25 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
| 25 #include "third_party/skia/include/core/SkBitmap.h" | 26 #include "third_party/skia/include/core/SkBitmap.h" |
| 26 #include "third_party/skia/include/core/SkCanvas.h" | 27 #include "third_party/skia/include/core/SkCanvas.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 119 |
| 119 blink::WebPluginContainer::TouchEventRequestType ParseTouchEventRequestType( | 120 blink::WebPluginContainer::TouchEventRequestType ParseTouchEventRequestType( |
| 120 const blink::WebString& string) { | 121 const blink::WebString& string) { |
| 121 if (string == blink::WebString::fromUTF8("raw")) | 122 if (string == blink::WebString::fromUTF8("raw")) |
| 122 return blink::WebPluginContainer::TouchEventRequestTypeRaw; | 123 return blink::WebPluginContainer::TouchEventRequestTypeRaw; |
| 123 if (string == blink::WebString::fromUTF8("synthetic")) | 124 if (string == blink::WebString::fromUTF8("synthetic")) |
| 124 return blink::WebPluginContainer::TouchEventRequestTypeSynthesizedMouse; | 125 return blink::WebPluginContainer::TouchEventRequestTypeSynthesizedMouse; |
| 125 return blink::WebPluginContainer::TouchEventRequestTypeNone; | 126 return blink::WebPluginContainer::TouchEventRequestTypeNone; |
| 126 } | 127 } |
| 127 | 128 |
| 128 class DeferredDeleteTask : public blink::WebThread::Task { | 129 class DeferredDeleteTask : public blink::WebTaskRunner::Task { |
| 129 public: | 130 public: |
| 130 DeferredDeleteTask(scoped_ptr<TestPlugin> plugin) : plugin_(plugin.Pass()) {} | 131 DeferredDeleteTask(scoped_ptr<TestPlugin> plugin) : plugin_(plugin.Pass()) {} |
| 131 | 132 |
| 132 void run() override {} | 133 void run() override {} |
| 133 | 134 |
| 134 private: | 135 private: |
| 135 scoped_ptr<TestPlugin> plugin_; | 136 scoped_ptr<TestPlugin> plugin_; |
| 136 }; | 137 }; |
| 137 | 138 |
| 138 } // namespace | 139 } // namespace |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 web_layer_.reset(); | 247 web_layer_.reset(); |
| 247 layer_ = NULL; | 248 layer_ = NULL; |
| 248 DestroyScene(); | 249 DestroyScene(); |
| 249 | 250 |
| 250 delete context_; | 251 delete context_; |
| 251 context_ = 0; | 252 context_ = 0; |
| 252 | 253 |
| 253 container_ = 0; | 254 container_ = 0; |
| 254 frame_ = 0; | 255 frame_ = 0; |
| 255 | 256 |
| 256 blink::Platform::current()->mainThread()->postTask( | 257 blink::Platform::current()->mainThread()->taskRunner()->postTask( |
| 257 blink::WebTraceLocation(__FUNCTION__, __FILE__), | 258 blink::WebTraceLocation(__FUNCTION__, __FILE__), |
| 258 new DeferredDeleteTask(make_scoped_ptr(this))); | 259 new DeferredDeleteTask(make_scoped_ptr(this))); |
| 259 } | 260 } |
| 260 | 261 |
| 261 NPObject* TestPlugin::scriptableObject() { | 262 NPObject* TestPlugin::scriptableObject() { |
| 262 return 0; | 263 return 0; |
| 263 } | 264 } |
| 264 | 265 |
| 265 bool TestPlugin::canProcessDrag() const { | 266 bool TestPlugin::canProcessDrag() const { |
| 266 return can_process_drag_; | 267 return can_process_drag_; |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 return kPluginPersistsMimeType; | 776 return kPluginPersistsMimeType; |
| 776 } | 777 } |
| 777 | 778 |
| 778 bool TestPlugin::IsSupportedMimeType(const blink::WebString& mime_type) { | 779 bool TestPlugin::IsSupportedMimeType(const blink::WebString& mime_type) { |
| 779 return mime_type == TestPlugin::MimeType() || | 780 return mime_type == TestPlugin::MimeType() || |
| 780 mime_type == PluginPersistsMimeType() || | 781 mime_type == PluginPersistsMimeType() || |
| 781 mime_type == CanCreateWithoutRendererMimeType(); | 782 mime_type == CanCreateWithoutRendererMimeType(); |
| 782 } | 783 } |
| 783 | 784 |
| 784 } // namespace test_runner | 785 } // namespace test_runner |
| OLD | NEW |