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

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

Issue 2459143002: Avoid GURL allocations/copies/frees in RenderFrameImpl::willSendRequest (Closed)
Patch Set: s/host/host_piece 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 4149 matching lines...) Expand 10 before | Expand all | Expand 10 after
4160 InternalDocumentStateData* internal_data = 4160 InternalDocumentStateData* internal_data =
4161 InternalDocumentStateData::FromDocumentState(document_state); 4161 InternalDocumentStateData::FromDocumentState(document_state);
4162 NavigationStateImpl* navigation_state = 4162 NavigationStateImpl* navigation_state =
4163 static_cast<NavigationStateImpl*>(document_state->navigation_state()); 4163 static_cast<NavigationStateImpl*>(document_state->navigation_state());
4164 ui::PageTransition transition_type = navigation_state->GetTransitionType(); 4164 ui::PageTransition transition_type = navigation_state->GetTransitionType();
4165 if (provisional_data_source && provisional_data_source->isClientRedirect()) { 4165 if (provisional_data_source && provisional_data_source->isClientRedirect()) {
4166 transition_type = ui::PageTransitionFromInt( 4166 transition_type = ui::PageTransitionFromInt(
4167 transition_type | ui::PAGE_TRANSITION_CLIENT_REDIRECT); 4167 transition_type | ui::PAGE_TRANSITION_CLIENT_REDIRECT);
4168 } 4168 }
4169 4169
4170 GURL request_url(request.url());
4171 GURL new_url; 4170 GURL new_url;
4172 if (GetContentClient()->renderer()->WillSendRequest( 4171 if (GetContentClient()->renderer()->WillSendRequest(
4173 frame, 4172 frame,
4174 transition_type, 4173 transition_type,
4175 request_url, 4174 request.url(),
4176 request.firstPartyForCookies(),
4177 &new_url)) { 4175 &new_url)) {
4178 request.setURL(WebURL(new_url)); 4176 request.setURL(WebURL(new_url));
4179 } 4177 }
4180 4178
4181 if (internal_data->is_cache_policy_override_set()) 4179 if (internal_data->is_cache_policy_override_set())
4182 request.setCachePolicy(internal_data->cache_policy_override()); 4180 request.setCachePolicy(internal_data->cache_policy_override());
4183 4181
4184 // The request's extra data may indicate that we should set a custom user 4182 // The request's extra data may indicate that we should set a custom user
4185 // agent. This needs to be done here, after WebKit is through with setting the 4183 // agent. This needs to be done here, after WebKit is through with setting the
4186 // user agent on its own. Similarly, it may indicate that we should set an 4184 // user agent on its own. Similarly, it may indicate that we should set an
(...skipping 2440 matching lines...) Expand 10 before | Expand all | Expand 10 after
6627 // event target. Potentially a Pepper plugin will receive the event. 6625 // event target. Potentially a Pepper plugin will receive the event.
6628 // In order to tell whether a plugin gets the last mouse event and which it 6626 // In order to tell whether a plugin gets the last mouse event and which it
6629 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6627 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6630 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6628 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6631 // |pepper_last_mouse_event_target_|. 6629 // |pepper_last_mouse_event_target_|.
6632 pepper_last_mouse_event_target_ = nullptr; 6630 pepper_last_mouse_event_target_ = nullptr;
6633 #endif 6631 #endif
6634 } 6632 }
6635 6633
6636 } // namespace content 6634 } // namespace content
OLDNEW
« no previous file with comments | « content/public/renderer/content_renderer_client.cc ('k') | extensions/shell/renderer/shell_content_renderer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698