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

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

Issue 1802773002: Support loading trial tokens from HTTP headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 #include "core/loader/DocumentLoader.h" 67 #include "core/loader/DocumentLoader.h"
68 #include "core/loader/FormSubmission.h" 68 #include "core/loader/FormSubmission.h"
69 #include "core/loader/FrameLoadRequest.h" 69 #include "core/loader/FrameLoadRequest.h"
70 #include "core/loader/FrameLoaderClient.h" 70 #include "core/loader/FrameLoaderClient.h"
71 #include "core/loader/LinkLoader.h" 71 #include "core/loader/LinkLoader.h"
72 #include "core/loader/MixedContentChecker.h" 72 #include "core/loader/MixedContentChecker.h"
73 #include "core/loader/NavigationScheduler.h" 73 #include "core/loader/NavigationScheduler.h"
74 #include "core/loader/NetworkHintsInterface.h" 74 #include "core/loader/NetworkHintsInterface.h"
75 #include "core/loader/ProgressTracker.h" 75 #include "core/loader/ProgressTracker.h"
76 #include "core/loader/appcache/ApplicationCacheHost.h" 76 #include "core/loader/appcache/ApplicationCacheHost.h"
77 #include "core/origin_trials/OriginTrials.h"
77 #include "core/page/ChromeClient.h" 78 #include "core/page/ChromeClient.h"
78 #include "core/page/CreateWindow.h" 79 #include "core/page/CreateWindow.h"
79 #include "core/page/FrameTree.h" 80 #include "core/page/FrameTree.h"
80 #include "core/page/Page.h" 81 #include "core/page/Page.h"
81 #include "core/page/WindowFeatures.h" 82 #include "core/page/WindowFeatures.h"
82 #include "core/page/scrolling/ScrollingCoordinator.h" 83 #include "core/page/scrolling/ScrollingCoordinator.h"
83 #include "core/svg/graphics/SVGImage.h" 84 #include "core/svg/graphics/SVGImage.h"
84 #include "core/xml/parser/XMLDocumentParser.h" 85 #include "core/xml/parser/XMLDocumentParser.h"
85 #include "platform/Logging.h" 86 #include "platform/Logging.h"
86 #include "platform/PluginScriptForbiddenScope.h" 87 #include "platform/PluginScriptForbiddenScope.h"
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 m_frame->document()->parseDNSPrefetchControlHeader(dnsPrefetchContro l); 477 m_frame->document()->parseDNSPrefetchControlHeader(dnsPrefetchContro l);
477 478
478 String headerContentLanguage = m_documentLoader->response().httpHeaderFi eld(HTTPNames::Content_Language); 479 String headerContentLanguage = m_documentLoader->response().httpHeaderFi eld(HTTPNames::Content_Language);
479 if (!headerContentLanguage.isEmpty()) { 480 if (!headerContentLanguage.isEmpty()) {
480 size_t commaIndex = headerContentLanguage.find(','); 481 size_t commaIndex = headerContentLanguage.find(',');
481 headerContentLanguage.truncate(commaIndex); // kNotFound == -1 == do n't truncate 482 headerContentLanguage.truncate(commaIndex); // kNotFound == -1 == do n't truncate
482 headerContentLanguage = headerContentLanguage.stripWhiteSpace(isHTML Space<UChar>); 483 headerContentLanguage = headerContentLanguage.stripWhiteSpace(isHTML Space<UChar>);
483 if (!headerContentLanguage.isEmpty()) 484 if (!headerContentLanguage.isEmpty())
484 m_frame->document()->setContentLanguage(AtomicString(headerConte ntLanguage)); 485 m_frame->document()->setContentLanguage(AtomicString(headerConte ntLanguage));
485 } 486 }
487
488 OriginTrials::setTrialTokensFromHeader(m_frame->document(), m_documentLo ader->response().httpHeaderField(HTTPNames::Origin_Trial));
486 } 489 }
487 490
488 if (m_provisionalItem && isBackForwardLoadType(m_loadType)) 491 if (m_provisionalItem && isBackForwardLoadType(m_loadType))
489 m_frame->document()->setStateForNewFormElements(m_provisionalItem->docum entState()); 492 m_frame->document()->setStateForNewFormElements(m_provisionalItem->docum entState());
490 493
491 client()->didCreateNewDocument(); 494 client()->didCreateNewDocument();
492 } 495 }
493 496
494 void FrameLoader::finishedParsing() 497 void FrameLoader::finishedParsing()
495 { 498 {
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after
1585 // FIXME: We need a way to propagate insecure requests policy flags to 1588 // FIXME: We need a way to propagate insecure requests policy flags to
1586 // out-of-process frames. For now, we'll always use default behavior. 1589 // out-of-process frames. For now, we'll always use default behavior.
1587 if (!parentFrame->isLocalFrame()) 1590 if (!parentFrame->isLocalFrame())
1588 return nullptr; 1591 return nullptr;
1589 1592
1590 ASSERT(toLocalFrame(parentFrame)->document()); 1593 ASSERT(toLocalFrame(parentFrame)->document());
1591 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; 1594 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ;
1592 } 1595 }
1593 1596
1594 } // namespace blink 1597 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698