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

Side by Side Diff: third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.h

Issue 2122273002: Merge some repeated code in ImageBitmapFactories into a helper function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, Google Inc. All rights reserved. 2 * Copyright (c) 2013, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 class WebTaskRunner; 55 class WebTaskRunner;
56 56
57 typedef HTMLImageElementOrHTMLVideoElementOrHTMLCanvasElementOrBlobOrImageDataOr ImageBitmap ImageBitmapSourceUnion; 57 typedef HTMLImageElementOrHTMLVideoElementOrHTMLCanvasElementOrBlobOrImageDataOr ImageBitmap ImageBitmapSourceUnion;
58 58
59 class ImageBitmapFactories final : public GarbageCollectedFinalized<ImageBitmapF actories>, public Supplement<LocalDOMWindow>, public Supplement<WorkerGlobalScop e> { 59 class ImageBitmapFactories final : public GarbageCollectedFinalized<ImageBitmapF actories>, public Supplement<LocalDOMWindow>, public Supplement<WorkerGlobalScop e> {
60 USING_GARBAGE_COLLECTED_MIXIN(ImageBitmapFactories); 60 USING_GARBAGE_COLLECTED_MIXIN(ImageBitmapFactories);
61 public: 61 public:
62 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, const Ima geBitmapSourceUnion&, const ImageBitmapOptions&, ExceptionState&); 62 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, const Ima geBitmapSourceUnion&, const ImageBitmapOptions&, ExceptionState&);
63 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, const Ima geBitmapSourceUnion&, int sx, int sy, int sw, int sh, const ImageBitmapOptions&, ExceptionState&); 63 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, const Ima geBitmapSourceUnion&, int sx, int sy, int sw, int sh, const ImageBitmapOptions&, ExceptionState&);
64 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, ImageBitm apSource*, int sx, int sy, int sw, int sh, const ImageBitmapOptions&, ExceptionS tate&); 64 static ScriptPromise createImageBitmap(ScriptState*, EventTarget&, ImageBitm apSource*, int sx, int sy, int sw, int sh, const ImageBitmapOptions&, ExceptionS tate&);
65 static ScriptPromise createImageBitmapFromBlob(ScriptState*, EventTarget&, I mageBitmapSource*, const IntRect&, const ImageBitmapOptions&);
65 66
66 virtual ~ImageBitmapFactories() { } 67 virtual ~ImageBitmapFactories() { }
67 68
68 DECLARE_TRACE(); 69 DECLARE_TRACE();
69 70
70 protected: 71 protected:
71 static const char* supplementName(); 72 static const char* supplementName();
72 73
73 private: 74 private:
74 class ImageBitmapLoader final : public GarbageCollectedFinalized<ImageBitmap Loader>, public FileReaderLoaderClient { 75 class ImageBitmapLoader final : public GarbageCollectedFinalized<ImageBitmap Loader>, public FileReaderLoaderClient {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 115
115 void addLoader(ImageBitmapLoader*); 116 void addLoader(ImageBitmapLoader*);
116 void didFinishLoading(ImageBitmapLoader*); 117 void didFinishLoading(ImageBitmapLoader*);
117 118
118 HeapHashSet<Member<ImageBitmapLoader>> m_pendingLoaders; 119 HeapHashSet<Member<ImageBitmapLoader>> m_pendingLoaders;
119 }; 120 };
120 121
121 } // namespace blink 122 } // namespace blink
122 123
123 #endif // ImageBitmapFactories_h 124 #endif // ImageBitmapFactories_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698