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

Side by Side Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
OLDNEW
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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 #include "platform/graphics/GraphicsLayer.h" 138 #include "platform/graphics/GraphicsLayer.h"
139 #include "platform/heap/Handle.h" 139 #include "platform/heap/Handle.h"
140 #include "platform/inspector_protocol/FrontendChannel.h" 140 #include "platform/inspector_protocol/FrontendChannel.h"
141 #include "platform/scroll/ProgrammaticScrollAnimator.h" 141 #include "platform/scroll/ProgrammaticScrollAnimator.h"
142 #include "platform/weborigin/SchemeRegistry.h" 142 #include "platform/weborigin/SchemeRegistry.h"
143 #include "public/platform/Platform.h" 143 #include "public/platform/Platform.h"
144 #include "public/platform/WebConnectionType.h" 144 #include "public/platform/WebConnectionType.h"
145 #include "public/platform/WebGraphicsContext3DProvider.h" 145 #include "public/platform/WebGraphicsContext3DProvider.h"
146 #include "public/platform/WebLayer.h" 146 #include "public/platform/WebLayer.h"
147 #include "wtf/InstanceCounter.h" 147 #include "wtf/InstanceCounter.h"
148 #include "wtf/PtrUtil.h" 148 #include "wtf/PassOwnPtr.h"
149 #include "wtf/dtoa.h" 149 #include "wtf/dtoa.h"
150 #include "wtf/text/StringBuffer.h" 150 #include "wtf/text/StringBuffer.h"
151 #include <deque> 151 #include <deque>
152 #include <memory>
153 #include <v8.h> 152 #include <v8.h>
154 153
155 namespace blink { 154 namespace blink {
156 155
157 namespace { 156 namespace {
158 157
159 class InternalsIterationSource final : public ValueIterable<int>::IterationSourc e { 158 class InternalsIterationSource final : public ValueIterable<int>::IterationSourc e {
160 public: 159 public:
161 bool next(ScriptState* scriptState, int& value, ExceptionState& exceptionSta te) override 160 bool next(ScriptState* scriptState, int& value, ExceptionState& exceptionSta te) override
162 { 161 {
(...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after
1467 } 1466 }
1468 1467
1469 AtomicString Internals::htmlNamespace() 1468 AtomicString Internals::htmlNamespace()
1470 { 1469 {
1471 return HTMLNames::xhtmlNamespaceURI; 1470 return HTMLNames::xhtmlNamespaceURI;
1472 } 1471 }
1473 1472
1474 Vector<AtomicString> Internals::htmlTags() 1473 Vector<AtomicString> Internals::htmlTags()
1475 { 1474 {
1476 Vector<AtomicString> tags(HTMLNames::HTMLTagsCount); 1475 Vector<AtomicString> tags(HTMLNames::HTMLTagsCount);
1477 std::unique_ptr<const HTMLQualifiedName*[]> qualifiedNames = HTMLNames::getH TMLTags(); 1476 OwnPtr<const HTMLQualifiedName*[]> qualifiedNames = HTMLNames::getHTMLTags() ;
1478 for (size_t i = 0; i < HTMLNames::HTMLTagsCount; ++i) 1477 for (size_t i = 0; i < HTMLNames::HTMLTagsCount; ++i)
1479 tags[i] = qualifiedNames[i]->localName(); 1478 tags[i] = qualifiedNames[i]->localName();
1480 return tags; 1479 return tags;
1481 } 1480 }
1482 1481
1483 AtomicString Internals::svgNamespace() 1482 AtomicString Internals::svgNamespace()
1484 { 1483 {
1485 return SVGNames::svgNamespaceURI; 1484 return SVGNames::svgNamespaceURI;
1486 } 1485 }
1487 1486
1488 Vector<AtomicString> Internals::svgTags() 1487 Vector<AtomicString> Internals::svgTags()
1489 { 1488 {
1490 Vector<AtomicString> tags(SVGNames::SVGTagsCount); 1489 Vector<AtomicString> tags(SVGNames::SVGTagsCount);
1491 std::unique_ptr<const SVGQualifiedName*[]> qualifiedNames = SVGNames::getSVG Tags(); 1490 OwnPtr<const SVGQualifiedName*[]> qualifiedNames = SVGNames::getSVGTags();
1492 for (size_t i = 0; i < SVGNames::SVGTagsCount; ++i) 1491 for (size_t i = 0; i < SVGNames::SVGTagsCount; ++i)
1493 tags[i] = qualifiedNames[i]->localName(); 1492 tags[i] = qualifiedNames[i]->localName();
1494 return tags; 1493 return tags;
1495 } 1494 }
1496 1495
1497 StaticNodeList* Internals::nodesFromRect(Document* document, int centerX, int ce nterY, unsigned topPadding, unsigned rightPadding, 1496 StaticNodeList* Internals::nodesFromRect(Document* document, int centerX, int ce nterY, unsigned topPadding, unsigned rightPadding,
1498 unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allo wChildFrameContent, ExceptionState& exceptionState) const 1497 unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allo wChildFrameContent, ExceptionState& exceptionState) const
1499 { 1498 {
1500 ASSERT(document); 1499 ASSERT(document);
1501 if (!document->frame() || !document->frame()->view()) { 1500 if (!document->frame() || !document->frame()->view()) {
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
2213 } 2212 }
2214 2213
2215 void Internals::resetTypeAheadSession(HTMLSelectElement* select) 2214 void Internals::resetTypeAheadSession(HTMLSelectElement* select)
2216 { 2215 {
2217 ASSERT(select); 2216 ASSERT(select);
2218 select->resetTypeAheadSessionForTesting(); 2217 select->resetTypeAheadSessionForTesting();
2219 } 2218 }
2220 2219
2221 bool Internals::loseSharedGraphicsContext3D() 2220 bool Internals::loseSharedGraphicsContext3D()
2222 { 2221 {
2223 std::unique_ptr<WebGraphicsContext3DProvider> sharedProvider = wrapUnique(Pl atform::current()->createSharedOffscreenGraphicsContext3DProvider()); 2222 OwnPtr<WebGraphicsContext3DProvider> sharedProvider = adoptPtr(Platform::cur rent()->createSharedOffscreenGraphicsContext3DProvider());
2224 if (!sharedProvider) 2223 if (!sharedProvider)
2225 return false; 2224 return false;
2226 gpu::gles2::GLES2Interface* sharedGL = sharedProvider->contextGL(); 2225 gpu::gles2::GLES2Interface* sharedGL = sharedProvider->contextGL();
2227 sharedGL->LoseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_EXT, GL_INNOCENT_CONTE XT_RESET_EXT); 2226 sharedGL->LoseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_EXT, GL_INNOCENT_CONTE XT_RESET_EXT);
2228 // To prevent tests that call loseSharedGraphicsContext3D from being 2227 // To prevent tests that call loseSharedGraphicsContext3D from being
2229 // flaky, we call finish so that the context is guaranteed to be lost 2228 // flaky, we call finish so that the context is guaranteed to be lost
2230 // synchronously (i.e. before returning). 2229 // synchronously (i.e. before returning).
2231 sharedGL->Finish(); 2230 sharedGL->Finish();
2232 return true; 2231 return true;
2233 } 2232 }
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
2565 } 2564 }
2566 2565
2567 String Internals::getProgrammaticScrollAnimationState(Node* node) const 2566 String Internals::getProgrammaticScrollAnimationState(Node* node) const
2568 { 2567 {
2569 if (ScrollableArea* scrollableArea = scrollableAreaForNode(node)) 2568 if (ScrollableArea* scrollableArea = scrollableAreaForNode(node))
2570 return scrollableArea->programmaticScrollAnimator().runStateAsText(); 2569 return scrollableArea->programmaticScrollAnimator().runStateAsText();
2571 return String(); 2570 return String();
2572 } 2571 }
2573 2572
2574 } // namespace blink 2573 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698