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

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

Issue 1341563002: Plugin Power Saver: Improve origin handling esp. with OOPIF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 : frame_(NULL), 709 : frame_(NULL),
710 is_subframe_(false), 710 is_subframe_(false),
711 is_local_root_(false), 711 is_local_root_(false),
712 render_view_(params.render_view->AsWeakPtr()), 712 render_view_(params.render_view->AsWeakPtr()),
713 routing_id_(params.routing_id), 713 routing_id_(params.routing_id),
714 is_swapped_out_(false), 714 is_swapped_out_(false),
715 render_frame_proxy_(NULL), 715 render_frame_proxy_(NULL),
716 is_detaching_(false), 716 is_detaching_(false),
717 proxy_routing_id_(MSG_ROUTING_NONE), 717 proxy_routing_id_(MSG_ROUTING_NONE),
718 #if defined(ENABLE_PLUGINS) 718 #if defined(ENABLE_PLUGINS)
719 plugin_power_saver_helper_(NULL), 719 plugin_power_saver_helper_(nullptr),
720 #endif 720 #endif
721 cookie_jar_(this), 721 cookie_jar_(this),
722 selection_text_offset_(0), 722 selection_text_offset_(0),
723 selection_range_(gfx::Range::InvalidRange()), 723 selection_range_(gfx::Range::InvalidRange()),
724 handling_select_range_(false), 724 handling_select_range_(false),
725 notification_permission_dispatcher_(NULL), 725 notification_permission_dispatcher_(NULL),
726 web_user_media_client_(NULL), 726 web_user_media_client_(NULL),
727 media_permission_dispatcher_(NULL), 727 media_permission_dispatcher_(NULL),
728 midi_dispatcher_(NULL), 728 midi_dispatcher_(NULL),
729 #if defined(OS_ANDROID) 729 #if defined(OS_ANDROID)
(...skipping 23 matching lines...) Expand all
753 753
754 render_view_->RegisterRenderFrame(this); 754 render_view_->RegisterRenderFrame(this);
755 755
756 // Everything below subclasses RenderFrameObserver and is automatically 756 // Everything below subclasses RenderFrameObserver and is automatically
757 // deleted when the RenderFrame gets deleted. 757 // deleted when the RenderFrame gets deleted.
758 #if defined(OS_ANDROID) 758 #if defined(OS_ANDROID)
759 new GinJavaBridgeDispatcher(this); 759 new GinJavaBridgeDispatcher(this);
760 #endif 760 #endif
761 761
762 #if defined(ENABLE_PLUGINS) 762 #if defined(ENABLE_PLUGINS)
763 // Manages its own lifetime.
763 plugin_power_saver_helper_ = new PluginPowerSaverHelper(this); 764 plugin_power_saver_helper_ = new PluginPowerSaverHelper(this);
764 #endif 765 #endif
765 766
766 manifest_manager_ = new ManifestManager(this); 767 manifest_manager_ = new ManifestManager(this);
767 768
768 GetServiceRegistry()->ConnectToRemoteService(mojo::GetProxy(&mojo_shell_)); 769 GetServiceRegistry()->ConnectToRemoteService(mojo::GetProxy(&mojo_shell_));
769 } 770 }
770 771
771 RenderFrameImpl::~RenderFrameImpl() { 772 RenderFrameImpl::~RenderFrameImpl() {
772 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, RenderFrameGone()); 773 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, RenderFrameGone());
(...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after
1954 void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) { 1955 void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) {
1955 OnJavaScriptExecuteRequest(javascript, 0, false); 1956 OnJavaScriptExecuteRequest(javascript, 0, false);
1956 } 1957 }
1957 1958
1958 ServiceRegistry* RenderFrameImpl::GetServiceRegistry() { 1959 ServiceRegistry* RenderFrameImpl::GetServiceRegistry() {
1959 return &service_registry_; 1960 return &service_registry_;
1960 } 1961 }
1961 1962
1962 #if defined(ENABLE_PLUGINS) 1963 #if defined(ENABLE_PLUGINS)
1963 void RenderFrameImpl::RegisterPeripheralPlugin( 1964 void RenderFrameImpl::RegisterPeripheralPlugin(
1964 const GURL& content_origin, 1965 const url::Origin& content_origin,
1965 const base::Closure& unthrottle_callback) { 1966 const base::Closure& unthrottle_callback) {
1966 return plugin_power_saver_helper_->RegisterPeripheralPlugin( 1967 return plugin_power_saver_helper_->RegisterPeripheralPlugin(
1967 content_origin, unthrottle_callback); 1968 content_origin, unthrottle_callback);
1968 } 1969 }
1969 #endif // defined(ENABLE_PLUGINS) 1970 #endif // defined(ENABLE_PLUGINS)
1970 1971
1971 bool RenderFrameImpl::IsFTPDirectoryListing() { 1972 bool RenderFrameImpl::IsFTPDirectoryListing() {
1972 WebURLResponseExtraDataImpl* extra_data = 1973 WebURLResponseExtraDataImpl* extra_data =
1973 GetExtraDataFromResponse(frame_->dataSource()->response()); 1974 GetExtraDataFromResponse(frame_->dataSource()->response());
1974 return extra_data ? extra_data->is_ftp_directory_listing() : false; 1975 return extra_data ? extra_data->is_ftp_directory_listing() : false;
(...skipping 3137 matching lines...) Expand 10 before | Expand all | Expand 10 after
5112 mojo::ServiceProviderPtr service_provider; 5113 mojo::ServiceProviderPtr service_provider;
5113 mojo::URLRequestPtr request(mojo::URLRequest::New()); 5114 mojo::URLRequestPtr request(mojo::URLRequest::New());
5114 request->url = mojo::String::From(url); 5115 request->url = mojo::String::From(url);
5115 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), 5116 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider),
5116 nullptr, nullptr, 5117 nullptr, nullptr,
5117 base::Bind(&OnGotContentHandlerID)); 5118 base::Bind(&OnGotContentHandlerID));
5118 return service_provider.Pass(); 5119 return service_provider.Pass();
5119 } 5120 }
5120 5121
5121 } // namespace content 5122 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698