| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 return; | 123 return; |
| 124 } | 124 } |
| 125 ASSERT_NOT_REACHED(); | 125 ASSERT_NOT_REACHED(); |
| 126 v8SetReturnValueNull(info); | 126 v8SetReturnValueNull(info); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void V8HTMLCanvasElement::toDataURLMethodCustom(const v8::FunctionCallbackInfo<v
8::Value>& info) | 129 void V8HTMLCanvasElement::toDataURLMethodCustom(const v8::FunctionCallbackInfo<v
8::Value>& info) |
| 130 { | 130 { |
| 131 v8::Handle<v8::Object> holder = info.Holder(); | 131 v8::Handle<v8::Object> holder = info.Holder(); |
| 132 HTMLCanvasElement* canvas = V8HTMLCanvasElement::toNative(holder); | 132 HTMLCanvasElement* canvas = V8HTMLCanvasElement::toNative(holder); |
| 133 ExceptionState exceptionState(info.GetIsolate()); | 133 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); |
| 134 | 134 |
| 135 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]); | 135 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]); |
| 136 double quality; | 136 double quality; |
| 137 double* qualityPtr = 0; | 137 double* qualityPtr = 0; |
| 138 if (info.Length() > 1 && info[1]->IsNumber()) { | 138 if (info.Length() > 1 && info[1]->IsNumber()) { |
| 139 quality = info[1]->NumberValue(); | 139 quality = info[1]->NumberValue(); |
| 140 qualityPtr = &quality; | 140 qualityPtr = &quality; |
| 141 } | 141 } |
| 142 | 142 |
| 143 String result = canvas->toDataURL(type, qualityPtr, exceptionState); | 143 String result = canvas->toDataURL(type, qualityPtr, exceptionState); |
| 144 exceptionState.throwIfNeeded(); | 144 exceptionState.throwIfNeeded(); |
| 145 v8SetReturnValueStringOrUndefined(info, result, info.GetIsolate()); | 145 v8SetReturnValueStringOrUndefined(info, result, info.GetIsolate()); |
| 146 } | 146 } |
| 147 | 147 |
| 148 } // namespace WebCore | 148 } // namespace WebCore |
| OLD | NEW |