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

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

Issue 293963003: Remove ScriptObject (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 months 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/bindings/v8/ScriptValue.h ('k') | Source/bindings/v8/custom/V8InjectedScriptManager.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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 } 94 }
95 CanvasRenderingContext* result = impl->getContext(contextId, attributes.get( )); 95 CanvasRenderingContext* result = impl->getContext(contextId, attributes.get( ));
96 if (!result) { 96 if (!result) {
97 v8SetReturnValueNull(info); 97 v8SetReturnValueNull(info);
98 return; 98 return;
99 } 99 }
100 if (result->is2d()) { 100 if (result->is2d()) {
101 v8::Handle<v8::Value> v8Result = toV8(toCanvasRenderingContext2D(result) , info.Holder(), info.GetIsolate()); 101 v8::Handle<v8::Value> v8Result = toV8(toCanvasRenderingContext2D(result) , info.Holder(), info.GetIsolate());
102 if (InspectorInstrumentation::canvasAgentEnabled(&impl->document())) { 102 if (InspectorInstrumentation::canvasAgentEnabled(&impl->document())) {
103 ScriptState* scriptState = ScriptState::current(isolate); 103 ScriptState* scriptState = ScriptState::current(isolate);
104 ScriptObject context(scriptState, v8::Handle<v8::Object>::Cast(v8Res ult)); 104 ScriptValue context(scriptState, v8Result);
105 ScriptObject wrapped = InspectorInstrumentation::wrapCanvas2DRenderi ngContextForInstrumentation(&impl->document(), context); 105 ScriptValue wrapped = InspectorInstrumentation::wrapCanvas2DRenderin gContextForInstrumentation(&impl->document(), context);
106 if (!wrapped.isEmpty()) { 106 if (!wrapped.isEmpty()) {
107 v8SetReturnValue(info, wrapped.v8Value()); 107 v8SetReturnValue(info, wrapped.v8Value());
108 return; 108 return;
109 } 109 }
110 } 110 }
111 v8SetReturnValue(info, v8Result); 111 v8SetReturnValue(info, v8Result);
112 return; 112 return;
113 } 113 }
114 if (result->is3d()) { 114 if (result->is3d()) {
115 v8::Handle<v8::Value> v8Result = toV8(toWebGLRenderingContext(result), i nfo.Holder(), info.GetIsolate()); 115 v8::Handle<v8::Value> v8Result = toV8(toWebGLRenderingContext(result), i nfo.Holder(), info.GetIsolate());
116 if (InspectorInstrumentation::canvasAgentEnabled(&impl->document())) { 116 if (InspectorInstrumentation::canvasAgentEnabled(&impl->document())) {
117 ScriptState* scriptState = ScriptState::current(isolate); 117 ScriptState* scriptState = ScriptState::current(isolate);
118 ScriptObject glContext(scriptState, v8::Handle<v8::Object>::Cast(v8R esult)); 118 ScriptValue glContext(scriptState, v8Result);
119 ScriptObject wrapped = InspectorInstrumentation::wrapWebGLRenderingC ontextForInstrumentation(&impl->document(), glContext); 119 ScriptValue wrapped = InspectorInstrumentation::wrapWebGLRenderingCo ntextForInstrumentation(&impl->document(), glContext);
120 if (!wrapped.isEmpty()) { 120 if (!wrapped.isEmpty()) {
121 v8SetReturnValue(info, wrapped.v8Value()); 121 v8SetReturnValue(info, wrapped.v8Value());
122 return; 122 return;
123 } 123 }
124 } 124 }
125 v8SetReturnValue(info, v8Result); 125 v8SetReturnValue(info, v8Result);
126 return; 126 return;
127 } 127 }
128 ASSERT_NOT_REACHED(); 128 ASSERT_NOT_REACHED();
129 v8SetReturnValueNull(info); 129 v8SetReturnValueNull(info);
(...skipping 12 matching lines...) Expand all
142 quality = info[1]->NumberValue(); 142 quality = info[1]->NumberValue();
143 qualityPtr = &quality; 143 qualityPtr = &quality;
144 } 144 }
145 145
146 String result = canvas->toDataURL(type, qualityPtr, exceptionState); 146 String result = canvas->toDataURL(type, qualityPtr, exceptionState);
147 exceptionState.throwIfNeeded(); 147 exceptionState.throwIfNeeded();
148 v8SetReturnValueStringOrUndefined(info, result, info.GetIsolate()); 148 v8SetReturnValueStringOrUndefined(info, result, info.GetIsolate());
149 } 149 }
150 150
151 } // namespace WebCore 151 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/ScriptValue.h ('k') | Source/bindings/v8/custom/V8InjectedScriptManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698