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

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

Issue 2811863002: Move ScriptState::GetExecutionContext (Part 4) (Closed)
Patch Set: Fix Document.cpp Created 3 years, 8 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) 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 return promise; 123 return promise;
124 } 124 }
125 125
126 ScriptPromise ImageBitmapFactories::createImageBitmap( 126 ScriptPromise ImageBitmapFactories::createImageBitmap(
127 ScriptState* script_state, 127 ScriptState* script_state,
128 EventTarget& event_target, 128 EventTarget& event_target,
129 const ImageBitmapSourceUnion& bitmap_source, 129 const ImageBitmapSourceUnion& bitmap_source,
130 const ImageBitmapOptions& options, 130 const ImageBitmapOptions& options,
131 ExceptionState& exception_state) { 131 ExceptionState& exception_state) {
132 UseCounter::Feature feature = UseCounter::kCreateImageBitmap; 132 UseCounter::Feature feature = UseCounter::kCreateImageBitmap;
133 UseCounter::Count(script_state->GetExecutionContext(), feature); 133 UseCounter::Count(ExecutionContext::From(script_state), feature);
134 ImageBitmapSource* bitmap_source_internal = ToImageBitmapSourceInternal( 134 ImageBitmapSource* bitmap_source_internal = ToImageBitmapSourceInternal(
135 bitmap_source, exception_state, options, false); 135 bitmap_source, exception_state, options, false);
136 if (!bitmap_source_internal) 136 if (!bitmap_source_internal)
137 return ScriptPromise(); 137 return ScriptPromise();
138 return createImageBitmap(script_state, event_target, bitmap_source_internal, 138 return createImageBitmap(script_state, event_target, bitmap_source_internal,
139 Optional<IntRect>(), options, exception_state); 139 Optional<IntRect>(), options, exception_state);
140 } 140 }
141 141
142 ScriptPromise ImageBitmapFactories::createImageBitmap( 142 ScriptPromise ImageBitmapFactories::createImageBitmap(
143 ScriptState* script_state, 143 ScriptState* script_state,
144 EventTarget& event_target, 144 EventTarget& event_target,
145 const ImageBitmapSourceUnion& bitmap_source, 145 const ImageBitmapSourceUnion& bitmap_source,
146 int sx, 146 int sx,
147 int sy, 147 int sy,
148 int sw, 148 int sw,
149 int sh, 149 int sh,
150 const ImageBitmapOptions& options, 150 const ImageBitmapOptions& options,
151 ExceptionState& exception_state) { 151 ExceptionState& exception_state) {
152 UseCounter::Feature feature = UseCounter::kCreateImageBitmap; 152 UseCounter::Feature feature = UseCounter::kCreateImageBitmap;
153 UseCounter::Count(script_state->GetExecutionContext(), feature); 153 UseCounter::Count(ExecutionContext::From(script_state), feature);
154 ImageBitmapSource* bitmap_source_internal = ToImageBitmapSourceInternal( 154 ImageBitmapSource* bitmap_source_internal = ToImageBitmapSourceInternal(
155 bitmap_source, exception_state, options, true); 155 bitmap_source, exception_state, options, true);
156 if (!bitmap_source_internal) 156 if (!bitmap_source_internal)
157 return ScriptPromise(); 157 return ScriptPromise();
158 Optional<IntRect> crop_rect = IntRect(sx, sy, sw, sh); 158 Optional<IntRect> crop_rect = IntRect(sx, sy, sw, sh);
159 return createImageBitmap(script_state, event_target, bitmap_source_internal, 159 return createImageBitmap(script_state, event_target, bitmap_source_internal,
160 crop_rect, options, exception_state); 160 crop_rect, options, exception_state);
161 } 161 }
162 162
163 ScriptPromise ImageBitmapFactories::createImageBitmap( 163 ScriptPromise ImageBitmapFactories::createImageBitmap(
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 } 313 }
314 factory_->DidFinishLoading(this); 314 factory_->DidFinishLoading(this);
315 } 315 }
316 316
317 DEFINE_TRACE(ImageBitmapFactories::ImageBitmapLoader) { 317 DEFINE_TRACE(ImageBitmapFactories::ImageBitmapLoader) {
318 visitor->Trace(factory_); 318 visitor->Trace(factory_);
319 visitor->Trace(resolver_); 319 visitor->Trace(resolver_);
320 } 320 }
321 321
322 } // namespace blink 322 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/FormData.cpp ('k') | third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698