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

Side by Side Diff: Source/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp

Issue 96203003: Switch HTMLCanvasElement over to new-style ExceptionState. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Capitalize the 'tainted' error messages Created 7 years 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 | « Source/bindings/v8/ExceptionState.cpp ('k') | Source/core/html/HTMLCanvasElement.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) 2007-2009 Google Inc. All rights reserved. 2 * Copyright (C) 2007-2009 Google Inc. All rights reserved.
3 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 3 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. 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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 return; 127 return;
128 } 128 }
129 ASSERT_NOT_REACHED(); 129 ASSERT_NOT_REACHED();
130 v8SetReturnValueNull(info); 130 v8SetReturnValueNull(info);
131 } 131 }
132 132
133 void V8HTMLCanvasElement::toDataURLMethodCustom(const v8::FunctionCallbackInfo<v 8::Value>& info) 133 void V8HTMLCanvasElement::toDataURLMethodCustom(const v8::FunctionCallbackInfo<v 8::Value>& info)
134 { 134 {
135 v8::Handle<v8::Object> holder = info.Holder(); 135 v8::Handle<v8::Object> holder = info.Holder();
136 HTMLCanvasElement* canvas = V8HTMLCanvasElement::toNative(holder); 136 HTMLCanvasElement* canvas = V8HTMLCanvasElement::toNative(holder);
137 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); 137 ExceptionState exceptionState(ExceptionState::ExecutionContext, "toDataURL", "HTMLCanvasElement", info.Holder(), info.GetIsolate());
138 138
139 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]); 139 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]);
140 double quality; 140 double quality;
141 double* qualityPtr = 0; 141 double* qualityPtr = 0;
142 if (info.Length() > 1 && info[1]->IsNumber()) { 142 if (info.Length() > 1 && info[1]->IsNumber()) {
143 quality = info[1]->NumberValue(); 143 quality = info[1]->NumberValue();
144 qualityPtr = &quality; 144 qualityPtr = &quality;
145 } 145 }
146 146
147 String result = canvas->toDataURL(type, qualityPtr, exceptionState); 147 String result = canvas->toDataURL(type, qualityPtr, exceptionState);
148 exceptionState.throwIfNeeded(); 148 exceptionState.throwIfNeeded();
149 v8SetReturnValueStringOrUndefined(info, result, info.GetIsolate()); 149 v8SetReturnValueStringOrUndefined(info, result, info.GetIsolate());
150 } 150 }
151 151
152 } // namespace WebCore 152 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/ExceptionState.cpp ('k') | Source/core/html/HTMLCanvasElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698