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

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

Issue 68563003: Create DOM exceptions in the correct context. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased onto df9a982fbe97 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
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « Source/bindings/v8/custom/V8DocumentCustom.cpp ('k') | Source/bindings/v8/custom/V8HTMLFrameElementCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698