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

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

Issue 1287783003: Make ClientHintsPreferences class work like a class. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/loader/FrameLoader.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "config.h" 5 #include "config.h"
6 #include "HttpEquiv.h" 6 #include "HttpEquiv.h"
7 7
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/StyleEngine.h" 9 #include "core/dom/StyleEngine.h"
10 #include "core/fetch/ClientHintsPreferences.h" 10 #include "core/fetch/ClientHintsPreferences.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 else 55 else
56 ASSERT_NOT_REACHED(); 56 ASSERT_NOT_REACHED();
57 } 57 }
58 58
59 void HttpEquiv::processHttpEquivAcceptCH(Document& document, const AtomicString& content) 59 void HttpEquiv::processHttpEquivAcceptCH(Document& document, const AtomicString& content)
60 { 60 {
61 if (!document.frame()) 61 if (!document.frame())
62 return; 62 return;
63 63
64 UseCounter::count(document, UseCounter::ClientHintsMetaAcceptCH); 64 UseCounter::count(document, UseCounter::ClientHintsMetaAcceptCH);
65 ClientHintsPreferences clientHintsPreferences = document.clientHintsPreferen ces(); 65 document.clientHintsPreferences().updateFromAcceptClientHintsHeader(content, document.fetcher());
66 handleAcceptClientHintsHeader(content, clientHintsPreferences, document.fetc her());
67 document.setClientHintsPreferences(clientHintsPreferences);
68 } 66 }
69 67
70 void HttpEquiv::processHttpEquivDefaultStyle(Document& document, const AtomicStr ing& content) 68 void HttpEquiv::processHttpEquivDefaultStyle(Document& document, const AtomicStr ing& content)
71 { 69 {
72 // The preferred style set has been overridden as per section 70 // The preferred style set has been overridden as per section
73 // 14.3.2 of the HTML4.0 specification. We need to update the 71 // 14.3.2 of the HTML4.0 specification. We need to update the
74 // sheet used variable and then update our style selector. 72 // sheet used variable and then update our style selector.
75 // For more info, see the test at: 73 // For more info, see the test at:
76 // http://www.hixie.ch/tests/evil/css/import/main/preferred.html 74 // http://www.hixie.ch/tests/evil/css/import/main/preferred.html
77 // -dwh 75 // -dwh
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // Stopping the loader isn't enough, as we're already parsing the document; to honor the header's 112 // Stopping the loader isn't enough, as we're already parsing the document; to honor the header's
115 // intent, we must navigate away from the possibly partially-rendered docume nt to a location that 113 // intent, we must navigate away from the possibly partially-rendered docume nt to a location that
116 // doesn't inherit the parent's SecurityOrigin. 114 // doesn't inherit the parent's SecurityOrigin.
117 frame->navigate(document, SecurityOrigin::urlWithUniqueSecurityOrigin(), tru e, UserGestureStatus::None); 115 frame->navigate(document, SecurityOrigin::urlWithUniqueSecurityOrigin(), tru e, UserGestureStatus::None);
118 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(S ecurityMessageSource, ErrorMessageLevel, message); 116 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(S ecurityMessageSource, ErrorMessageLevel, message);
119 consoleMessage->setRequestIdentifier(requestIdentifier); 117 consoleMessage->setRequestIdentifier(requestIdentifier);
120 document.addConsoleMessage(consoleMessage.release()); 118 document.addConsoleMessage(consoleMessage.release());
121 } 119 }
122 120
123 } 121 }
OLDNEW
« no previous file with comments | « Source/core/loader/FrameLoader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698