diff options
author | levin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-14 00:58:25 +0000 |
---|---|---|
committer | levin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-14 00:58:25 +0000 |
commit | 98b2361a19da857b0f663dd23e70483761360d76 (patch) | |
tree | 62b3890622291430bd46ae781db6f300b4a3942b /webkit/port | |
parent | 7746aca763ca441dc956c81443239040ffe54c2a (diff) | |
download | chromium_src-98b2361a19da857b0f663dd23e70483761360d76.zip chromium_src-98b2361a19da857b0f663dd23e70483761360d76.tar.gz chromium_src-98b2361a19da857b0f663dd23e70483761360d76.tar.bz2 |
Switch to upstream versions of V8DocumentLocationCustom.cpp and V8CanvasPixelArrayCustom.cpp
TEST=Use the dom elements: document.location and the canvas pixels
BUG=http://crbug.com/11917
Review URL: http://codereview.chromium.org/113364
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16022 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/port')
-rw-r--r-- | webkit/port/bindings/v8/V8CanvasPixelArrayCustom.cpp | 65 | ||||
-rw-r--r-- | webkit/port/bindings/v8/V8DocumentLocationCustom.cpp | 56 |
2 files changed, 0 insertions, 121 deletions
diff --git a/webkit/port/bindings/v8/V8CanvasPixelArrayCustom.cpp b/webkit/port/bindings/v8/V8CanvasPixelArrayCustom.cpp deleted file mode 100644 index 28f6b59..0000000 --- a/webkit/port/bindings/v8/V8CanvasPixelArrayCustom.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2009 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include "CanvasPixelArray.h" - -#include "V8Binding.h" -#include "V8CustomBinding.h" -#include "V8Proxy.h" - -namespace WebCore { - -// Get the specified value from the pixel buffer and return it wrapped as a JavaScript Number object to V8. Accesses outside the valid pixel buffer range return "undefined". -INDEXED_PROPERTY_GETTER(CanvasPixelArray) -{ - INC_STATS("DOM.CanvasPixelArray.IndexedPropertyGetter"); - CanvasPixelArray* pixelBuffer = V8Proxy::ToNativeObject<CanvasPixelArray>(V8ClassIndex::CANVASPIXELARRAY, info.Holder()); - - if ((index < 0) || (index >= pixelBuffer->length())) - return v8::Undefined(); - unsigned char result; - if (!pixelBuffer->get(index, result)) - return v8::Undefined(); - return v8::Number::New(result); -} - -// Set the specified value in the pixel buffer. Accesses outside the valid pixel buffer range are silently ignored. -INDEXED_PROPERTY_SETTER(CanvasPixelArray) -{ - INC_STATS("DOM.CanvasPixelArray.IndexedPropertySetter"); - CanvasPixelArray* pixelBuffer = V8Proxy::ToNativeObject<CanvasPixelArray>(V8ClassIndex::CANVASPIXELARRAY, info.Holder()); - - if ((index >= 0) && (index < pixelBuffer->length())) - pixelBuffer->set(index, value->NumberValue()); - return value; -} - -} // namespace WebCore diff --git a/webkit/port/bindings/v8/V8DocumentLocationCustom.cpp b/webkit/port/bindings/v8/V8DocumentLocationCustom.cpp deleted file mode 100644 index dfcacef..0000000 --- a/webkit/port/bindings/v8/V8DocumentLocationCustom.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2000 Harri Porten (porten@kde.org) - * Copyright (C) 2001 Peter Kelly (pmk@post.com) - * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. - * Copyright (C) 2006 James G. Speth (speth@end.com) - * Copyright (C) 2006 Samuel Weinig (sam@webkit.org) - * Copyright (C) 2007, 2008, 2009 Google Inc. All Rights Reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "config.h" -#include "V8CustomBinding.h" - -#include "DOMWindow.h" -#include "Frame.h" -#include "V8Binding.h" -#include "V8Document.h" -#include "V8Proxy.h" - -namespace WebCore { - -ACCESSOR_GETTER(DocumentLocation) -{ - Document* document = V8Proxy::DOMWrapperToNative<Document>(info.Holder()); - if (!document->frame()) - return v8::Null(); - - DOMWindow* window = document->frame()->domWindow(); - return V8Proxy::ToV8Object(V8ClassIndex::LOCATION, window->location()); -} - -ACCESSOR_SETTER(DocumentLocation) -{ - Document* document = V8Proxy::DOMWrapperToNative<Document>(info.Holder()); - if (!document->frame()) - return; - - DOMWindow* window = document->frame()->domWindow(); - // WindowSetLocation does security checks. // XXXMB- verify! - WindowSetLocation(window, toWebCoreString(value)); -} - -} // namespace WebCore |