| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All |
| 7 * rights reserved. | 7 * rights reserved. |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
| 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 #include "platform/ScriptForbiddenScope.h" | 234 #include "platform/ScriptForbiddenScope.h" |
| 235 #include "platform/network/ContentSecurityPolicyParsers.h" | 235 #include "platform/network/ContentSecurityPolicyParsers.h" |
| 236 #include "platform/network/HTTPParsers.h" | 236 #include "platform/network/HTTPParsers.h" |
| 237 #include "platform/scroll/ScrollbarTheme.h" | 237 #include "platform/scroll/ScrollbarTheme.h" |
| 238 #include "platform/text/PlatformLocale.h" | 238 #include "platform/text/PlatformLocale.h" |
| 239 #include "platform/text/SegmentedString.h" | 239 #include "platform/text/SegmentedString.h" |
| 240 #include "platform/tracing/TraceEvent.h" | 240 #include "platform/tracing/TraceEvent.h" |
| 241 #include "platform/weborigin/OriginAccessEntry.h" | 241 #include "platform/weborigin/OriginAccessEntry.h" |
| 242 #include "platform/weborigin/SchemeRegistry.h" | 242 #include "platform/weborigin/SchemeRegistry.h" |
| 243 #include "platform/weborigin/SecurityOrigin.h" | 243 #include "platform/weborigin/SecurityOrigin.h" |
| 244 #include "public/platform/InterfaceProvider.h" | |
| 245 #include "public/platform/Platform.h" | 244 #include "public/platform/Platform.h" |
| 246 #include "public/platform/WebAddressSpace.h" | 245 #include "public/platform/WebAddressSpace.h" |
| 247 #include "public/platform/WebFrameScheduler.h" | 246 #include "public/platform/WebFrameScheduler.h" |
| 248 #include "public/platform/WebPrerenderingSupport.h" | 247 #include "public/platform/WebPrerenderingSupport.h" |
| 249 #include "public/platform/WebScheduler.h" | 248 #include "public/platform/WebScheduler.h" |
| 250 #include "public/platform/modules/sensitive_input_visibility/sensitive_input_vis
ibility_service.mojom-blink.h" | |
| 251 #include "wtf/AutoReset.h" | 249 #include "wtf/AutoReset.h" |
| 252 #include "wtf/CurrentTime.h" | 250 #include "wtf/CurrentTime.h" |
| 253 #include "wtf/DateMath.h" | 251 #include "wtf/DateMath.h" |
| 254 #include "wtf/Functional.h" | 252 #include "wtf/Functional.h" |
| 255 #include "wtf/HashFunctions.h" | 253 #include "wtf/HashFunctions.h" |
| 256 #include "wtf/PtrUtil.h" | 254 #include "wtf/PtrUtil.h" |
| 257 #include "wtf/StdLibExtras.h" | 255 #include "wtf/StdLibExtras.h" |
| 258 #include "wtf/text/CharacterNames.h" | 256 #include "wtf/text/CharacterNames.h" |
| 259 #include "wtf/text/StringBuffer.h" | 257 #include "wtf/text/StringBuffer.h" |
| 260 #include "wtf/text/TextEncodingRegistry.h" | 258 #include "wtf/text/TextEncodingRegistry.h" |
| (...skipping 4063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4324 | 4322 |
| 4325 const OriginAccessEntry& Document::accessEntryFromURL() { | 4323 const OriginAccessEntry& Document::accessEntryFromURL() { |
| 4326 if (!m_accessEntryFromURL) { | 4324 if (!m_accessEntryFromURL) { |
| 4327 m_accessEntryFromURL = wrapUnique( | 4325 m_accessEntryFromURL = wrapUnique( |
| 4328 new OriginAccessEntry(url().protocol(), url().host(), | 4326 new OriginAccessEntry(url().protocol(), url().host(), |
| 4329 OriginAccessEntry::AllowRegisterableDomains)); | 4327 OriginAccessEntry::AllowRegisterableDomains)); |
| 4330 } | 4328 } |
| 4331 return *m_accessEntryFromURL; | 4329 return *m_accessEntryFromURL; |
| 4332 } | 4330 } |
| 4333 | 4331 |
| 4334 void Document::sendSensitiveInputVisibility() { | |
| 4335 if (m_sensitiveInputVisibilityTask.isActive()) | |
| 4336 return; | |
| 4337 | |
| 4338 m_sensitiveInputVisibilityTask = | |
| 4339 TaskRunnerHelper::get(TaskType::Internal, this) | |
| 4340 ->postCancellableTask( | |
| 4341 BLINK_FROM_HERE, | |
| 4342 WTF::bind(&Document::sendSensitiveInputVisibilityInternal, | |
| 4343 wrapWeakPersistent(this))); | |
| 4344 } | |
| 4345 | |
| 4346 void Document::sendSensitiveInputVisibilityInternal() { | |
| 4347 if (!frame()) | |
| 4348 return; | |
| 4349 | |
| 4350 mojom::blink::SensitiveInputVisibilityServicePtr sensitiveInputServicePtr; | |
| 4351 frame()->interfaceProvider()->getInterface( | |
| 4352 mojo::GetProxy(&sensitiveInputServicePtr)); | |
| 4353 if (m_passwordCount > 0) { | |
| 4354 sensitiveInputServicePtr->PasswordFieldVisibleInInsecureContext(); | |
| 4355 return; | |
| 4356 } | |
| 4357 sensitiveInputServicePtr->AllPasswordFieldsInInsecureContextInvisible(); | |
| 4358 } | |
| 4359 | |
| 4360 void Document::registerEventFactory( | 4332 void Document::registerEventFactory( |
| 4361 std::unique_ptr<EventFactoryBase> eventFactory) { | 4333 std::unique_ptr<EventFactoryBase> eventFactory) { |
| 4362 DCHECK(!eventFactories().contains(eventFactory.get())); | 4334 DCHECK(!eventFactories().contains(eventFactory.get())); |
| 4363 eventFactories().add(std::move(eventFactory)); | 4335 eventFactories().add(std::move(eventFactory)); |
| 4364 } | 4336 } |
| 4365 | 4337 |
| 4366 Event* Document::createEvent(ExecutionContext* executionContext, | 4338 Event* Document::createEvent(ExecutionContext* executionContext, |
| 4367 const String& eventType, | 4339 const String& eventType, |
| 4368 ExceptionState& exceptionState) { | 4340 ExceptionState& exceptionState) { |
| 4369 Event* event = nullptr; | 4341 Event* event = nullptr; |
| (...skipping 2057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6427 | 6399 |
| 6428 PropertyRegistry* Document::propertyRegistry() { | 6400 PropertyRegistry* Document::propertyRegistry() { |
| 6429 // TODO(timloh): When the flag is removed, return a reference instead. | 6401 // TODO(timloh): When the flag is removed, return a reference instead. |
| 6430 if (!m_propertyRegistry && RuntimeEnabledFeatures::cssVariables2Enabled()) | 6402 if (!m_propertyRegistry && RuntimeEnabledFeatures::cssVariables2Enabled()) |
| 6431 m_propertyRegistry = PropertyRegistry::create(); | 6403 m_propertyRegistry = PropertyRegistry::create(); |
| 6432 return m_propertyRegistry; | 6404 return m_propertyRegistry; |
| 6433 } | 6405 } |
| 6434 | 6406 |
| 6435 void Document::incrementPasswordCount() { | 6407 void Document::incrementPasswordCount() { |
| 6436 ++m_passwordCount; | 6408 ++m_passwordCount; |
| 6437 if (isSecureContext() || m_passwordCount != 1) { | |
| 6438 // The browser process only cares about passwords on pages where the | |
| 6439 // top-level URL is not secure. Secure contexts must have a top-level | |
| 6440 // URL that is secure, so there is no need to send notifications for | |
| 6441 // password fields in secure contexts. | |
| 6442 // | |
| 6443 // Also, only send a message on the first visible password field; the | |
| 6444 // browser process doesn't care about the presence of additional | |
| 6445 // password fields beyond that. | |
| 6446 return; | |
| 6447 } | |
| 6448 sendSensitiveInputVisibility(); | |
| 6449 } | 6409 } |
| 6450 | 6410 |
| 6451 void Document::decrementPasswordCount() { | 6411 void Document::decrementPasswordCount() { |
| 6452 DCHECK_GT(m_passwordCount, 0u); | 6412 DCHECK_GT(m_passwordCount, 0u); |
| 6453 --m_passwordCount; | 6413 --m_passwordCount; |
| 6454 if (isSecureContext() || m_passwordCount > 0) | 6414 } |
| 6455 return; | 6415 |
| 6456 sendSensitiveInputVisibility(); | 6416 unsigned Document::passwordCount() const { |
| 6417 return m_passwordCount; |
| 6457 } | 6418 } |
| 6458 | 6419 |
| 6459 DEFINE_TRACE(Document) { | 6420 DEFINE_TRACE(Document) { |
| 6460 visitor->trace(m_importsController); | 6421 visitor->trace(m_importsController); |
| 6461 visitor->trace(m_docType); | 6422 visitor->trace(m_docType); |
| 6462 visitor->trace(m_implementation); | 6423 visitor->trace(m_implementation); |
| 6463 visitor->trace(m_autofocusElement); | 6424 visitor->trace(m_autofocusElement); |
| 6464 visitor->trace(m_focusedElement); | 6425 visitor->trace(m_focusedElement); |
| 6465 visitor->trace(m_sequentialFocusNavigationStartingPoint); | 6426 visitor->trace(m_sequentialFocusNavigationStartingPoint); |
| 6466 visitor->trace(m_hoverNode); | 6427 visitor->trace(m_hoverNode); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6561 } | 6522 } |
| 6562 | 6523 |
| 6563 void showLiveDocumentInstances() { | 6524 void showLiveDocumentInstances() { |
| 6564 WeakDocumentSet& set = liveDocumentSet(); | 6525 WeakDocumentSet& set = liveDocumentSet(); |
| 6565 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6526 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 6566 for (Document* document : set) | 6527 for (Document* document : set) |
| 6567 fprintf(stderr, "- Document %p URL: %s\n", document, | 6528 fprintf(stderr, "- Document %p URL: %s\n", document, |
| 6568 document->url().getString().utf8().data()); | 6529 document->url().getString().utf8().data()); |
| 6569 } | 6530 } |
| 6570 #endif | 6531 #endif |
| OLD | NEW |