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

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

Issue 2459143002: Avoid GURL allocations/copies/frees in RenderFrameImpl::willSendRequest (Closed)
Patch Set: compile fix Created 4 years, 1 month 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 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 4136 matching lines...) Expand 10 before | Expand all | Expand 10 after
4147 InternalDocumentStateData* internal_data = 4147 InternalDocumentStateData* internal_data =
4148 InternalDocumentStateData::FromDocumentState(document_state); 4148 InternalDocumentStateData::FromDocumentState(document_state);
4149 NavigationStateImpl* navigation_state = 4149 NavigationStateImpl* navigation_state =
4150 static_cast<NavigationStateImpl*>(document_state->navigation_state()); 4150 static_cast<NavigationStateImpl*>(document_state->navigation_state());
4151 ui::PageTransition transition_type = navigation_state->GetTransitionType(); 4151 ui::PageTransition transition_type = navigation_state->GetTransitionType();
4152 if (provisional_data_source && provisional_data_source->isClientRedirect()) { 4152 if (provisional_data_source && provisional_data_source->isClientRedirect()) {
4153 transition_type = ui::PageTransitionFromInt( 4153 transition_type = ui::PageTransitionFromInt(
4154 transition_type | ui::PAGE_TRANSITION_CLIENT_REDIRECT); 4154 transition_type | ui::PAGE_TRANSITION_CLIENT_REDIRECT);
4155 } 4155 }
4156 4156
4157 GURL request_url(request.url());
4158 GURL new_url; 4157 GURL new_url;
4159 if (GetContentClient()->renderer()->WillSendRequest( 4158 if (GetContentClient()->renderer()->WillSendRequest(
4160 frame, 4159 frame,
4161 transition_type, 4160 transition_type,
4162 request_url, 4161 request.url(),
4163 request.firstPartyForCookies(),
4164 &new_url)) { 4162 &new_url)) {
4165 request.setURL(WebURL(new_url)); 4163 request.setURL(WebURL(new_url));
4166 } 4164 }
4167 4165
4168 if (internal_data->is_cache_policy_override_set()) 4166 if (internal_data->is_cache_policy_override_set())
4169 request.setCachePolicy(internal_data->cache_policy_override()); 4167 request.setCachePolicy(internal_data->cache_policy_override());
4170 4168
4171 // The request's extra data may indicate that we should set a custom user 4169 // The request's extra data may indicate that we should set a custom user
4172 // agent. This needs to be done here, after WebKit is through with setting the 4170 // agent. This needs to be done here, after WebKit is through with setting the
4173 // user agent on its own. Similarly, it may indicate that we should set an 4171 // user agent on its own. Similarly, it may indicate that we should set an
(...skipping 2450 matching lines...) Expand 10 before | Expand all | Expand 10 after
6624 // event target. Potentially a Pepper plugin will receive the event. 6622 // event target. Potentially a Pepper plugin will receive the event.
6625 // In order to tell whether a plugin gets the last mouse event and which it 6623 // In order to tell whether a plugin gets the last mouse event and which it
6626 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6624 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6627 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6625 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6628 // |pepper_last_mouse_event_target_|. 6626 // |pepper_last_mouse_event_target_|.
6629 pepper_last_mouse_event_target_ = nullptr; 6627 pepper_last_mouse_event_target_ = nullptr;
6630 #endif 6628 #endif
6631 } 6629 }
6632 6630
6633 } // namespace content 6631 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698