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

Side by Side Diff: third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp

Issue 1773813007: blink: Rename modules/ method to prefix with get when they collide. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clash-modules: rebase-fixes Created 4 years, 9 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/offscreencanvas/OffscreenCanvas.h" 5 #include "modules/offscreencanvas/OffscreenCanvas.h"
6 6
7 #include "core/html/canvas/CanvasContextCreationAttributes.h" 7 #include "core/html/canvas/CanvasContextCreationAttributes.h"
8 #include "modules/offscreencanvas/OffscreenCanvasRenderingContext.h" 8 #include "modules/offscreencanvas/OffscreenCanvasRenderingContext.h"
9 #include "modules/offscreencanvas/OffscreenCanvasRenderingContextFactory.h" 9 #include "modules/offscreencanvas/OffscreenCanvasRenderingContextFactory.h"
10 #include "modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h" 10 #include "modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h"
(...skipping 27 matching lines...) Expand all
38 38
39 // Unknown type. 39 // Unknown type.
40 if (contextType == OffscreenCanvasRenderingContext::ContextTypeCount) 40 if (contextType == OffscreenCanvasRenderingContext::ContextTypeCount)
41 return nullptr; 41 return nullptr;
42 42
43 OffscreenCanvasRenderingContextFactory* factory = getRenderingContextFactory (contextType); 43 OffscreenCanvasRenderingContextFactory* factory = getRenderingContextFactory (contextType);
44 if (!factory) 44 if (!factory)
45 return nullptr; 45 return nullptr;
46 46
47 if (m_context) { 47 if (m_context) {
48 if (m_context->contextType() != contextType) { 48 if (m_context->getContextType() != contextType) {
49 factory->onError(this, "OffscreenCanvas has an existing context of a different type"); 49 factory->onError(this, "OffscreenCanvas has an existing context of a different type");
50 return nullptr; 50 return nullptr;
51 } 51 }
52 } else { 52 } else {
53 m_context = factory->create(this, attributes); 53 m_context = factory->create(this, attributes);
54 } 54 }
55 55
56 // TODO: When there're more than one context type implemented in the future, 56 // TODO: When there're more than one context type implemented in the future,
57 // the return type here should be changed to base class of all Offscreen 57 // the return type here should be changed to base class of all Offscreen
58 // context types. 58 // context types.
(...skipping 15 matching lines...) Expand all
74 } 74 }
75 75
76 OffscreenCanvasRenderingContextFactory* OffscreenCanvas::getRenderingContextFact ory(int type) 76 OffscreenCanvasRenderingContextFactory* OffscreenCanvas::getRenderingContextFact ory(int type)
77 { 77 {
78 ASSERT(type < OffscreenCanvasRenderingContext::ContextTypeCount); 78 ASSERT(type < OffscreenCanvasRenderingContext::ContextTypeCount);
79 return renderingContextFactories()[type].get(); 79 return renderingContextFactories()[type].get();
80 } 80 }
81 81
82 void OffscreenCanvas::registerRenderingContextFactory(PassOwnPtr<OffscreenCanvas RenderingContextFactory> renderingContextFactory) 82 void OffscreenCanvas::registerRenderingContextFactory(PassOwnPtr<OffscreenCanvas RenderingContextFactory> renderingContextFactory)
83 { 83 {
84 OffscreenCanvasRenderingContext::ContextType type = renderingContextFactory- >contextType(); 84 OffscreenCanvasRenderingContext::ContextType type = renderingContextFactory- >getContextType();
85 ASSERT(type < OffscreenCanvasRenderingContext::ContextTypeCount); 85 ASSERT(type < OffscreenCanvasRenderingContext::ContextTypeCount);
86 ASSERT(!renderingContextFactories()[type]); 86 ASSERT(!renderingContextFactories()[type]);
87 renderingContextFactories()[type] = renderingContextFactory; 87 renderingContextFactories()[type] = renderingContextFactory;
88 } 88 }
89 89
90 DEFINE_TRACE(OffscreenCanvas) 90 DEFINE_TRACE(OffscreenCanvas)
91 { 91 {
92 visitor->trace(m_context); 92 visitor->trace(m_context);
93 } 93 }
94 94
95 } // namespace blink 95 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698