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

Side by Side Diff: third_party/WebKit/Source/core/frame/Frame.cpp

Issue 2557063002: Upgrade Insecure Requests: bugfixes, tests, and support for OOPIF.
Patch Set: Addressed comments (@nasko #2). Created 4 years 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 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
9 * rights reserved. 9 * rights reserved.
10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 327
328 void Frame::didChangeVisibilityState() { 328 void Frame::didChangeVisibilityState() {
329 HeapVector<Member<Frame>> childFrames; 329 HeapVector<Member<Frame>> childFrames;
330 for (Frame* child = tree().firstChild(); child; 330 for (Frame* child = tree().firstChild(); child;
331 child = child->tree().nextSibling()) 331 child = child->tree().nextSibling())
332 childFrames.append(child); 332 childFrames.append(child);
333 for (size_t i = 0; i < childFrames.size(); ++i) 333 for (size_t i = 0; i < childFrames.size(); ++i)
334 childFrames[i]->didChangeVisibilityState(); 334 childFrames[i]->didChangeVisibilityState();
335 } 335 }
336 336
337 // static
338 void Frame::upgradeInsecureRequest(KURL& url, Document& originDocument) {
339 // We always upgrade requests that meet any of the following criteria:
340 //
341 // Enforced in FrameLoader::upgradeInsecureRequest.
342 // 1. Are for subresources.
343 // 2. Are for nested frames.
344 // 3. Are form submissions.
345 // 4. Whose hosts are contained in the originDocument's upgrade insecure
346 // navigations set. (same-frame navigation).
347 // Enforced in Frame::upgradeInsecureRequest.
348 // 4. Whose hosts are contained in the originDocument's upgrade insecure
349 // navigations set. (cross-frame navigation).
350 if (url.protocolIs("http") &&
351 originDocument.getInsecureRequestPolicy() & kUpgradeInsecureRequests &&
352 !url.host().isNull() &&
353 originDocument.insecureNavigationsToUpgrade()->contains(
354 url.host().impl()->hash())) {
355 UseCounter::count(originDocument,
356 UseCounter::UpgradeInsecureRequestsUpgradedRequest);
357 url.setProtocol("https");
358 if (url.port() == 80)
359 url.setPort(443);
360 }
361 }
362
337 Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner) 363 Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner)
338 : m_treeNode(this), 364 : m_treeNode(this),
339 m_host(host), 365 m_host(host),
340 m_owner(owner), 366 m_owner(owner),
341 m_client(client), 367 m_client(client),
342 m_isLoading(false) { 368 m_isLoading(false) {
343 InstanceCounters::incrementCounter(InstanceCounters::FrameCounter); 369 InstanceCounters::incrementCounter(InstanceCounters::FrameCounter);
344 370
345 ASSERT(page()); 371 ASSERT(page());
346 372
347 if (m_owner) 373 if (m_owner)
348 m_owner->setContentFrame(*this); 374 m_owner->setContentFrame(*this);
349 else 375 else
350 page()->setMainFrame(this); 376 page()->setMainFrame(this);
351 } 377 }
352
353 } // namespace blink 378 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/Frame.h ('k') | third_party/WebKit/Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698