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

Side by Side Diff: Source/core/html/HTMLCanvasElement.cpp

Issue 72363002: Rename es => exceptionState in other than bindings/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Retry Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLCanvasElement.h ('k') | Source/core/html/HTMLDialogElement.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) 2004, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 { 363 {
364 String lowercaseMimeType = mimeType.lower(); 364 String lowercaseMimeType = mimeType.lower();
365 365
366 // FIXME: Make isSupportedImageMIMETypeForEncoding threadsafe (to allow this method to be used on a worker thread). 366 // FIXME: Make isSupportedImageMIMETypeForEncoding threadsafe (to allow this method to be used on a worker thread).
367 if (mimeType.isNull() || !MIMETypeRegistry::isSupportedImageMIMETypeForEncod ing(lowercaseMimeType)) 367 if (mimeType.isNull() || !MIMETypeRegistry::isSupportedImageMIMETypeForEncod ing(lowercaseMimeType))
368 lowercaseMimeType = "image/png"; 368 lowercaseMimeType = "image/png";
369 369
370 return lowercaseMimeType; 370 return lowercaseMimeType;
371 } 371 }
372 372
373 String HTMLCanvasElement::toDataURL(const String& mimeType, const double* qualit y, ExceptionState& es) 373 String HTMLCanvasElement::toDataURL(const String& mimeType, const double* qualit y, ExceptionState& exceptionState)
374 { 374 {
375 if (!m_originClean) { 375 if (!m_originClean) {
376 es.throwSecurityError(ExceptionMessages::failedToExecute("toDataURL", "H TMLCanvasElement", "tainted canvases may not be exported.")); 376 exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("to DataURL", "HTMLCanvasElement", "tainted canvases may not be exported."));
377 return String(); 377 return String();
378 } 378 }
379 379
380 if (m_size.isEmpty() || !buffer()) 380 if (m_size.isEmpty() || !buffer())
381 return String("data:,"); 381 return String("data:,");
382 382
383 String encodingMimeType = toEncodingMimeType(mimeType); 383 String encodingMimeType = toEncodingMimeType(mimeType);
384 384
385 // Try to get ImageData first, as that may avoid lossy conversions. 385 // Try to get ImageData first, as that may avoid lossy conversions.
386 RefPtr<ImageData> imageData = getImageData(); 386 RefPtr<ImageData> imageData = getImageData();
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 ASSERT(m_hasCreatedImageBuffer); 549 ASSERT(m_hasCreatedImageBuffer);
550 IntSize unscaledSize = size(); 550 IntSize unscaledSize = size();
551 IntSize size = convertLogicalToDevice(unscaledSize); 551 IntSize size = convertLogicalToDevice(unscaledSize);
552 AffineTransform transform; 552 AffineTransform transform;
553 if (size.width() && size.height()) 553 if (size.width() && size.height())
554 transform.scaleNonUniform(size.width() / unscaledSize.width(), size.heig ht() / unscaledSize.height()); 554 transform.scaleNonUniform(size.width() / unscaledSize.width(), size.heig ht() / unscaledSize.height());
555 return m_imageBuffer->baseTransform() * transform; 555 return m_imageBuffer->baseTransform() * transform;
556 } 556 }
557 557
558 } 558 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLCanvasElement.h ('k') | Source/core/html/HTMLDialogElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698