| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 #include "core/probe/CoreProbes.h" | 112 #include "core/probe/CoreProbes.h" |
| 113 #include "core/svg/SVGImageElement.h" | 113 #include "core/svg/SVGImageElement.h" |
| 114 #include "core/testing/CallbackFunctionTest.h" | 114 #include "core/testing/CallbackFunctionTest.h" |
| 115 #include "core/testing/DictionaryTest.h" | 115 #include "core/testing/DictionaryTest.h" |
| 116 #include "core/testing/GCObservation.h" | 116 #include "core/testing/GCObservation.h" |
| 117 #include "core/testing/InternalRuntimeFlags.h" | 117 #include "core/testing/InternalRuntimeFlags.h" |
| 118 #include "core/testing/InternalSettings.h" | 118 #include "core/testing/InternalSettings.h" |
| 119 #include "core/testing/LayerRect.h" | 119 #include "core/testing/LayerRect.h" |
| 120 #include "core/testing/LayerRectList.h" | 120 #include "core/testing/LayerRectList.h" |
| 121 #include "core/testing/MockHyphenation.h" | 121 #include "core/testing/MockHyphenation.h" |
| 122 #include "core/testing/NetInfo.h" |
| 122 #include "core/testing/OriginTrialsTest.h" | 123 #include "core/testing/OriginTrialsTest.h" |
| 123 #include "core/testing/RecordTest.h" | 124 #include "core/testing/RecordTest.h" |
| 124 #include "core/testing/SequenceTest.h" | 125 #include "core/testing/SequenceTest.h" |
| 125 #include "core/testing/TypeConversions.h" | 126 #include "core/testing/TypeConversions.h" |
| 126 #include "core/testing/UnionTypesTest.h" | 127 #include "core/testing/UnionTypesTest.h" |
| 127 #include "core/workers/WorkerThread.h" | 128 #include "core/workers/WorkerThread.h" |
| 128 #include "gpu/command_buffer/client/gles2_interface.h" | 129 #include "gpu/command_buffer/client/gles2_interface.h" |
| 129 #include "platform/Cursor.h" | 130 #include "platform/Cursor.h" |
| 130 #include "platform/InstanceCounters.h" | 131 #include "platform/InstanceCounters.h" |
| 131 #include "platform/Language.h" | 132 #include "platform/Language.h" |
| (...skipping 2946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3078 } else if (type == "none") { | 3079 } else if (type == "none") { |
| 3079 webtype = kWebConnectionTypeNone; | 3080 webtype = kWebConnectionTypeNone; |
| 3080 } else if (type == "unknown") { | 3081 } else if (type == "unknown") { |
| 3081 webtype = kWebConnectionTypeUnknown; | 3082 webtype = kWebConnectionTypeUnknown; |
| 3082 } else { | 3083 } else { |
| 3083 exception_state.ThrowDOMException( | 3084 exception_state.ThrowDOMException( |
| 3084 kNotFoundError, | 3085 kNotFoundError, |
| 3085 ExceptionMessages::FailedToEnumerate("connection type", type)); | 3086 ExceptionMessages::FailedToEnumerate("connection type", type)); |
| 3086 return; | 3087 return; |
| 3087 } | 3088 } |
| 3088 GetNetworkStateNotifier().SetOverride(on_line, webtype, downlink_max_mbps); | 3089 GetNetworkStateNotifier().SetNetworkConnectionInfoOverride(on_line, webtype, |
| 3090 downlink_max_mbps); |
| 3091 } |
| 3092 |
| 3093 void Internals::setNetworkQualityInfoOverride(const String& effective_type, |
| 3094 unsigned long transport_rtt_msec, |
| 3095 double downlink_throughput_mbps, |
| 3096 ExceptionState& exception_state) { |
| 3097 WebEffectiveConnectionType web_effective_type = |
| 3098 WebEffectiveConnectionType::kTypeUnknown; |
| 3099 if (effective_type == "offline") { |
| 3100 web_effective_type = WebEffectiveConnectionType::kTypeOffline; |
| 3101 } else if (effective_type == "slow-2g") { |
| 3102 web_effective_type = WebEffectiveConnectionType::kTypeSlow2G; |
| 3103 } else if (effective_type == "2g") { |
| 3104 web_effective_type = WebEffectiveConnectionType::kType2G; |
| 3105 } else if (effective_type == "3g") { |
| 3106 web_effective_type = WebEffectiveConnectionType::kType3G; |
| 3107 } else if (effective_type == "4g") { |
| 3108 web_effective_type = WebEffectiveConnectionType::kType4G; |
| 3109 } else if (effective_type != "unknown") { |
| 3110 exception_state.ThrowDOMException( |
| 3111 kNotFoundError, ExceptionMessages::FailedToEnumerate( |
| 3112 "effective connection type", effective_type)); |
| 3113 return; |
| 3114 } |
| 3115 |
| 3116 GetNetworkStateNotifier().SetNetworkQualityInfoOverride( |
| 3117 web_effective_type, transport_rtt_msec, downlink_throughput_mbps); |
| 3089 } | 3118 } |
| 3090 | 3119 |
| 3091 void Internals::clearNetworkConnectionInfoOverride() { | 3120 void Internals::clearNetworkConnectionInfoOverride() { |
| 3092 GetNetworkStateNotifier().ClearOverride(); | 3121 GetNetworkStateNotifier().ClearOverride(); |
| 3093 } | 3122 } |
| 3094 | 3123 |
| 3095 unsigned Internals::countHitRegions(CanvasRenderingContext* context) { | 3124 unsigned Internals::countHitRegions(CanvasRenderingContext* context) { |
| 3096 return context->HitRegionsCount(); | 3125 return context->HitRegionsCount(); |
| 3097 } | 3126 } |
| 3098 | 3127 |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3290 | 3319 |
| 3291 void Internals::crash() { | 3320 void Internals::crash() { |
| 3292 CHECK(false) << "Intentional crash"; | 3321 CHECK(false) << "Intentional crash"; |
| 3293 } | 3322 } |
| 3294 | 3323 |
| 3295 void Internals::setIsLowEndDevice(bool is_low_end_device) { | 3324 void Internals::setIsLowEndDevice(bool is_low_end_device) { |
| 3296 MemoryCoordinator::SetIsLowEndDeviceForTesting(is_low_end_device); | 3325 MemoryCoordinator::SetIsLowEndDeviceForTesting(is_low_end_device); |
| 3297 } | 3326 } |
| 3298 | 3327 |
| 3299 } // namespace blink | 3328 } // namespace blink |
| OLD | NEW |