Chromium Code Reviews| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 #include "core/inspector/InspectorCounters.h" | 98 #include "core/inspector/InspectorCounters.h" |
| 99 #include "core/inspector/InspectorFrontendChannel.h" | 99 #include "core/inspector/InspectorFrontendChannel.h" |
| 100 #include "core/inspector/InspectorInstrumentation.h" | 100 #include "core/inspector/InspectorInstrumentation.h" |
| 101 #include "core/inspector/InspectorOverlay.h" | 101 #include "core/inspector/InspectorOverlay.h" |
| 102 #include "core/inspector/InstrumentingAgents.h" | 102 #include "core/inspector/InstrumentingAgents.h" |
| 103 #include "core/loader/FrameLoader.h" | 103 #include "core/loader/FrameLoader.h" |
| 104 #include "core/loader/HistoryItem.h" | 104 #include "core/loader/HistoryItem.h" |
| 105 #include "core/page/Chrome.h" | 105 #include "core/page/Chrome.h" |
| 106 #include "core/page/ChromeClient.h" | 106 #include "core/page/ChromeClient.h" |
| 107 #include "core/page/EventHandler.h" | 107 #include "core/page/EventHandler.h" |
| 108 #include "core/page/NetworkStateNotifier.h" | |
| 108 #include "core/page/Page.h" | 109 #include "core/page/Page.h" |
| 109 #include "core/page/PagePopupController.h" | 110 #include "core/page/PagePopupController.h" |
| 110 #include "core/page/PrintContext.h" | 111 #include "core/page/PrintContext.h" |
| 111 #include "core/rendering/RenderLayer.h" | 112 #include "core/rendering/RenderLayer.h" |
| 112 #include "core/rendering/RenderMenuList.h" | 113 #include "core/rendering/RenderMenuList.h" |
| 113 #include "core/rendering/RenderObject.h" | 114 #include "core/rendering/RenderObject.h" |
| 114 #include "core/rendering/RenderTreeAsText.h" | 115 #include "core/rendering/RenderTreeAsText.h" |
| 115 #include "core/rendering/RenderView.h" | 116 #include "core/rendering/RenderView.h" |
| 116 #include "core/rendering/compositing/CompositedLayerMapping.h" | 117 #include "core/rendering/compositing/CompositedLayerMapping.h" |
| 117 #include "core/rendering/compositing/RenderLayerCompositor.h" | 118 #include "core/rendering/compositing/RenderLayerCompositor.h" |
| 118 #include "core/testing/GCObservation.h" | 119 #include "core/testing/GCObservation.h" |
| 119 #include "core/workers/WorkerThread.h" | 120 #include "core/workers/WorkerThread.h" |
| 120 #include "platform/ColorChooser.h" | 121 #include "platform/ColorChooser.h" |
| 121 #include "platform/Cursor.h" | 122 #include "platform/Cursor.h" |
| 122 #include "platform/Language.h" | 123 #include "platform/Language.h" |
| 123 #include "platform/TraceEvent.h" | 124 #include "platform/TraceEvent.h" |
| 124 #include "platform/geometry/IntRect.h" | 125 #include "platform/geometry/IntRect.h" |
| 125 #include "platform/geometry/LayoutRect.h" | 126 #include "platform/geometry/LayoutRect.h" |
| 126 #include "platform/graphics/GraphicsLayer.h" | 127 #include "platform/graphics/GraphicsLayer.h" |
| 127 #include "platform/graphics/filters/FilterOperation.h" | 128 #include "platform/graphics/filters/FilterOperation.h" |
| 128 #include "platform/graphics/filters/FilterOperations.h" | 129 #include "platform/graphics/filters/FilterOperations.h" |
| 129 #include "platform/weborigin/SchemeRegistry.h" | 130 #include "platform/weborigin/SchemeRegistry.h" |
| 130 #include "public/platform/Platform.h" | 131 #include "public/platform/Platform.h" |
| 132 #include "public/platform/WebConnectionType.h" | |
| 131 #include "public/platform/WebGraphicsContext3D.h" | 133 #include "public/platform/WebGraphicsContext3D.h" |
| 132 #include "public/platform/WebGraphicsContext3DProvider.h" | 134 #include "public/platform/WebGraphicsContext3DProvider.h" |
| 133 #include "public/platform/WebLayer.h" | 135 #include "public/platform/WebLayer.h" |
| 134 #include "wtf/InstanceCounter.h" | 136 #include "wtf/InstanceCounter.h" |
| 135 #include "wtf/PassOwnPtr.h" | 137 #include "wtf/PassOwnPtr.h" |
| 136 #include "wtf/dtoa.h" | 138 #include "wtf/dtoa.h" |
| 137 #include "wtf/text/StringBuffer.h" | 139 #include "wtf/text/StringBuffer.h" |
| 138 | 140 |
| 139 namespace WebCore { | 141 namespace WebCore { |
| 140 | 142 |
| (...skipping 2186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2327 | 2329 |
| 2328 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma xLength) | 2330 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma xLength) |
| 2329 { | 2331 { |
| 2330 if (!node) | 2332 if (!node) |
| 2331 return String(); | 2333 return String(); |
| 2332 blink::WebPoint point(x, y); | 2334 blink::WebPoint point(x, y); |
| 2333 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo rPoint(static_cast<IntPoint>(point))), maxLength); | 2335 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo rPoint(static_cast<IntPoint>(point))), maxLength); |
| 2334 return surroundingText.content(); | 2336 return surroundingText.content(); |
| 2335 } | 2337 } |
| 2336 | 2338 |
| 2339 void Internals::setNetworkConnectionInfo(const String& type, ExceptionState& exc eptionState) | |
| 2340 { | |
| 2341 blink::WebConnectionType webtype; | |
| 2342 if (type == "cellular") { | |
| 2343 webtype = blink::ConnectionTypeCellular; | |
| 2344 } else if (type == "bluetooth") { | |
| 2345 webtype = blink::ConnectionTypeBluetooth; | |
| 2346 } else if (type == "ethernet") { | |
| 2347 webtype = blink::ConnectionTypeEthernet; | |
| 2348 } else if (type == "wifi") { | |
| 2349 webtype = blink::ConnectionTypeWifi; | |
| 2350 } else if (type == "other") { | |
| 2351 webtype = blink::ConnectionTypeOther; | |
| 2352 } else if (type == "none") { | |
| 2353 webtype = blink::ConnectionTypeNone; | |
| 2354 } else { | |
| 2355 exceptionState.throwDOMException(NotFoundError, ExceptionMessages::faile dToEnumerate("connection type", type)); | |
| 2356 return; | |
| 2357 } | |
| 2358 networkStateNotifier().setWebConnectionType(webtype); | |
|
adamk
2014/05/22 15:40:32
It looks to me like this might leak state between
jkarlin
2014/05/22 17:38:02
Good point that it changes state between runs. On
adamk
2014/05/23 22:33:57
Not sure what you mean by "One would expect the ne
| |
| 2337 } | 2359 } |
| 2360 } | |
|
adamk
2014/05/22 15:40:32
Nit: Please add a blank line between these two bra
jkarlin
2014/05/22 17:38:02
Done.
| |
| OLD | NEW |