OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/npapi/webplugin_impl.h" | 5 #include "content/renderer/npapi/webplugin_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/crash_logging.h" | 9 #include "base/debug/crash_logging.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/memory/linked_ptr.h" | 11 #include "base/memory/linked_ptr.h" |
12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
13 #include "base/metrics/user_metrics_action.h" | 13 #include "base/metrics/user_metrics_action.h" |
14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
15 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "cc/layers/io_surface_layer.h" | 17 #include "cc/layers/io_surface_layer.h" |
18 #include "content/child/appcache/web_application_cache_host_impl.h" | 18 #include "content/child/appcache/web_application_cache_host_impl.h" |
19 #include "content/child/npapi/plugin_host.h" | 19 #include "content/child/npapi/plugin_host.h" |
20 #include "content/child/npapi/plugin_instance.h" | 20 #include "content/child/npapi/plugin_instance.h" |
21 #include "content/child/npapi/webplugin_delegate_impl.h" | 21 #include "content/child/npapi/webplugin_delegate_impl.h" |
22 #include "content/child/npapi/webplugin_resource_client.h" | 22 #include "content/child/npapi/webplugin_resource_client.h" |
23 #include "content/common/view_messages.h" | 23 #include "content/common/view_messages.h" |
24 #include "content/public/common/content_constants.h" | 24 #include "content/public/common/content_constants.h" |
25 #include "content/public/common/content_switches.h" | 25 #include "content/public/common/content_switches.h" |
26 #include "content/public/renderer/content_renderer_client.h" | 26 #include "content/public/renderer/content_renderer_client.h" |
| 27 #include "content/renderer/compositor_bindings/web_layer_impl.h" |
27 #include "content/renderer/npapi/webplugin_delegate_proxy.h" | 28 #include "content/renderer/npapi/webplugin_delegate_proxy.h" |
28 #include "content/renderer/render_frame_impl.h" | 29 #include "content/renderer/render_frame_impl.h" |
29 #include "content/renderer/render_process.h" | 30 #include "content/renderer/render_process.h" |
30 #include "content/renderer/render_thread_impl.h" | 31 #include "content/renderer/render_thread_impl.h" |
31 #include "content/renderer/render_view_impl.h" | 32 #include "content/renderer/render_view_impl.h" |
32 #include "net/base/escape.h" | 33 #include "net/base/escape.h" |
33 #include "net/base/net_errors.h" | 34 #include "net/base/net_errors.h" |
34 #include "net/http/http_response_headers.h" | 35 #include "net/http/http_response_headers.h" |
35 #include "skia/ext/platform_canvas.h" | 36 #include "skia/ext/platform_canvas.h" |
36 #include "third_party/WebKit/public/platform/WebCString.h" | 37 #include "third_party/WebKit/public/platform/WebCString.h" |
(...skipping 13 matching lines...) Expand all Loading... |
50 #include "third_party/WebKit/public/web/WebInputEvent.h" | 51 #include "third_party/WebKit/public/web/WebInputEvent.h" |
51 #include "third_party/WebKit/public/web/WebKit.h" | 52 #include "third_party/WebKit/public/web/WebKit.h" |
52 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 53 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
53 #include "third_party/WebKit/public/web/WebPluginParams.h" | 54 #include "third_party/WebKit/public/web/WebPluginParams.h" |
54 #include "third_party/WebKit/public/web/WebURLLoaderOptions.h" | 55 #include "third_party/WebKit/public/web/WebURLLoaderOptions.h" |
55 #include "third_party/WebKit/public/web/WebView.h" | 56 #include "third_party/WebKit/public/web/WebView.h" |
56 #include "ui/gfx/rect.h" | 57 #include "ui/gfx/rect.h" |
57 #include "url/gurl.h" | 58 #include "url/gurl.h" |
58 #include "url/url_util.h" | 59 #include "url/url_util.h" |
59 #include "webkit/child/multipart_response_delegate.h" | 60 #include "webkit/child/multipart_response_delegate.h" |
60 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" | |
61 | 61 |
62 using blink::WebCanvas; | 62 using blink::WebCanvas; |
63 using blink::WebConsoleMessage; | 63 using blink::WebConsoleMessage; |
64 using blink::WebCookieJar; | 64 using blink::WebCookieJar; |
65 using blink::WebCString; | 65 using blink::WebCString; |
66 using blink::WebCursorInfo; | 66 using blink::WebCursorInfo; |
67 using blink::WebData; | 67 using blink::WebData; |
68 using blink::WebDataSource; | 68 using blink::WebDataSource; |
69 using blink::WebFrame; | 69 using blink::WebFrame; |
70 using blink::WebHTTPBody; | 70 using blink::WebHTTPBody; |
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 // work around garbage occasionally showing up in the plugin's | 845 // work around garbage occasionally showing up in the plugin's |
846 // area during live resizing of Core Animation plugins. The | 846 // area during live resizing of Core Animation plugins. The |
847 // assumption was that by the time this was called, the plugin | 847 // assumption was that by the time this was called, the plugin |
848 // process would have populated the newly allocated IOSurface. It | 848 // process would have populated the newly allocated IOSurface. It |
849 // is not 100% clear at this point why any garbage is getting | 849 // is not 100% clear at this point why any garbage is getting |
850 // through. More investigation is needed. http://crbug.com/105346 | 850 // through. More investigation is needed. http://crbug.com/105346 |
851 if (next_io_surface_allocated_) { | 851 if (next_io_surface_allocated_) { |
852 if (next_io_surface_id_) { | 852 if (next_io_surface_id_) { |
853 if (!io_surface_layer_.get()) { | 853 if (!io_surface_layer_.get()) { |
854 io_surface_layer_ = cc::IOSurfaceLayer::Create(); | 854 io_surface_layer_ = cc::IOSurfaceLayer::Create(); |
855 web_layer_.reset(new webkit::WebLayerImpl(io_surface_layer_)); | 855 web_layer_.reset(new WebLayerImpl(io_surface_layer_)); |
856 container_->setWebLayer(web_layer_.get()); | 856 container_->setWebLayer(web_layer_.get()); |
857 } | 857 } |
858 io_surface_layer_->SetIOSurfaceProperties( | 858 io_surface_layer_->SetIOSurfaceProperties( |
859 next_io_surface_id_, | 859 next_io_surface_id_, |
860 gfx::Size(next_io_surface_width_, next_io_surface_height_)); | 860 gfx::Size(next_io_surface_width_, next_io_surface_height_)); |
861 } else { | 861 } else { |
862 container_->setWebLayer(NULL); | 862 container_->setWebLayer(NULL); |
863 web_layer_.reset(); | 863 web_layer_.reset(); |
864 io_surface_layer_ = NULL; | 864 io_surface_layer_ = NULL; |
865 } | 865 } |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1523 case PLUGIN_SRC: | 1523 case PLUGIN_SRC: |
1524 webframe_->setReferrerForRequest(*request, plugin_url_); | 1524 webframe_->setReferrerForRequest(*request, plugin_url_); |
1525 break; | 1525 break; |
1526 | 1526 |
1527 default: | 1527 default: |
1528 break; | 1528 break; |
1529 } | 1529 } |
1530 } | 1530 } |
1531 | 1531 |
1532 } // namespace content | 1532 } // namespace content |
OLD | NEW |