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_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 last_page_id_sent_to_browser_(-1), | 401 last_page_id_sent_to_browser_(-1), |
402 next_page_id_(next_page_id), | 402 next_page_id_(next_page_id), |
403 history_list_offset_(-1), | 403 history_list_offset_(-1), |
404 history_list_length_(0), | 404 history_list_length_(0), |
405 target_url_status_(TARGET_NONE), | 405 target_url_status_(TARGET_NONE), |
406 selection_text_offset_(0), | 406 selection_text_offset_(0), |
407 cached_is_main_frame_pinned_to_left_(false), | 407 cached_is_main_frame_pinned_to_left_(false), |
408 cached_is_main_frame_pinned_to_right_(false), | 408 cached_is_main_frame_pinned_to_right_(false), |
409 cached_has_main_frame_horizontal_scrollbar_(false), | 409 cached_has_main_frame_horizontal_scrollbar_(false), |
410 cached_has_main_frame_vertical_scrollbar_(false), | 410 cached_has_main_frame_vertical_scrollbar_(false), |
| 411 context_has_swapbuffers_complete_callback_(false), |
| 412 queried_for_swapbuffers_complete_callback_(false), |
411 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), | 413 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), |
412 geolocation_dispatcher_(NULL), | 414 geolocation_dispatcher_(NULL), |
413 speech_input_dispatcher_(NULL), | 415 speech_input_dispatcher_(NULL), |
414 device_orientation_dispatcher_(NULL), | 416 device_orientation_dispatcher_(NULL), |
415 media_stream_dispatcher_(NULL), | 417 media_stream_dispatcher_(NULL), |
416 p2p_socket_dispatcher_(NULL), | 418 p2p_socket_dispatcher_(NULL), |
417 devtools_agent_(NULL), | 419 devtools_agent_(NULL), |
418 renderer_accessibility_(NULL), | 420 renderer_accessibility_(NULL), |
419 mouse_lock_dispatcher_(NULL), | 421 mouse_lock_dispatcher_(NULL), |
420 session_storage_namespace_id_(session_storage_namespace_id), | 422 session_storage_namespace_id_(session_storage_namespace_id), |
(...skipping 4092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4513 plugin_it != plugin_delegates_.end(); ++plugin_it) { | 4515 plugin_it != plugin_delegates_.end(); ++plugin_it) { |
4514 (*plugin_it)->SetContainerVisibility(true); | 4516 (*plugin_it)->SetContainerVisibility(true); |
4515 } | 4517 } |
4516 #endif // OS_MACOSX | 4518 #endif // OS_MACOSX |
4517 } | 4519 } |
4518 | 4520 |
4519 bool RenderViewImpl::SupportsAsynchronousSwapBuffers() { | 4521 bool RenderViewImpl::SupportsAsynchronousSwapBuffers() { |
4520 if (WebWidgetHandlesCompositorScheduling()) | 4522 if (WebWidgetHandlesCompositorScheduling()) |
4521 return false; | 4523 return false; |
4522 | 4524 |
| 4525 if (queried_for_swapbuffers_complete_callback_) |
| 4526 return context_has_swapbuffers_complete_callback_; |
| 4527 |
| 4528 queried_for_swapbuffers_complete_callback_ = true; |
| 4529 |
4523 WebKit::WebGraphicsContext3D* context = webview()->graphicsContext3D(); | 4530 WebKit::WebGraphicsContext3D* context = webview()->graphicsContext3D(); |
4524 if (!context) | 4531 if (context && context->makeContextCurrent()) { |
4525 return false; | 4532 std::string extensions(context->getRequestableExtensionsCHROMIUM().utf8()); |
4526 if (!context->makeContextCurrent()) | 4533 context_has_swapbuffers_complete_callback_ = |
4527 return false; | 4534 extensions.find("GL_CHROMIUM_swapbuffers_complete_callback") |
4528 std::string extensions(context->getRequestableExtensionsCHROMIUM().utf8()); | 4535 != std::string::npos; |
4529 return extensions.find("GL_CHROMIUM_swapbuffers_complete_callback") != | 4536 } |
4530 std::string::npos; | 4537 |
| 4538 return context_has_swapbuffers_complete_callback_; |
4531 } | 4539 } |
4532 | 4540 |
4533 void RenderViewImpl::OnSetFocus(bool enable) { | 4541 void RenderViewImpl::OnSetFocus(bool enable) { |
4534 RenderWidget::OnSetFocus(enable); | 4542 RenderWidget::OnSetFocus(enable); |
4535 | 4543 |
4536 if (webview() && webview()->isActive()) { | 4544 if (webview() && webview()->isActive()) { |
4537 // Notify all NPAPI plugins. | 4545 // Notify all NPAPI plugins. |
4538 std::set<WebPluginDelegateProxy*>::iterator plugin_it; | 4546 std::set<WebPluginDelegateProxy*>::iterator plugin_it; |
4539 for (plugin_it = plugin_delegates_.begin(); | 4547 for (plugin_it = plugin_delegates_.begin(); |
4540 plugin_it != plugin_delegates_.end(); ++plugin_it) { | 4548 plugin_it != plugin_delegates_.end(); ++plugin_it) { |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4975 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 4983 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
4976 return !!RenderThreadImpl::current()->compositor_thread(); | 4984 return !!RenderThreadImpl::current()->compositor_thread(); |
4977 } | 4985 } |
4978 | 4986 |
4979 void RenderViewImpl::OnJavaBridgeInit() { | 4987 void RenderViewImpl::OnJavaBridgeInit() { |
4980 DCHECK(!java_bridge_dispatcher_.get()); | 4988 DCHECK(!java_bridge_dispatcher_.get()); |
4981 #if defined(ENABLE_JAVA_BRIDGE) | 4989 #if defined(ENABLE_JAVA_BRIDGE) |
4982 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 4990 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
4983 #endif | 4991 #endif |
4984 } | 4992 } |
OLD | NEW |