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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
220 | 220 |
221 const size_t kExtraCharsBeforeAndAfterSelection = 100; | 221 const size_t kExtraCharsBeforeAndAfterSelection = 100; |
222 | 222 |
223 typedef std::map<int, RenderFrameImpl*> RoutingIDFrameMap; | 223 typedef std::map<int, RenderFrameImpl*> RoutingIDFrameMap; |
224 static base::LazyInstance<RoutingIDFrameMap> g_routing_id_frame_map = | 224 static base::LazyInstance<RoutingIDFrameMap> g_routing_id_frame_map = |
225 LAZY_INSTANCE_INITIALIZER; | 225 LAZY_INSTANCE_INITIALIZER; |
226 | 226 |
227 typedef std::map<blink::WebFrame*, RenderFrameImpl*> FrameMap; | 227 typedef std::map<blink::WebFrame*, RenderFrameImpl*> FrameMap; |
228 base::LazyInstance<FrameMap> g_frame_map = LAZY_INSTANCE_INITIALIZER; | 228 base::LazyInstance<FrameMap> g_frame_map = LAZY_INSTANCE_INITIALIZER; |
229 | 229 |
230 int64 ExtractPostId(const WebHistoryItem& item) { | 230 int64 ExtractPostId(HistoryEntry* entry) { |
231 if (item.isNull()) | 231 if (!entry) |
232 return -1; | 232 return -1; |
233 | 233 |
234 const WebHistoryItem& item = entry->root(); | |
234 if (item.httpBody().isNull()) | 235 if (item.httpBody().isNull()) |
Charlie Reis
2015/02/19 00:51:37
Please change this to:
if (item.isNull() || item.h
Sunil Ratnu
2015/02/19 04:19:35
Done.
| |
235 return -1; | 236 return -1; |
236 | 237 |
237 return item.httpBody().identifier(); | 238 return item.httpBody().identifier(); |
238 } | 239 } |
239 | 240 |
240 WebURLResponseExtraDataImpl* GetExtraDataFromResponse( | 241 WebURLResponseExtraDataImpl* GetExtraDataFromResponse( |
241 const WebURLResponse& response) { | 242 const WebURLResponse& response) { |
242 return static_cast<WebURLResponseExtraDataImpl*>(response.extraData()); | 243 return static_cast<WebURLResponseExtraDataImpl*>(response.extraData()); |
243 } | 244 } |
244 | 245 |
(...skipping 3522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3767 params.transition = ui::PageTransitionFromInt( | 3768 params.transition = ui::PageTransitionFromInt( |
3768 params.transition | ui::PAGE_TRANSITION_CLIENT_REDIRECT); | 3769 params.transition | ui::PAGE_TRANSITION_CLIENT_REDIRECT); |
3769 } else { | 3770 } else { |
3770 params.referrer = RenderViewImpl::GetReferrerFromRequest( | 3771 params.referrer = RenderViewImpl::GetReferrerFromRequest( |
3771 frame, ds->request()); | 3772 frame, ds->request()); |
3772 } | 3773 } |
3773 | 3774 |
3774 base::string16 method = request.httpMethod(); | 3775 base::string16 method = request.httpMethod(); |
3775 if (EqualsASCII(method, "POST")) { | 3776 if (EqualsASCII(method, "POST")) { |
3776 params.is_post = true; | 3777 params.is_post = true; |
3777 params.post_id = ExtractPostId(entry->root()); | 3778 params.post_id = ExtractPostId(entry); |
3778 } | 3779 } |
3779 | 3780 |
3780 // Send the user agent override back. | 3781 // Send the user agent override back. |
3781 params.is_overriding_user_agent = internal_data->is_overriding_user_agent(); | 3782 params.is_overriding_user_agent = internal_data->is_overriding_user_agent(); |
3782 | 3783 |
3783 // Track the URL of the original request. We use the first entry of the | 3784 // Track the URL of the original request. We use the first entry of the |
3784 // redirect chain if it exists because the chain may have started in another | 3785 // redirect chain if it exists because the chain may have started in another |
3785 // process. | 3786 // process. |
3786 params.original_request_url = GetOriginalRequestURL(ds); | 3787 params.original_request_url = GetOriginalRequestURL(ds); |
3787 | 3788 |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4439 | 4440 |
4440 #if defined(ENABLE_BROWSER_CDMS) | 4441 #if defined(ENABLE_BROWSER_CDMS) |
4441 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 4442 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
4442 if (!cdm_manager_) | 4443 if (!cdm_manager_) |
4443 cdm_manager_ = new RendererCdmManager(this); | 4444 cdm_manager_ = new RendererCdmManager(this); |
4444 return cdm_manager_; | 4445 return cdm_manager_; |
4445 } | 4446 } |
4446 #endif // defined(ENABLE_BROWSER_CDMS) | 4447 #endif // defined(ENABLE_BROWSER_CDMS) |
4447 | 4448 |
4448 } // namespace content | 4449 } // namespace content |
OLD | NEW |