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

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

Issue 184873004: Update resource requests to remove redundant frame ID. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initial patch Created 6 years, 9 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 | Annotate | Revision Log
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/command_line.h" 10 #include "base/command_line.h"
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 848
849 void RenderFrameImpl::CancelContextMenu(int request_id) { 849 void RenderFrameImpl::CancelContextMenu(int request_id) {
850 DCHECK(pending_context_menus_.Lookup(request_id)); 850 DCHECK(pending_context_menus_.Lookup(request_id));
851 pending_context_menus_.Remove(request_id); 851 pending_context_menus_.Remove(request_id);
852 } 852 }
853 853
854 blink::WebPlugin* RenderFrameImpl::CreatePlugin( 854 blink::WebPlugin* RenderFrameImpl::CreatePlugin(
855 blink::WebFrame* frame, 855 blink::WebFrame* frame,
856 const WebPluginInfo& info, 856 const WebPluginInfo& info,
857 const blink::WebPluginParams& params) { 857 const blink::WebPluginParams& params) {
858 // TODO(creis): |frame| is different from |frame_| here. This seems wrong. 858 DCHECK(!frame_ || frame_ == frame);
Charlie Reis 2014/02/28 23:26:49 Daniel: You're right that these two {C|c}reatePlug
dcheng 2014/02/28 23:28:22 Random question: Why would frame_ be NULL here? Is
Charlie Reis 2014/02/28 23:31:11 I used that in all the other checks because an unp
859 #if defined(ENABLE_PLUGINS) 859 #if defined(ENABLE_PLUGINS)
860 bool pepper_plugin_was_registered = false; 860 bool pepper_plugin_was_registered = false;
861 scoped_refptr<PluginModule> pepper_module(PluginModule::Create( 861 scoped_refptr<PluginModule> pepper_module(PluginModule::Create(
862 this, info, &pepper_plugin_was_registered)); 862 this, info, &pepper_plugin_was_registered));
863 if (pepper_plugin_was_registered) { 863 if (pepper_plugin_was_registered) {
864 if (pepper_module.get()) { 864 if (pepper_module.get()) {
865 return new PepperWebPluginImpl(pepper_module.get(), params, this); 865 return new PepperWebPluginImpl(pepper_module.get(), params, this);
866 } 866 }
867 } 867 }
868 #if defined(OS_CHROMEOS) 868 #if defined(OS_CHROMEOS)
(...skipping 19 matching lines...) Expand all
888 void RenderFrameImpl::OnChildFrameProcessGone() { 888 void RenderFrameImpl::OnChildFrameProcessGone() {
889 if (compositing_helper_) 889 if (compositing_helper_)
890 compositing_helper_->ChildFrameGone(); 890 compositing_helper_->ChildFrameGone();
891 } 891 }
892 892
893 // blink::WebFrameClient implementation ---------------------------------------- 893 // blink::WebFrameClient implementation ----------------------------------------
894 894
895 blink::WebPlugin* RenderFrameImpl::createPlugin( 895 blink::WebPlugin* RenderFrameImpl::createPlugin(
896 blink::WebFrame* frame, 896 blink::WebFrame* frame,
897 const blink::WebPluginParams& params) { 897 const blink::WebPluginParams& params) {
898 // TODO(creis): |frame| is different from |frame_| here. This seems wrong. 898 DCHECK(!frame_ || frame_ == frame);
899 blink::WebPlugin* plugin = NULL; 899 blink::WebPlugin* plugin = NULL;
900 if (GetContentClient()->renderer()->OverrideCreatePlugin( 900 if (GetContentClient()->renderer()->OverrideCreatePlugin(
901 this, frame, params, &plugin)) { 901 this, frame, params, &plugin)) {
902 return plugin; 902 return plugin;
903 } 903 }
904 904
905 if (UTF16ToASCII(params.mimeType) == kBrowserPluginMimeType) { 905 if (UTF16ToASCII(params.mimeType) == kBrowserPluginMimeType) {
906 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin( 906 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin(
907 render_view_.get(), frame); 907 render_view_.get(), frame);
908 } 908 }
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
1673 should_replace_current_entry = data_source->replacesCurrentHistoryItem(); 1673 should_replace_current_entry = data_source->replacesCurrentHistoryItem();
1674 } else { 1674 } else {
1675 // If the navigation is browser-initiated, the NavigationState contains the 1675 // If the navigation is browser-initiated, the NavigationState contains the
1676 // correct value instead of the WebDataSource. 1676 // correct value instead of the WebDataSource.
1677 // 1677 //
1678 // TODO(davidben): Avoid this awkward duplication of state. See comment on 1678 // TODO(davidben): Avoid this awkward duplication of state. See comment on
1679 // NavigationState::should_replace_current_entry(). 1679 // NavigationState::should_replace_current_entry().
1680 should_replace_current_entry = 1680 should_replace_current_entry =
1681 navigation_state->should_replace_current_entry(); 1681 navigation_state->should_replace_current_entry();
1682 } 1682 }
1683 // TODO(creis): Remove the second routing ID from the request, now that we
1684 // use routing IDs instead of frame IDs. (This is a viral change, so I'm
1685 // splitting it into multiple CLs.)
1686 int parent_routing_id = frame->parent() ? 1683 int parent_routing_id = frame->parent() ?
1687 FromWebFrame(frame->parent())->GetRoutingID() : -1; 1684 FromWebFrame(frame->parent())->GetRoutingID() : -1;
1688 request.setExtraData( 1685 request.setExtraData(
1689 new RequestExtraData(render_view_->visibilityState(), 1686 new RequestExtraData(render_view_->visibilityState(),
1690 custom_user_agent, 1687 custom_user_agent,
1691 was_after_preconnect_request, 1688 was_after_preconnect_request,
1692 routing_id_, 1689 routing_id_,
1693 (frame == top_frame), 1690 (frame == top_frame),
1694 routing_id_,
1695 GURL(frame->document().securityOrigin().toString()), 1691 GURL(frame->document().securityOrigin().toString()),
1696 frame->parent() == top_frame, 1692 frame->parent() == top_frame,
1697 parent_routing_id, 1693 parent_routing_id,
1698 navigation_state->allow_download(), 1694 navigation_state->allow_download(),
1699 transition_type, 1695 transition_type,
1700 should_replace_current_entry, 1696 should_replace_current_entry,
1701 navigation_state->transferred_request_child_id(), 1697 navigation_state->transferred_request_child_id(),
1702 navigation_state->transferred_request_request_id())); 1698 navigation_state->transferred_request_request_id()));
1703 1699
1704 DocumentState* top_document_state = 1700 DocumentState* top_document_state =
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
2275 2271
2276 void RenderFrameImpl::didStartLoading() { 2272 void RenderFrameImpl::didStartLoading() {
2277 Send(new FrameHostMsg_DidStartLoading(routing_id_)); 2273 Send(new FrameHostMsg_DidStartLoading(routing_id_));
2278 } 2274 }
2279 2275
2280 void RenderFrameImpl::didStopLoading() { 2276 void RenderFrameImpl::didStopLoading() {
2281 Send(new FrameHostMsg_DidStopLoading(routing_id_)); 2277 Send(new FrameHostMsg_DidStopLoading(routing_id_));
2282 } 2278 }
2283 2279
2284 } // namespace content 2280 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698