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

Side by Side Diff: content/renderer/browser_plugin/browser_plugin.cc

Issue 11967013: Fixes issues when switching between software and compositing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 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/browser_plugin/browser_plugin.h" 5 #include "content/renderer/browser_plugin/browser_plugin.h"
6 6
7 #include "base/json/json_string_value_serializer.h" 7 #include "base/json/json_string_value_serializer.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 container_ = container; 801 container_ = container;
802 container_->setWantsWheelEvents(true); 802 container_->setWantsWheelEvents(true);
803 return true; 803 return true;
804 } 804 }
805 805
806 void BrowserPlugin::EnableCompositing(bool enable) { 806 void BrowserPlugin::EnableCompositing(bool enable) {
807 if (compositing_enabled_ == enable) 807 if (compositing_enabled_ == enable)
808 return; 808 return;
809 809
810 if (enable && !compositing_helper_) { 810 if (enable && !compositing_helper_) {
811 compositing_helper_.reset(new BrowserPluginCompositingHelper( 811 compositing_helper_ = new BrowserPluginCompositingHelper(
812 container_, 812 container_,
813 render_view_routing_id_)); 813 browser_plugin_manager(),
814 render_view_routing_id_);
814 } 815 }
815 816
816 compositing_helper_->EnableCompositing(enable); 817 compositing_helper_->EnableCompositing(enable);
817 compositing_enabled_ = enable; 818 compositing_enabled_ = enable;
818 } 819 }
819 820
820 void BrowserPlugin::destroy() { 821 void BrowserPlugin::destroy() {
821 // The BrowserPlugin's WebPluginContainer is deleted immediately after this 822 // The BrowserPlugin's WebPluginContainer is deleted immediately after this
822 // call returns, so let's not keep a reference to it around. 823 // call returns, so let's not keep a reference to it around.
823 container_ = NULL; 824 container_ = NULL;
824 compositing_helper_.reset(); 825 if (compositing_helper_)
826 compositing_helper_->OnContainerDestroy();
825 MessageLoop::current()->DeleteSoon(FROM_HERE, this); 827 MessageLoop::current()->DeleteSoon(FROM_HERE, this);
826 } 828 }
827 829
828 NPObject* BrowserPlugin::scriptableObject() { 830 NPObject* BrowserPlugin::scriptableObject() {
829 NPObject* browser_plugin_np_object(bindings_->np_object()); 831 NPObject* browser_plugin_np_object(bindings_->np_object());
830 // The object is expected to be retained before it is returned. 832 // The object is expected to be retained before it is returned.
831 WebKit::WebBindings::retainObject(browser_plugin_np_object); 833 WebKit::WebBindings::retainObject(browser_plugin_np_object);
832 return browser_plugin_np_object; 834 return browser_plugin_np_object;
833 } 835 }
834 836
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 void* notify_data) { 1092 void* notify_data) {
1091 } 1093 }
1092 1094
1093 void BrowserPlugin::didFailLoadingFrameRequest( 1095 void BrowserPlugin::didFailLoadingFrameRequest(
1094 const WebKit::WebURL& url, 1096 const WebKit::WebURL& url,
1095 void* notify_data, 1097 void* notify_data,
1096 const WebKit::WebURLError& error) { 1098 const WebKit::WebURLError& error) {
1097 } 1099 }
1098 1100
1099 } // namespace content 1101 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin.h ('k') | content/renderer/browser_plugin/browser_plugin_compositing_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698