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

Side by Side Diff: Source/core/loader/Prerenderer.cpp

Issue 31063004: Have Frame::loader() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/loader/PingLoader.cpp ('k') | Source/core/loader/ProgressTracker.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 PassRefPtr<Prerender> Prerenderer::render(PrerenderClient* prerenderClient, cons t KURL& url) 76 PassRefPtr<Prerender> Prerenderer::render(PrerenderClient* prerenderClient, cons t KURL& url)
77 { 77 {
78 // Prerenders are unlike requests in most ways (for instance, they pass down fragments, and they don't return data), 78 // Prerenders are unlike requests in most ways (for instance, they pass down fragments, and they don't return data),
79 // but they do have referrers. 79 // but they do have referrers.
80 const ReferrerPolicy referrerPolicy = document()->referrerPolicy(); 80 const ReferrerPolicy referrerPolicy = document()->referrerPolicy();
81 81
82 if (!document()->frame()) 82 if (!document()->frame())
83 return 0; 83 return 0;
84 84
85 const String referrer = SecurityPolicy::generateReferrerHeader(referrerPolic y, url, document()->frame()->loader()->outgoingReferrer()); 85 const String referrer = SecurityPolicy::generateReferrerHeader(referrerPolic y, url, document()->frame()->loader().outgoingReferrer());
86 86
87 RefPtr<Prerender> prerender = Prerender::create(prerenderClient, url, referr er, referrerPolicy); 87 RefPtr<Prerender> prerender = Prerender::create(prerenderClient, url, referr er, referrerPolicy);
88 88
89 if (client()) 89 if (client())
90 client()->willAddPrerender(prerender.get()); 90 client()->willAddPrerender(prerender.get());
91 prerender->add(); 91 prerender->add();
92 92
93 // FIXME: This prerender isn't released until page unload, but it may be can celed before then. It should be released in that case. 93 // FIXME: This prerender isn't released until page unload, but it may be can celed before then. It should be released in that case.
94 m_activePrerenders.append(prerender); 94 m_activePrerenders.append(prerender);
95 return prerender; 95 return prerender;
(...skipping 19 matching lines...) Expand all
115 if (!m_initializedClient) { 115 if (!m_initializedClient) {
116 // We can't initialize the client in our contructor, because the platfor m might not have 116 // We can't initialize the client in our contructor, because the platfor m might not have
117 // provided our supplement by then. 117 // provided our supplement by then.
118 m_initializedClient = true; 118 m_initializedClient = true;
119 m_client = PrerendererClient::from(document()->page()); 119 m_client = PrerendererClient::from(document()->page());
120 } 120 }
121 return m_client; 121 return m_client;
122 } 122 }
123 123
124 } 124 }
OLDNEW
« no previous file with comments | « Source/core/loader/PingLoader.cpp ('k') | Source/core/loader/ProgressTracker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698