| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |