| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2009 Torch Mobile, Inc. | 3 * Copyright (C) 2009 Torch Mobile, Inc. |
| 4 * Copyright 2010, The Android Open Source Project | 4 * Copyright 2010, The Android Open Source Project |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "core/frame/HostsUsingFeatures.h" | 34 #include "core/frame/HostsUsingFeatures.h" |
| 35 #include "core/frame/PerformanceMonitor.h" | 35 #include "core/frame/PerformanceMonitor.h" |
| 36 #include "core/frame/Settings.h" | 36 #include "core/frame/Settings.h" |
| 37 #include "core/probe/CoreProbes.h" | 37 #include "core/probe/CoreProbes.h" |
| 38 #include "modules/geolocation/Coordinates.h" | 38 #include "modules/geolocation/Coordinates.h" |
| 39 #include "modules/geolocation/GeolocationError.h" | 39 #include "modules/geolocation/GeolocationError.h" |
| 40 #include "modules/permissions/PermissionUtils.h" | 40 #include "modules/permissions/PermissionUtils.h" |
| 41 #include "platform/wtf/Assertions.h" | 41 #include "platform/wtf/Assertions.h" |
| 42 #include "platform/wtf/CurrentTime.h" | 42 #include "platform/wtf/CurrentTime.h" |
| 43 #include "public/platform/Platform.h" | 43 #include "public/platform/Platform.h" |
| 44 #include "public/platform/WebFeaturePolicyFeature.h" |
| 44 #include "services/service_manager/public/cpp/interface_provider.h" | 45 #include "services/service_manager/public/cpp/interface_provider.h" |
| 45 | 46 |
| 46 namespace blink { | 47 namespace blink { |
| 47 namespace { | 48 namespace { |
| 48 | 49 |
| 49 const char kPermissionDeniedErrorMessage[] = "User denied Geolocation"; | 50 const char kPermissionDeniedErrorMessage[] = "User denied Geolocation"; |
| 50 const char kFailedToStartServiceErrorMessage[] = | 51 const char kFailedToStartServiceErrorMessage[] = |
| 51 "Failed to start Geolocation service"; | 52 "Failed to start Geolocation service"; |
| 52 const char kFramelessDocumentErrorMessage[] = | 53 const char kFramelessDocumentErrorMessage[] = |
| 53 "Geolocation cannot be used in frameless documents"; | 54 "Geolocation cannot be used in frameless documents"; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 DCHECK(document); | 145 DCHECK(document); |
| 145 | 146 |
| 146 // It is required by isSecureContext() but isn't | 147 // It is required by isSecureContext() but isn't |
| 147 // actually used. This could be used later if a warning is shown in the | 148 // actually used. This could be used later if a warning is shown in the |
| 148 // developer console. | 149 // developer console. |
| 149 String insecure_origin_msg; | 150 String insecure_origin_msg; |
| 150 if (document->IsSecureContext(insecure_origin_msg)) { | 151 if (document->IsSecureContext(insecure_origin_msg)) { |
| 151 UseCounter::Count(document, WebFeature::kGeolocationSecureOrigin); | 152 UseCounter::Count(document, WebFeature::kGeolocationSecureOrigin); |
| 152 UseCounter::CountCrossOriginIframe( | 153 UseCounter::CountCrossOriginIframe( |
| 153 *document, WebFeature::kGeolocationSecureOriginIframe); | 154 *document, WebFeature::kGeolocationSecureOriginIframe); |
| 155 Deprecation::CountDeprecationFeaturePolicy( |
| 156 *document, WebFeaturePolicyFeature::kGeolocation); |
| 154 } else if (GetFrame() | 157 } else if (GetFrame() |
| 155 ->GetSettings() | 158 ->GetSettings() |
| 156 ->GetAllowGeolocationOnInsecureOrigins()) { | 159 ->GetAllowGeolocationOnInsecureOrigins()) { |
| 157 // TODO(jww): This should be removed after WebView is fixed so that it | 160 // TODO(jww): This should be removed after WebView is fixed so that it |
| 158 // disallows geolocation in insecure contexts. | 161 // disallows geolocation in insecure contexts. |
| 159 // | 162 // |
| 160 // See https://crbug.com/603574. | 163 // See https://crbug.com/603574. |
| 161 Deprecation::CountDeprecation( | 164 Deprecation::CountDeprecation( |
| 162 document, WebFeature::kGeolocationInsecureOriginDeprecatedNotRemoved); | 165 document, WebFeature::kGeolocationInsecureOriginDeprecatedNotRemoved); |
| 163 Deprecation::CountDeprecationCrossOriginIframe( | 166 Deprecation::CountDeprecationCrossOriginIframe( |
| 164 *document, | 167 *document, |
| 165 WebFeature::kGeolocationInsecureOriginIframeDeprecatedNotRemoved); | 168 WebFeature::kGeolocationInsecureOriginIframeDeprecatedNotRemoved); |
| 166 HostsUsingFeatures::CountAnyWorld( | 169 HostsUsingFeatures::CountAnyWorld( |
| 167 *document, HostsUsingFeatures::Feature::kGeolocationInsecureHost); | 170 *document, HostsUsingFeatures::Feature::kGeolocationInsecureHost); |
| 171 Deprecation::CountDeprecationFeaturePolicy( |
| 172 *document, WebFeaturePolicyFeature::kGeolocation); |
| 168 } else { | 173 } else { |
| 169 Deprecation::CountDeprecation(document, | 174 Deprecation::CountDeprecation(document, |
| 170 WebFeature::kGeolocationInsecureOrigin); | 175 WebFeature::kGeolocationInsecureOrigin); |
| 171 Deprecation::CountDeprecationCrossOriginIframe( | 176 Deprecation::CountDeprecationCrossOriginIframe( |
| 172 *document, WebFeature::kGeolocationInsecureOriginIframe); | 177 *document, WebFeature::kGeolocationInsecureOriginIframe); |
| 173 HostsUsingFeatures::CountAnyWorld( | 178 HostsUsingFeatures::CountAnyWorld( |
| 174 *document, HostsUsingFeatures::Feature::kGeolocationInsecureHost); | 179 *document, HostsUsingFeatures::Feature::kGeolocationInsecureHost); |
| 175 } | 180 } |
| 176 } | 181 } |
| 177 | 182 |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 PositionError::kPositionUnavailable, kFailedToStartServiceErrorMessage); | 560 PositionError::kPositionUnavailable, kFailedToStartServiceErrorMessage); |
| 556 error->SetIsFatal(true); | 561 error->SetIsFatal(true); |
| 557 HandleError(error); | 562 HandleError(error); |
| 558 } | 563 } |
| 559 | 564 |
| 560 void Geolocation::OnPermissionConnectionError() { | 565 void Geolocation::OnPermissionConnectionError() { |
| 561 OnGeolocationPermissionUpdated(mojom::blink::PermissionStatus::DENIED); | 566 OnGeolocationPermissionUpdated(mojom::blink::PermissionStatus::DENIED); |
| 562 } | 567 } |
| 563 | 568 |
| 564 } // namespace blink | 569 } // namespace blink |
| OLD | NEW |