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

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 2621303004: Keep track of coalesced events in main thread event queue (Closed)
Patch Set: Improve MainThreadEventQueue unittests Created 3 years, 11 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
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/renderer/pepper/pepper_plugin_instance_impl.h" 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bit_cast.h" 10 #include "base/bit_cast.h"
(...skipping 2223 matching lines...) Expand 10 before | Expand all | Expand 10 after
2234 if (handled) 2234 if (handled)
2235 return; 2235 return;
2236 2236
2237 std::vector<std::unique_ptr<WebInputEvent>> events = 2237 std::vector<std::unique_ptr<WebInputEvent>> events =
2238 CreateSimulatedWebInputEvents( 2238 CreateSimulatedWebInputEvents(
2239 input_event, view_data_.rect.point.x + view_data_.rect.size.width / 2, 2239 input_event, view_data_.rect.point.x + view_data_.rect.size.width / 2,
2240 view_data_.rect.point.y + view_data_.rect.size.height / 2); 2240 view_data_.rect.point.y + view_data_.rect.size.height / 2);
2241 for (std::vector<std::unique_ptr<WebInputEvent>>::iterator it = 2241 for (std::vector<std::unique_ptr<WebInputEvent>>::iterator it =
2242 events.begin(); 2242 events.begin();
2243 it != events.end(); ++it) { 2243 it != events.end(); ++it) {
2244 widget->handleInputEvent(*it->get()); 2244 widget->handleInputEvent(blink::WebCoalescedInputEvent(*it->get()));
2245 } 2245 }
2246 } 2246 }
2247 2247
2248 bool PepperPluginInstanceImpl::SimulateIMEEvent( 2248 bool PepperPluginInstanceImpl::SimulateIMEEvent(
2249 const InputEventData& input_event) { 2249 const InputEventData& input_event) {
2250 switch (input_event.event_type) { 2250 switch (input_event.event_type) {
2251 case PP_INPUTEVENT_TYPE_IME_COMPOSITION_START: 2251 case PP_INPUTEVENT_TYPE_IME_COMPOSITION_START:
2252 case PP_INPUTEVENT_TYPE_IME_COMPOSITION_UPDATE: 2252 case PP_INPUTEVENT_TYPE_IME_COMPOSITION_UPDATE:
2253 SimulateImeSetCompositionEvent(input_event); 2253 SimulateImeSetCompositionEvent(input_event);
2254 break; 2254 break;
(...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after
3465 const cc::TextureMailbox& mailbox) const { 3465 const cc::TextureMailbox& mailbox) const {
3466 auto it = 3466 auto it =
3467 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(), 3467 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(),
3468 [&mailbox](const TextureMailboxRefCount& ref_count) { 3468 [&mailbox](const TextureMailboxRefCount& ref_count) {
3469 return ref_count.first.mailbox() == mailbox.mailbox(); 3469 return ref_count.first.mailbox() == mailbox.mailbox();
3470 }); 3470 });
3471 return it != texture_ref_counts_.end(); 3471 return it != texture_ref_counts_.end();
3472 } 3472 }
3473 3473
3474 } // namespace content 3474 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698