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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 2254693002: Delay generation of User-Agent header to URLRequestHttpJob and accept custom User-Agent from XHR/Fe… Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed Android test Created 4 years, 4 months 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) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
(...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after
1457 m_provisionalDocumentLoader->appendRedirect(m_provisionalDocumentLoader->req uest().url()); 1457 m_provisionalDocumentLoader->appendRedirect(m_provisionalDocumentLoader->req uest().url());
1458 m_provisionalDocumentLoader->upgradeInsecureRequest(); 1458 m_provisionalDocumentLoader->upgradeInsecureRequest();
1459 double triggeringEventTime = frameLoadRequest.triggeringEvent() ? frameLoadR equest.triggeringEvent()->platformTimeStamp() : 0; 1459 double triggeringEventTime = frameLoadRequest.triggeringEvent() ? frameLoadR equest.triggeringEvent()->platformTimeStamp() : 0;
1460 client()->dispatchDidStartProvisionalLoad(triggeringEventTime); 1460 client()->dispatchDidStartProvisionalLoad(triggeringEventTime);
1461 ASSERT(m_provisionalDocumentLoader); 1461 ASSERT(m_provisionalDocumentLoader);
1462 m_provisionalDocumentLoader->startLoadingMainResource(); 1462 m_provisionalDocumentLoader->startLoadingMainResource();
1463 1463
1464 takeObjectSnapshot(); 1464 takeObjectSnapshot();
1465 } 1465 }
1466 1466
1467 void FrameLoader::applyUserAgent(ResourceRequest& request)
1468 {
1469 String userAgent = this->userAgent();
1470 ASSERT(!userAgent.isNull());
1471 request.setHTTPUserAgent(AtomicString(userAgent));
1472 }
1473
1474 bool FrameLoader::shouldInterruptLoadForXFrameOptions(const String& content, con st KURL& url, unsigned long requestIdentifier) 1467 bool FrameLoader::shouldInterruptLoadForXFrameOptions(const String& content, con st KURL& url, unsigned long requestIdentifier)
1475 { 1468 {
1476 UseCounter::count(m_frame->domWindow()->document(), UseCounter::XFrameOption s); 1469 UseCounter::count(m_frame->domWindow()->document(), UseCounter::XFrameOption s);
1477 1470
1478 Frame* topFrame = m_frame->tree().top(); 1471 Frame* topFrame = m_frame->tree().top();
1479 if (m_frame == topFrame) 1472 if (m_frame == topFrame)
1480 return false; 1473 return false;
1481 1474
1482 XFrameOptionsDisposition disposition = parseXFrameOptionsHeader(content); 1475 XFrameOptionsDisposition disposition = parseXFrameOptionsHeader(content);
1483 1476
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1622 tracedValue->setString("documentLoaderURL", m_documentLoader ? m_documentLoa der->url() : String()); 1615 tracedValue->setString("documentLoaderURL", m_documentLoader ? m_documentLoa der->url() : String());
1623 return tracedValue; 1616 return tracedValue;
1624 } 1617 }
1625 1618
1626 inline void FrameLoader::takeObjectSnapshot() const 1619 inline void FrameLoader::takeObjectSnapshot() const
1627 { 1620 {
1628 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, toTraced Value()); 1621 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, toTraced Value());
1629 } 1622 }
1630 1623
1631 } // namespace blink 1624 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698