OLD | NEW |
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 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 : frame_(NULL), | 708 : frame_(NULL), |
709 is_subframe_(false), | 709 is_subframe_(false), |
710 is_local_root_(false), | 710 is_local_root_(false), |
711 render_view_(params.render_view->AsWeakPtr()), | 711 render_view_(params.render_view->AsWeakPtr()), |
712 routing_id_(params.routing_id), | 712 routing_id_(params.routing_id), |
713 is_swapped_out_(false), | 713 is_swapped_out_(false), |
714 render_frame_proxy_(NULL), | 714 render_frame_proxy_(NULL), |
715 is_detaching_(false), | 715 is_detaching_(false), |
716 proxy_routing_id_(MSG_ROUTING_NONE), | 716 proxy_routing_id_(MSG_ROUTING_NONE), |
717 #if defined(ENABLE_PLUGINS) | 717 #if defined(ENABLE_PLUGINS) |
718 plugin_power_saver_helper_(NULL), | 718 plugin_power_saver_helper_(nullptr), |
719 #endif | 719 #endif |
720 cookie_jar_(this), | 720 cookie_jar_(this), |
721 selection_text_offset_(0), | 721 selection_text_offset_(0), |
722 selection_range_(gfx::Range::InvalidRange()), | 722 selection_range_(gfx::Range::InvalidRange()), |
723 handling_select_range_(false), | 723 handling_select_range_(false), |
724 notification_permission_dispatcher_(NULL), | 724 notification_permission_dispatcher_(NULL), |
725 web_user_media_client_(NULL), | 725 web_user_media_client_(NULL), |
726 media_permission_dispatcher_(NULL), | 726 media_permission_dispatcher_(NULL), |
727 midi_dispatcher_(NULL), | 727 midi_dispatcher_(NULL), |
728 #if defined(OS_ANDROID) | 728 #if defined(OS_ANDROID) |
(...skipping 23 matching lines...) Expand all Loading... |
752 | 752 |
753 render_view_->RegisterRenderFrame(this); | 753 render_view_->RegisterRenderFrame(this); |
754 | 754 |
755 // Everything below subclasses RenderFrameObserver and is automatically | 755 // Everything below subclasses RenderFrameObserver and is automatically |
756 // deleted when the RenderFrame gets deleted. | 756 // deleted when the RenderFrame gets deleted. |
757 #if defined(OS_ANDROID) | 757 #if defined(OS_ANDROID) |
758 new GinJavaBridgeDispatcher(this); | 758 new GinJavaBridgeDispatcher(this); |
759 #endif | 759 #endif |
760 | 760 |
761 #if defined(ENABLE_PLUGINS) | 761 #if defined(ENABLE_PLUGINS) |
| 762 // Manages its own lifetime. |
762 plugin_power_saver_helper_ = new PluginPowerSaverHelper(this); | 763 plugin_power_saver_helper_ = new PluginPowerSaverHelper(this); |
763 #endif | 764 #endif |
764 | 765 |
765 manifest_manager_ = new ManifestManager(this); | 766 manifest_manager_ = new ManifestManager(this); |
766 | 767 |
767 GetServiceRegistry()->ConnectToRemoteService(mojo::GetProxy(&mojo_shell_)); | 768 GetServiceRegistry()->ConnectToRemoteService(mojo::GetProxy(&mojo_shell_)); |
768 } | 769 } |
769 | 770 |
770 RenderFrameImpl::~RenderFrameImpl() { | 771 RenderFrameImpl::~RenderFrameImpl() { |
771 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, RenderFrameGone()); | 772 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, RenderFrameGone()); |
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1949 void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) { | 1950 void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) { |
1950 OnJavaScriptExecuteRequest(javascript, 0, false); | 1951 OnJavaScriptExecuteRequest(javascript, 0, false); |
1951 } | 1952 } |
1952 | 1953 |
1953 ServiceRegistry* RenderFrameImpl::GetServiceRegistry() { | 1954 ServiceRegistry* RenderFrameImpl::GetServiceRegistry() { |
1954 return &service_registry_; | 1955 return &service_registry_; |
1955 } | 1956 } |
1956 | 1957 |
1957 #if defined(ENABLE_PLUGINS) | 1958 #if defined(ENABLE_PLUGINS) |
1958 void RenderFrameImpl::RegisterPeripheralPlugin( | 1959 void RenderFrameImpl::RegisterPeripheralPlugin( |
1959 const GURL& content_origin, | 1960 const url::Origin& content_origin, |
1960 const base::Closure& unthrottle_callback) { | 1961 const base::Closure& unthrottle_callback) { |
1961 return plugin_power_saver_helper_->RegisterPeripheralPlugin( | 1962 return plugin_power_saver_helper_->RegisterPeripheralPlugin( |
1962 content_origin, unthrottle_callback); | 1963 content_origin, unthrottle_callback); |
1963 } | 1964 } |
1964 #endif // defined(ENABLE_PLUGINS) | 1965 #endif // defined(ENABLE_PLUGINS) |
1965 | 1966 |
1966 bool RenderFrameImpl::IsFTPDirectoryListing() { | 1967 bool RenderFrameImpl::IsFTPDirectoryListing() { |
1967 WebURLResponseExtraDataImpl* extra_data = | 1968 WebURLResponseExtraDataImpl* extra_data = |
1968 GetExtraDataFromResponse(frame_->dataSource()->response()); | 1969 GetExtraDataFromResponse(frame_->dataSource()->response()); |
1969 return extra_data ? extra_data->is_ftp_directory_listing() : false; | 1970 return extra_data ? extra_data->is_ftp_directory_listing() : false; |
(...skipping 3142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |