Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: content/browser/browser_plugin/test_browser_plugin_guest.cc

Issue 283623002: Add support for passing an arbitrary parameter to an IPC message handler. The motivation is for Web… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/browser/browser_plugin/test_browser_plugin_guest.h" 5 #include "content/browser/browser_plugin/test_browser_plugin_guest.h"
6 6
7 #include "base/test/test_timeouts.h" 7 #include "base/test/test_timeouts.h"
8 #include "content/browser/renderer_host/render_view_host_impl.h" 8 #include "content/browser/renderer_host/render_view_host_impl.h"
9 #include "content/browser/web_contents/web_contents_impl.h" 9 #include "content/browser/web_contents/web_contents_impl.h"
10 #include "content/common/browser_plugin/browser_plugin_messages.h" 10 #include "content/common/browser_plugin/browser_plugin_messages.h"
(...skipping 19 matching lines...) Expand all
30 TestBrowserPluginGuest::~TestBrowserPluginGuest() { 30 TestBrowserPluginGuest::~TestBrowserPluginGuest() {
31 } 31 }
32 32
33 WebContentsImpl* TestBrowserPluginGuest::web_contents() const { 33 WebContentsImpl* TestBrowserPluginGuest::web_contents() const {
34 return static_cast<WebContentsImpl*>(BrowserPluginGuest::web_contents()); 34 return static_cast<WebContentsImpl*>(BrowserPluginGuest::web_contents());
35 } 35 }
36 36
37 void TestBrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { 37 void TestBrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) {
38 if (msg->type() == BrowserPluginMsg_UpdateRect::ID) { 38 if (msg->type() == BrowserPluginMsg_UpdateRect::ID) {
39 update_rect_count_++; 39 update_rect_count_++;
40 int instance_id = 0; 40 BrowserPluginMsg_UpdateRect::Param param;
41 BrowserPluginMsg_UpdateRect_Params params; 41 BrowserPluginMsg_UpdateRect::Read(msg, &param);
42 BrowserPluginMsg_UpdateRect::Read(msg, &instance_id, &params); 42 BrowserPluginMsg_UpdateRect_Params params = param.b;
43 last_view_size_observed_ = params.view_size; 43 last_view_size_observed_ = params.view_size;
44 if (!expected_auto_view_size_.IsEmpty() && 44 if (!expected_auto_view_size_.IsEmpty() &&
45 expected_auto_view_size_ == params.view_size) { 45 expected_auto_view_size_ == params.view_size) {
46 if (auto_view_size_message_loop_runner_) 46 if (auto_view_size_message_loop_runner_)
47 auto_view_size_message_loop_runner_->Quit(); 47 auto_view_size_message_loop_runner_->Quit();
48 } 48 }
49 if (send_message_loop_runner_) 49 if (send_message_loop_runner_)
50 send_message_loop_runner_->Quit(); 50 send_message_loop_runner_->Quit();
51 } 51 }
52 BrowserPluginGuest::SendMessageToEmbedder(msg); 52 BrowserPluginGuest::SendMessageToEmbedder(msg);
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 last_size_observed_in_resize_ = params.view_rect.size(); 222 last_size_observed_in_resize_ = params.view_rect.size();
223 if (last_size_observed_in_resize_ == expected_view_size_in_resize_ && 223 if (last_size_observed_in_resize_ == expected_view_size_in_resize_ &&
224 resize_guest_message_loop_runner_) { 224 resize_guest_message_loop_runner_) {
225 resize_guest_message_loop_runner_->Quit(); 225 resize_guest_message_loop_runner_->Quit();
226 } 226 }
227 227
228 BrowserPluginGuest::OnResizeGuest(instance_id, params); 228 BrowserPluginGuest::OnResizeGuest(instance_id, params);
229 } 229 }
230 230
231 } // namespace content 231 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698