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/render_widget.h" | 5 #include "content/renderer/render_widget.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/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 popup_type_(popup_type), | 219 popup_type_(popup_type), |
220 pending_window_rect_count_(0), | 220 pending_window_rect_count_(0), |
221 suppress_next_char_events_(false), | 221 suppress_next_char_events_(false), |
222 is_accelerated_compositing_active_(false), | 222 is_accelerated_compositing_active_(false), |
223 animation_update_pending_(false), | 223 animation_update_pending_(false), |
224 invalidation_task_posted_(false), | 224 invalidation_task_posted_(false), |
225 screen_info_(screen_info), | 225 screen_info_(screen_info), |
226 device_scale_factor_(screen_info_.deviceScaleFactor), | 226 device_scale_factor_(screen_info_.deviceScaleFactor), |
227 is_threaded_compositing_enabled_(false), | 227 is_threaded_compositing_enabled_(false), |
228 next_output_surface_id_(0), | 228 next_output_surface_id_(0), |
| 229 #if defined(OS_ANDROID) |
| 230 outstanding_ime_acks_(0), |
| 231 #endif |
229 weak_ptr_factory_(this) { | 232 weak_ptr_factory_(this) { |
230 if (!swapped_out) | 233 if (!swapped_out) |
231 RenderProcess::current()->AddRefProcess(); | 234 RenderProcess::current()->AddRefProcess(); |
232 DCHECK(RenderThread::Get()); | 235 DCHECK(RenderThread::Get()); |
233 has_disable_gpu_vsync_switch_ = CommandLine::ForCurrentProcess()->HasSwitch( | 236 has_disable_gpu_vsync_switch_ = CommandLine::ForCurrentProcess()->HasSwitch( |
234 switches::kDisableGpuVsync); | 237 switches::kDisableGpuVsync); |
235 is_threaded_compositing_enabled_ = | 238 is_threaded_compositing_enabled_ = |
236 CommandLine::ForCurrentProcess()->HasSwitch( | 239 CommandLine::ForCurrentProcess()->HasSwitch( |
237 switches::kEnableThreadedCompositing); | 240 switches::kEnableThreadedCompositing); |
238 | 241 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 IPC_MESSAGE_HANDLER(ViewMsg_ImeConfirmComposition, OnImeConfirmComposition) | 381 IPC_MESSAGE_HANDLER(ViewMsg_ImeConfirmComposition, OnImeConfirmComposition) |
379 IPC_MESSAGE_HANDLER(ViewMsg_PaintAtSize, OnPaintAtSize) | 382 IPC_MESSAGE_HANDLER(ViewMsg_PaintAtSize, OnPaintAtSize) |
380 IPC_MESSAGE_HANDLER(ViewMsg_Repaint, OnRepaint) | 383 IPC_MESSAGE_HANDLER(ViewMsg_Repaint, OnRepaint) |
381 IPC_MESSAGE_HANDLER(ViewMsg_SmoothScrollCompleted, OnSmoothScrollCompleted) | 384 IPC_MESSAGE_HANDLER(ViewMsg_SmoothScrollCompleted, OnSmoothScrollCompleted) |
382 IPC_MESSAGE_HANDLER(ViewMsg_SetTextDirection, OnSetTextDirection) | 385 IPC_MESSAGE_HANDLER(ViewMsg_SetTextDirection, OnSetTextDirection) |
383 IPC_MESSAGE_HANDLER(ViewMsg_Move_ACK, OnRequestMoveAck) | 386 IPC_MESSAGE_HANDLER(ViewMsg_Move_ACK, OnRequestMoveAck) |
384 IPC_MESSAGE_HANDLER(ViewMsg_UpdateScreenRects, OnUpdateScreenRects) | 387 IPC_MESSAGE_HANDLER(ViewMsg_UpdateScreenRects, OnUpdateScreenRects) |
385 #if defined(OS_ANDROID) | 388 #if defined(OS_ANDROID) |
386 IPC_MESSAGE_HANDLER(ViewMsg_ImeBatchStateChanged, OnImeBatchStateChanged) | 389 IPC_MESSAGE_HANDLER(ViewMsg_ImeBatchStateChanged, OnImeBatchStateChanged) |
387 IPC_MESSAGE_HANDLER(ViewMsg_ShowImeIfNeeded, OnShowImeIfNeeded) | 390 IPC_MESSAGE_HANDLER(ViewMsg_ShowImeIfNeeded, OnShowImeIfNeeded) |
| 391 IPC_MESSAGE_HANDLER(ViewMsg_ImeEventAck, OnImeEventAck) |
388 #endif | 392 #endif |
389 IPC_MESSAGE_HANDLER(ViewMsg_Snapshot, OnSnapshot) | 393 IPC_MESSAGE_HANDLER(ViewMsg_Snapshot, OnSnapshot) |
390 IPC_MESSAGE_HANDLER(ViewMsg_SetBrowserRenderingStats, | 394 IPC_MESSAGE_HANDLER(ViewMsg_SetBrowserRenderingStats, |
391 OnSetBrowserRenderingStats) | 395 OnSetBrowserRenderingStats) |
392 IPC_MESSAGE_UNHANDLED(handled = false) | 396 IPC_MESSAGE_UNHANDLED(handled = false) |
393 IPC_END_MESSAGE_MAP() | 397 IPC_END_MESSAGE_MAP() |
394 return handled; | 398 return handled; |
395 } | 399 } |
396 | 400 |
397 bool RenderWidget::Send(IPC::Message* message) { | 401 bool RenderWidget::Send(IPC::Message* message) { |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 } | 884 } |
881 pending_input_event_ack_.reset(response); | 885 pending_input_event_ack_.reset(response); |
882 } else { | 886 } else { |
883 Send(response); | 887 Send(response); |
884 } | 888 } |
885 | 889 |
886 #if defined(OS_ANDROID) | 890 #if defined(OS_ANDROID) |
887 // Allow the IME to be shown when the focus changes as a consequence | 891 // Allow the IME to be shown when the focus changes as a consequence |
888 // of a processed touch end event. | 892 // of a processed touch end event. |
889 if (input_event->type == WebInputEvent::TouchEnd && processed) | 893 if (input_event->type == WebInputEvent::TouchEnd && processed) |
890 UpdateTextInputState(SHOW_IME_IF_NEEDED); | 894 UpdateTextInputState(SHOW_IME_IF_NEEDED, SEND_IME_ACK); |
891 #endif | 895 #endif |
892 | 896 |
893 handling_input_event_ = false; | 897 handling_input_event_ = false; |
894 | 898 |
895 if (!prevent_default) { | 899 if (!prevent_default) { |
896 if (WebInputEvent::isKeyboardEventType(input_event->type)) | 900 if (WebInputEvent::isKeyboardEventType(input_event->type)) |
897 DidHandleKeyEvent(); | 901 DidHandleKeyEvent(); |
898 if (WebInputEvent::isMouseEventType(input_event->type)) | 902 if (WebInputEvent::isMouseEventType(input_event->type)) |
899 DidHandleMouseEvent(*(static_cast<const WebMouseEvent*>(input_event))); | 903 DidHandleMouseEvent(*(static_cast<const WebMouseEvent*>(input_event))); |
900 if (WebInputEvent::isTouchEventType(input_event->type)) | 904 if (WebInputEvent::isTouchEventType(input_event->type)) |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1570 void RenderWidget::willBeginCompositorFrame() { | 1574 void RenderWidget::willBeginCompositorFrame() { |
1571 TRACE_EVENT0("gpu", "RenderWidget::willBeginCompositorFrame"); | 1575 TRACE_EVENT0("gpu", "RenderWidget::willBeginCompositorFrame"); |
1572 | 1576 |
1573 DCHECK(RenderThreadImpl::current()->compositor_message_loop_proxy().get()); | 1577 DCHECK(RenderThreadImpl::current()->compositor_message_loop_proxy().get()); |
1574 | 1578 |
1575 // The following two can result in further layout and possibly | 1579 // The following two can result in further layout and possibly |
1576 // enable GPU acceleration so they need to be called before any painting | 1580 // enable GPU acceleration so they need to be called before any painting |
1577 // is done. | 1581 // is done. |
1578 UpdateTextInputType(); | 1582 UpdateTextInputType(); |
1579 #if defined(OS_ANDROID) | 1583 #if defined(OS_ANDROID) |
1580 UpdateTextInputState(DO_NOT_SHOW_IME); | 1584 UpdateTextInputState(DO_NOT_SHOW_IME, SEND_IME_ACK); |
1581 #endif | 1585 #endif |
1582 UpdateSelectionBounds(); | 1586 UpdateSelectionBounds(); |
1583 | 1587 |
1584 WillInitiatePaint(); | 1588 WillInitiatePaint(); |
1585 } | 1589 } |
1586 | 1590 |
1587 void RenderWidget::didBecomeReadyForAdditionalInput() { | 1591 void RenderWidget::didBecomeReadyForAdditionalInput() { |
1588 TRACE_EVENT0("renderer", "RenderWidget::didBecomeReadyForAdditionalInput"); | 1592 TRACE_EVENT0("renderer", "RenderWidget::didBecomeReadyForAdditionalInput"); |
1589 if (pending_input_event_ack_) | 1593 if (pending_input_event_ack_) |
1590 Send(pending_input_event_ack_.release()); | 1594 Send(pending_input_event_ack_.release()); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1795 // To prevent this renderer process from sending unnecessary IPC messages to | 1799 // To prevent this renderer process from sending unnecessary IPC messages to |
1796 // a browser process, we permit the renderer process to send IPC messages | 1800 // a browser process, we permit the renderer process to send IPC messages |
1797 // only during the input method attached to the browser process is active. | 1801 // only during the input method attached to the browser process is active. |
1798 input_method_is_active_ = is_active; | 1802 input_method_is_active_ = is_active; |
1799 } | 1803 } |
1800 | 1804 |
1801 void RenderWidget::OnImeSetComposition( | 1805 void RenderWidget::OnImeSetComposition( |
1802 const string16& text, | 1806 const string16& text, |
1803 const std::vector<WebCompositionUnderline>& underlines, | 1807 const std::vector<WebCompositionUnderline>& underlines, |
1804 int selection_start, int selection_end) { | 1808 int selection_start, int selection_end) { |
1805 if (!webwidget_) | 1809 if (!ShouldHandleImeEvent()) |
1806 return; | 1810 return; |
1807 ImeEventGuard guard(this); | 1811 ImeEventGuard guard(this); |
1808 if (!webwidget_->setComposition( | 1812 if (!webwidget_->setComposition( |
1809 text, WebVector<WebCompositionUnderline>(underlines), | 1813 text, WebVector<WebCompositionUnderline>(underlines), |
1810 selection_start, selection_end)) { | 1814 selection_start, selection_end)) { |
1811 // If we failed to set the composition text, then we need to let the browser | 1815 // If we failed to set the composition text, then we need to let the browser |
1812 // process to cancel the input method's ongoing composition session, to make | 1816 // process to cancel the input method's ongoing composition session, to make |
1813 // sure we are in a consistent state. | 1817 // sure we are in a consistent state. |
1814 Send(new ViewHostMsg_ImeCancelComposition(routing_id())); | 1818 Send(new ViewHostMsg_ImeCancelComposition(routing_id())); |
1815 } | 1819 } |
1816 #if defined(OS_MACOSX) || defined(OS_WIN) || defined(USE_AURA) | 1820 #if defined(OS_MACOSX) || defined(OS_WIN) || defined(USE_AURA) |
1817 UpdateCompositionInfo(true); | 1821 UpdateCompositionInfo(true); |
1818 #endif | 1822 #endif |
1819 } | 1823 } |
1820 | 1824 |
1821 void RenderWidget::OnImeConfirmComposition(const string16& text, | 1825 void RenderWidget::OnImeConfirmComposition(const string16& text, |
1822 const ui::Range& replacement_range, | 1826 const ui::Range& replacement_range, |
1823 bool keep_selection) { | 1827 bool keep_selection) { |
1824 if (!webwidget_) | 1828 if (!ShouldHandleImeEvent()) |
1825 return; | 1829 return; |
1826 ImeEventGuard guard(this); | 1830 ImeEventGuard guard(this); |
1827 handling_input_event_ = true; | 1831 handling_input_event_ = true; |
1828 if (text.length()) | 1832 if (text.length()) |
1829 webwidget_->confirmComposition(text); | 1833 webwidget_->confirmComposition(text); |
1830 else if (keep_selection) | 1834 else if (keep_selection) |
1831 webwidget_->confirmComposition(WebWidget::KeepSelection); | 1835 webwidget_->confirmComposition(WebWidget::KeepSelection); |
1832 else | 1836 else |
1833 webwidget_->confirmComposition(WebWidget::DoNotKeepSelection); | 1837 webwidget_->confirmComposition(WebWidget::DoNotKeepSelection); |
1834 handling_input_event_ = false; | 1838 handling_input_event_ = false; |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1997 window_screen_rect_ = window_screen_rect; | 2001 window_screen_rect_ = window_screen_rect; |
1998 Send(new ViewHostMsg_UpdateScreenRects_ACK(routing_id())); | 2002 Send(new ViewHostMsg_UpdateScreenRects_ACK(routing_id())); |
1999 } | 2003 } |
2000 | 2004 |
2001 #if defined(OS_ANDROID) | 2005 #if defined(OS_ANDROID) |
2002 void RenderWidget::OnImeBatchStateChanged(bool is_begin) { | 2006 void RenderWidget::OnImeBatchStateChanged(bool is_begin) { |
2003 Send(new ViewHostMsg_ImeBatchStateChanged_ACK(routing_id(), is_begin)); | 2007 Send(new ViewHostMsg_ImeBatchStateChanged_ACK(routing_id(), is_begin)); |
2004 } | 2008 } |
2005 | 2009 |
2006 void RenderWidget::OnShowImeIfNeeded() { | 2010 void RenderWidget::OnShowImeIfNeeded() { |
2007 UpdateTextInputState(SHOW_IME_IF_NEEDED); | 2011 UpdateTextInputState(SHOW_IME_IF_NEEDED, SEND_IME_ACK); |
| 2012 } |
| 2013 |
| 2014 void RenderWidget::IncrementOutstandingImeEventAcks() { |
| 2015 ++outstanding_ime_acks_; |
| 2016 } |
| 2017 |
| 2018 void RenderWidget::OnImeEventAck() { |
| 2019 --outstanding_ime_acks_; |
| 2020 DCHECK(outstanding_ime_acks_ >= 0); |
2008 } | 2021 } |
2009 #endif | 2022 #endif |
2010 | 2023 |
| 2024 bool RenderWidget::ShouldHandleImeEvent() { |
| 2025 #if defined(OS_ANDROID) |
| 2026 return !!webwidget_ && outstanding_ime_acks_ == 0; |
| 2027 #else |
| 2028 return !!webwidget_; |
| 2029 #endif |
| 2030 } |
| 2031 |
2011 void RenderWidget::SetDeviceScaleFactor(float device_scale_factor) { | 2032 void RenderWidget::SetDeviceScaleFactor(float device_scale_factor) { |
2012 if (device_scale_factor_ == device_scale_factor) | 2033 if (device_scale_factor_ == device_scale_factor) |
2013 return; | 2034 return; |
2014 | 2035 |
2015 device_scale_factor_ = device_scale_factor; | 2036 device_scale_factor_ = device_scale_factor; |
2016 | 2037 |
2017 if (!is_accelerated_compositing_active_) { | 2038 if (!is_accelerated_compositing_active_) { |
2018 didInvalidateRect(gfx::Rect(size_.width(), size_.height())); | 2039 didInvalidateRect(gfx::Rect(size_.width(), size_.height())); |
2019 } else { | 2040 } else { |
2020 scheduleComposite(); | 2041 scheduleComposite(); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2113 } | 2134 } |
2114 | 2135 |
2115 void RenderWidget::FinishHandlingImeEvent() { | 2136 void RenderWidget::FinishHandlingImeEvent() { |
2116 DCHECK(handling_ime_event_); | 2137 DCHECK(handling_ime_event_); |
2117 handling_ime_event_ = false; | 2138 handling_ime_event_ = false; |
2118 // While handling an ime event, text input state and selection bounds updates | 2139 // While handling an ime event, text input state and selection bounds updates |
2119 // are ignored. These must explicitly be updated once finished handling the | 2140 // are ignored. These must explicitly be updated once finished handling the |
2120 // ime event. | 2141 // ime event. |
2121 UpdateSelectionBounds(); | 2142 UpdateSelectionBounds(); |
2122 #if defined(OS_ANDROID) | 2143 #if defined(OS_ANDROID) |
2123 UpdateTextInputState(DO_NOT_SHOW_IME); | 2144 UpdateTextInputState(DO_NOT_SHOW_IME, NO_IME_ACK); |
2124 #endif | 2145 #endif |
2125 } | 2146 } |
2126 | 2147 |
2127 void RenderWidget::UpdateTextInputType() { | 2148 void RenderWidget::UpdateTextInputType() { |
2128 if (!input_method_is_active_) | 2149 if (!input_method_is_active_) |
2129 return; | 2150 return; |
2130 | 2151 |
2131 ui::TextInputType new_type = GetTextInputType(); | 2152 ui::TextInputType new_type = GetTextInputType(); |
2132 if (IsDateTimeInput(new_type)) | 2153 if (IsDateTimeInput(new_type)) |
2133 return; // Not considered as a text input field in WebKit/Chromium. | 2154 return; // Not considered as a text input field in WebKit/Chromium. |
(...skipping 12 matching lines...) Expand all Loading... |
2146 new_type, | 2167 new_type, |
2147 new_can_compose_inline, | 2168 new_can_compose_inline, |
2148 new_mode)); | 2169 new_mode)); |
2149 text_input_type_ = new_type; | 2170 text_input_type_ = new_type; |
2150 can_compose_inline_ = new_can_compose_inline; | 2171 can_compose_inline_ = new_can_compose_inline; |
2151 text_input_mode_ = new_mode; | 2172 text_input_mode_ = new_mode; |
2152 } | 2173 } |
2153 } | 2174 } |
2154 | 2175 |
2155 #if defined(OS_ANDROID) | 2176 #if defined(OS_ANDROID) |
2156 void RenderWidget::UpdateTextInputState(ShowIme show_ime) { | 2177 void RenderWidget::UpdateTextInputState(ShowIme show_ime, ImeAck imeAck) { |
2157 if (handling_ime_event_) | 2178 if (handling_ime_event_) |
2158 return; | 2179 return; |
2159 bool show_ime_if_needed = (show_ime == SHOW_IME_IF_NEEDED); | 2180 bool show_ime_if_needed = (show_ime == SHOW_IME_IF_NEEDED); |
2160 if (!show_ime_if_needed && !input_method_is_active_) | 2181 if (!show_ime_if_needed && !input_method_is_active_) |
2161 return; | 2182 return; |
2162 ui::TextInputType new_type = GetTextInputType(); | 2183 ui::TextInputType new_type = GetTextInputType(); |
2163 if (IsDateTimeInput(new_type)) | 2184 if (IsDateTimeInput(new_type)) |
2164 return; // Not considered as a text input field in WebKit/Chromium. | 2185 return; // Not considered as a text input field in WebKit/Chromium. |
2165 | 2186 |
2166 WebKit::WebTextInputInfo new_info; | 2187 WebKit::WebTextInputInfo new_info; |
2167 if (webwidget_) | 2188 if (webwidget_) |
2168 new_info = webwidget_->textInputInfo(); | 2189 new_info = webwidget_->textInputInfo(); |
2169 | 2190 |
2170 bool new_can_compose_inline = CanComposeInline(); | 2191 bool new_can_compose_inline = CanComposeInline(); |
2171 | 2192 |
2172 // Only sends text input params if they are changed or if the ime should be | 2193 // Only sends text input params if they are changed or if the ime should be |
2173 // shown. | 2194 // shown. |
2174 if (show_ime_if_needed || (text_input_type_ != new_type | 2195 if (show_ime_if_needed || (text_input_type_ != new_type |
2175 || text_input_info_ != new_info | 2196 || text_input_info_ != new_info |
2176 || can_compose_inline_ != new_can_compose_inline)) { | 2197 || can_compose_inline_ != new_can_compose_inline)) { |
2177 ViewHostMsg_TextInputState_Params p; | 2198 ViewHostMsg_TextInputState_Params p; |
2178 p.type = new_type; | 2199 p.type = new_type; |
2179 p.value = new_info.value.utf8(); | 2200 p.value = new_info.value.utf8(); |
2180 p.selection_start = new_info.selectionStart; | 2201 p.selection_start = new_info.selectionStart; |
2181 p.selection_end = new_info.selectionEnd; | 2202 p.selection_end = new_info.selectionEnd; |
2182 p.composition_start = new_info.compositionStart; | 2203 p.composition_start = new_info.compositionStart; |
2183 p.composition_end = new_info.compositionEnd; | 2204 p.composition_end = new_info.compositionEnd; |
2184 p.can_compose_inline = new_can_compose_inline; | 2205 p.can_compose_inline = new_can_compose_inline; |
2185 p.show_ime_if_needed = show_ime_if_needed; | 2206 p.show_ime_if_needed = show_ime_if_needed; |
| 2207 p.require_ack = imeAck == SEND_IME_ACK; |
| 2208 if (p.require_ack) |
| 2209 IncrementOutstandingImeEventAcks(); |
2186 Send(new ViewHostMsg_TextInputStateChanged(routing_id(), p)); | 2210 Send(new ViewHostMsg_TextInputStateChanged(routing_id(), p)); |
2187 | 2211 |
2188 text_input_info_ = new_info; | 2212 text_input_info_ = new_info; |
2189 text_input_type_ = new_type; | 2213 text_input_type_ = new_type; |
2190 can_compose_inline_ = new_can_compose_inline; | 2214 can_compose_inline_ = new_can_compose_inline; |
2191 } | 2215 } |
2192 } | 2216 } |
2193 #endif | 2217 #endif |
2194 | 2218 |
2195 void RenderWidget::GetSelectionBounds(gfx::Rect* focus, gfx::Rect* anchor) { | 2219 void RenderWidget::GetSelectionBounds(gfx::Rect* focus, gfx::Rect* anchor) { |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2356 } | 2380 } |
2357 | 2381 |
2358 void RenderWidget::didHandleGestureEvent( | 2382 void RenderWidget::didHandleGestureEvent( |
2359 const WebGestureEvent& event, | 2383 const WebGestureEvent& event, |
2360 bool event_cancelled) { | 2384 bool event_cancelled) { |
2361 #if defined(OS_ANDROID) | 2385 #if defined(OS_ANDROID) |
2362 if (event_cancelled) | 2386 if (event_cancelled) |
2363 return; | 2387 return; |
2364 if (event.type == WebInputEvent::GestureTap || | 2388 if (event.type == WebInputEvent::GestureTap || |
2365 event.type == WebInputEvent::GestureLongPress) { | 2389 event.type == WebInputEvent::GestureLongPress) { |
2366 UpdateTextInputState(SHOW_IME_IF_NEEDED); | 2390 UpdateTextInputState(SHOW_IME_IF_NEEDED, SEND_IME_ACK); |
2367 } | 2391 } |
2368 #endif | 2392 #endif |
2369 } | 2393 } |
2370 | 2394 |
2371 void RenderWidget::SchedulePluginMove(const WebPluginGeometry& move) { | 2395 void RenderWidget::SchedulePluginMove(const WebPluginGeometry& move) { |
2372 size_t i = 0; | 2396 size_t i = 0; |
2373 for (; i < plugin_window_moves_.size(); ++i) { | 2397 for (; i < plugin_window_moves_.size(); ++i) { |
2374 if (plugin_window_moves_[i].window == move.window) { | 2398 if (plugin_window_moves_[i].window == move.window) { |
2375 if (move.rects_valid) { | 2399 if (move.rects_valid) { |
2376 plugin_window_moves_[i] = move; | 2400 plugin_window_moves_[i] = move; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2483 | 2507 |
2484 if (!context->InitializeWithDefaultBufferSizes( | 2508 if (!context->InitializeWithDefaultBufferSizes( |
2485 attributes, | 2509 attributes, |
2486 false /* bind generates resources */, | 2510 false /* bind generates resources */, |
2487 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)
) | 2511 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)
) |
2488 return NULL; | 2512 return NULL; |
2489 return context.release(); | 2513 return context.release(); |
2490 } | 2514 } |
2491 | 2515 |
2492 } // namespace content | 2516 } // namespace content |
OLD | NEW |