diff options
author | leandrogracia@chromium.org <leandrogracia@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-04 12:20:24 +0000 |
---|---|---|
committer | leandrogracia@chromium.org <leandrogracia@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-04 12:20:24 +0000 |
commit | 11b426f286e9d641c2cbe075e28284ae9d952f94 (patch) | |
tree | 4ba31f147c0bbd919e8cbc8d11b4e9163c5f5924 /android_webview/browser | |
parent | 942f75aad836a8ae3b154289f5db27b58b5c182c (diff) | |
download | chromium_src-11b426f286e9d641c2cbe075e28284ae9d952f94.zip chromium_src-11b426f286e9d641c2cbe075e28284ae9d952f94.tar.gz chromium_src-11b426f286e9d641c2cbe075e28284ae9d952f94.tar.bz2 |
[Android WebView] Prepare to simulate SW rendering with the capture picture API backend.
Introduce the required code to get SW rendering working once RenderView is able
to provide the required picture piles from the compositor.
BUG=167913
Review URL: https://codereview.chromium.org/11727005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175135 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/browser')
-rw-r--r-- | android_webview/browser/renderer_host/aw_render_view_host_ext.cc | 15 | ||||
-rw-r--r-- | android_webview/browser/renderer_host/aw_render_view_host_ext.h | 16 |
2 files changed, 26 insertions, 5 deletions
diff --git a/android_webview/browser/renderer_host/aw_render_view_host_ext.cc b/android_webview/browser/renderer_host/aw_render_view_host_ext.cc index 4a529f6..73bcad0 100644 --- a/android_webview/browser/renderer_host/aw_render_view_host_ext.cc +++ b/android_webview/browser/renderer_host/aw_render_view_host_ext.cc @@ -8,14 +8,17 @@ #include "base/android/scoped_java_ref.h" #include "base/callback.h" #include "base/logging.h" +#include "content/public/browser/render_process_host.h" #include "content/public/browser/user_metrics.h" #include "content/public/browser/web_contents.h" namespace android_webview { -AwRenderViewHostExt::AwRenderViewHostExt(content::WebContents* contents) +AwRenderViewHostExt::AwRenderViewHostExt(content::WebContents* contents, + Client* client) : content::WebContentsObserver(contents), - has_new_hit_test_data_(false) { + has_new_hit_test_data_(false), + client_(client) { } AwRenderViewHostExt::~AwRenderViewHostExt() {} @@ -75,6 +78,8 @@ bool AwRenderViewHostExt::OnMessageReceived(const IPC::Message& message) { OnDocumentHasImagesResponse) IPC_MESSAGE_HANDLER(AwViewHostMsg_UpdateHitTestData, OnUpdateHitTestData) + IPC_MESSAGE_HANDLER(AwViewHostMsg_PictureUpdated, + OnPictureUpdated) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() @@ -101,4 +106,10 @@ void AwRenderViewHostExt::OnUpdateHitTestData( has_new_hit_test_data_ = true; } +void AwRenderViewHostExt::OnPictureUpdated() { + if (client_) + client_->OnPictureUpdated(web_contents()->GetRenderProcessHost()->GetID(), + routing_id()); +} + } // namespace android_webview diff --git a/android_webview/browser/renderer_host/aw_render_view_host_ext.h b/android_webview/browser/renderer_host/aw_render_view_host_ext.h index a6d8dde..83bd439 100644 --- a/android_webview/browser/renderer_host/aw_render_view_host_ext.h +++ b/android_webview/browser/renderer_host/aw_render_view_host_ext.h @@ -18,9 +18,17 @@ namespace android_webview { class AwRenderViewHostExt : public content::WebContentsObserver, public base::NonThreadSafe { public: + class Client { + public: + virtual void OnPictureUpdated(int process_id, int render_view_id) = 0; + + protected: + virtual ~Client() {} + }; + // To send receive messages to a RenderView we take the WebContents instance, // as it internally handles RenderViewHost instances changing underneath us. - AwRenderViewHostExt(content::WebContents* contents); + AwRenderViewHostExt(content::WebContents* contents, Client* client); virtual ~AwRenderViewHostExt(); // |result| will be invoked with the outcome of the request. @@ -48,8 +56,8 @@ class AwRenderViewHostExt : public content::WebContentsObserver, virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; void OnDocumentHasImagesResponse(int msg_id, bool has_images); - void OnUpdateHitTestData( - const AwHitTestData& hit_test_data); + void OnUpdateHitTestData(const AwHitTestData& hit_test_data); + void OnPictureUpdated(); std::map<int, DocumentHasImagesResult> pending_document_has_images_requests_; @@ -60,6 +68,8 @@ class AwRenderViewHostExt : public content::WebContentsObserver, bool has_new_hit_test_data_; + Client* client_; + DISALLOW_COPY_AND_ASSIGN(AwRenderViewHostExt); }; |