diff options
-rw-r--r-- | DEPS | 2 | ||||
-rw-r--r-- | skia/ext/vector_canvas_unittest.cc | 8 | ||||
-rw-r--r-- | webkit/glue/webdevtoolsclient_impl.cc | 2 | ||||
-rw-r--r-- | webkit/port/bindings/scripts/CodeGeneratorV8.pm | 10 | ||||
-rw-r--r-- | webkit/port/bindings/v8/NPV8Object.cpp | 2 | ||||
-rw-r--r-- | webkit/port/bindings/v8/v8_custom.cpp | 245 | ||||
-rw-r--r-- | webkit/port/bindings/v8/v8_custom.h | 586 | ||||
-rw-r--r-- | webkit/port/bindings/v8/v8_proxy.cpp | 2 | ||||
-rw-r--r-- | webkit/port/bindings/v8/v8_proxy.h | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/image_decoder_unittest.cc | 30 | ||||
-rw-r--r-- | webkit/webkit.gyp | 3 |
11 files changed, 33 insertions, 859 deletions
@@ -1,7 +1,7 @@ vars = { "webkit_trunk": "http://svn.webkit.org/repository/webkit/trunk", - "webkit_revision": "44571", + "webkit_revision": "44597", } diff --git a/skia/ext/vector_canvas_unittest.cc b/skia/ext/vector_canvas_unittest.cc index 5dbd17f..b1f9a7c 100644 --- a/skia/ext/vector_canvas_unittest.cc +++ b/skia/ext/vector_canvas_unittest.cc @@ -81,7 +81,9 @@ class Image { EXPECT_TRUE(compressed.size()); WebCore::PNGImageDecoder decoder; decoder.setData(WebCore::SharedBuffer::adoptVector(compressed).get(), true); - SetSkBitmap(decoder.frameBufferAtIndex(0)->bitmap()); + scoped_ptr<NativeImageSkia> image_data( + decoder.frameBufferAtIndex(0)->asNewNativeImage()); + SetSkBitmap(*image_data); } // Loads the image from a canvas. @@ -325,7 +327,9 @@ void LoadPngFileToSkBitmap(const std::wstring& filename, EXPECT_TRUE(compressed.size()); WebCore::PNGImageDecoder decoder; decoder.setData(WebCore::SharedBuffer::adoptVector(compressed).get(), true); - *bitmap = decoder.frameBufferAtIndex(0)->bitmap(); + scoped_ptr<NativeImageSkia> image_data( + decoder.frameBufferAtIndex(0)->asNewNativeImage()); + *bitmap = *image_data; EXPECT_EQ(is_opaque, bitmap->isOpaque()); Premultiply(*bitmap); } diff --git a/webkit/glue/webdevtoolsclient_impl.cc b/webkit/glue/webdevtoolsclient_impl.cc index a91cea6..163f377 100644 --- a/webkit/glue/webdevtoolsclient_impl.cc +++ b/webkit/glue/webdevtoolsclient_impl.cc @@ -19,7 +19,7 @@ #undef LOG #include "V8Binding.h" -#include "v8_custom.h" +#include "V8CustomBinding.h" #include "v8_proxy.h" #include "v8_utility.h" #include "base/string_util.h" diff --git a/webkit/port/bindings/scripts/CodeGeneratorV8.pm b/webkit/port/bindings/scripts/CodeGeneratorV8.pm index 815e385..ba747fd 100644 --- a/webkit/port/bindings/scripts/CodeGeneratorV8.pm +++ b/webkit/port/bindings/scripts/CodeGeneratorV8.pm @@ -1095,7 +1095,7 @@ sub GenerateImplementation # for any event getter/setters anyway. if ($attrType eq "EventListener") { $attribute->signature->extendedAttributes->{"Custom"} = 1; - $implIncludes{"v8_custom.h"} = 1; + $implIncludes{"V8CustomBinding.h"} = 1; next; } @@ -1104,19 +1104,19 @@ sub GenerateImplementation # implementation. if ($attribute->signature->extendedAttributes->{"Custom"} || $attribute->signature->extendedAttributes->{"V8Custom"}) { - $implIncludes{"v8_custom.h"} = 1; + $implIncludes{"V8CustomBinding.h"} = 1; next; } # Generate the accessor. if ($attribute->signature->extendedAttributes->{"CustomGetter"}) { - $implIncludes{"v8_custom.h"} = 1; + $implIncludes{"V8CustomBinding.h"} = 1; } else { GenerateNormalAttrGetter($attribute, $dataNode, $classIndex, $implClassName); } if ($attribute->signature->extendedAttributes->{"CustomSetter"} || $attribute->signature->extendedAttributes->{"V8CustomSetter"}) { - $implIncludes{"v8_custom.h"} = 1; + $implIncludes{"V8CustomBinding.h"} = 1; } elsif ($attribute->signature->extendedAttributes->{"Replaceable"}) { $dataNode->extendedAttributes->{"ExtendsDOMGlobalObject"} || die "Replaceable attribute can only be used in interface that defines ExtendsDOMGlobalObject attribute!"; # GenerateReplaceableAttrSetter($implClassName); @@ -1136,7 +1136,7 @@ sub GenerateImplementation # TODO(fqian): avoid naming conflict if ($function->signature->extendedAttributes->{"Custom"} || $function->signature->extendedAttributes->{"V8Custom"}) { - $implIncludes{"v8_custom.h"} = 1; + $implIncludes{"V8CustomBinding.h"} = 1; } else { GenerateFunctionCallback($function, $dataNode, $classIndex, $implClassName); diff --git a/webkit/port/bindings/v8/NPV8Object.cpp b/webkit/port/bindings/v8/NPV8Object.cpp index 4eb6f45..479704c 100644 --- a/webkit/port/bindings/v8/NPV8Object.cpp +++ b/webkit/port/bindings/v8/NPV8Object.cpp @@ -38,7 +38,7 @@ #include "npruntime_priv.h" #include "PlatformString.h" #include "ScriptController.h" -#include "v8_custom.h" +#include "V8CustomBinding.h" #include "v8_helpers.h" #include "V8NPUtils.h" #include "v8_proxy.h" diff --git a/webkit/port/bindings/v8/v8_custom.cpp b/webkit/port/bindings/v8/v8_custom.cpp index 0af5143..e69de29 100644 --- a/webkit/port/bindings/v8/v8_custom.cpp +++ b/webkit/port/bindings/v8/v8_custom.cpp @@ -1,245 +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 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 <Assertions.h> -#include <wtf/ASCIICType.h> - -#include "v8_proxy.h" -#include "v8_binding.h" -#include "V8NPObject.h" - -#include "V8CanvasGradient.h" -#include "V8CanvasPattern.h" -#include "V8CustomEventListener.h" -#include "V8Document.h" -#include "V8DOMWindow.h" -#include "V8HTMLCanvasElement.h" -#include "V8HTMLDocument.h" -#include "V8HTMLImageElement.h" -#include "V8NamedNodesCollection.h" -#include "V8Node.h" -#include "V8Proxy.h" -#include "V8XPathNSResolver.h" -#include "V8XPathResult.h" - -#include "Attr.h" -#include "Base64.h" -#include "CanvasGradient.h" -#include "CanvasPattern.h" -#include "CanvasRenderingContext2D.h" -#include "CanvasStyle.h" -#include "Clipboard.h" -#include "ClipboardEvent.h" -#include "Console.h" -#include "DOMParser.h" -#include "DOMStringList.h" -#include "DOMTimer.h" -#include "Document.h" -#include "DocumentFragment.h" -#include "Event.h" -#include "EventTarget.h" -#include "FloatRect.h" -#include "Frame.h" -#include "FrameLoader.h" -#include "FrameTree.h" -#include "HTMLBodyElement.h" -#include "HTMLCanvasElement.h" -#include "HTMLDocument.h" -#include "HTMLEmbedElement.h" -#include "HTMLImageElement.h" -#include "HTMLInputElement.h" -#include "HTMLNames.h" -#include "History.h" -#include "JSXPathNSResolver.h" -#include "KURL.h" -#include "Location.h" -#include "MessageChannel.h" -#include "MessagePort.h" -#include "MouseEvent.h" -#include "NodeIterator.h" -#include "NodeList.h" -#include "RGBColor.h" -#include "RenderPartObject.h" -#include "RenderWidget.h" -#include "ScheduledAction.h" -#include "ScriptState.h" -#include "ScriptController.h" -#include "ScriptSourceCode.h" -#include "SecurityOrigin.h" -#include "StyleSheetList.h" -#include "TreeWalker.h" -#include "WebKitCSSMatrix.h" -#include "WebKitPoint.h" -#include "XMLSerializer.h" -#include "XPathEvaluator.h" -#include "XPathResult.h" -#include "XSLTProcessor.h" - -#if ENABLE(SVG) -#include "V8SVGPODTypeWrapper.h" -#include "SVGElementInstance.h" -#include "SVGException.h" -#include "SVGPathSeg.h" -#endif - -#include "Navigator.h" - -namespace WebCore { - -CALLBACK_FUNC_DECL(WebKitPointConstructor) { - INC_STATS("DOM.WebKitPoint.Constructor"); - return V8Proxy::ConstructDOMObject<V8ClassIndex::WEBKITPOINT, - WebKitPoint>(args); -} - -// DOMImplementation is a singleton in WebCore. If we use our normal -// mapping from DOM objects to V8 wrappers, the same wrapper will be -// shared for all frames in the same process. This is a major -// security problem. Therefore, we generate a DOMImplementation -// wrapper per document and store it in an internal field of the -// document. Since the DOMImplementation object is a singleton, we do -// not have to do anything to keep the DOMImplementation object alive -// for the lifetime of the wrapper. -ACCESSOR_GETTER(DocumentImplementation) { - ASSERT(info.Holder()->InternalFieldCount() >= - kDocumentMinimumInternalFieldCount); - // Check if the internal field already contains a wrapper. - v8::Local<v8::Value> implementation = - info.Holder()->GetInternalField(kDocumentImplementationIndex); - if (!implementation->IsUndefined()) { - return implementation; - } - // Generate a wrapper. - Document* doc = V8Proxy::DOMWrapperToNative<Document>(info.Holder()); - v8::Handle<v8::Value> wrapper = - V8Proxy::DOMImplementationToV8Object(doc->implementation()); - // Store the wrapper in the internal field. - info.Holder()->SetInternalField(kDocumentImplementationIndex, wrapper); - - return wrapper; -} - -// --------------- Security Checks ------------------------- -INDEXED_ACCESS_CHECK(History) { - ASSERT(V8ClassIndex::FromInt(data->Int32Value()) == V8ClassIndex::HISTORY); - // Only allow same origin access - History* imp = - V8Proxy::ToNativeObject<History>(V8ClassIndex::HISTORY, host); - return V8Proxy::CanAccessFrame(imp->frame(), false); -} - - -NAMED_ACCESS_CHECK(History) { - ASSERT(V8ClassIndex::FromInt(data->Int32Value()) == V8ClassIndex::HISTORY); - // Only allow same origin access - History* imp = - V8Proxy::ToNativeObject<History>(V8ClassIndex::HISTORY, host); - return V8Proxy::CanAccessFrame(imp->frame(), false); -} - - - -#undef INDEXED_ACCESS_CHECK -#undef NAMED_ACCESS_CHECK -#undef NAMED_PROPERTY_GETTER -#undef NAMED_PROPERTY_SETTER - - -// static -Frame* V8Custom::GetTargetFrame(v8::Local<v8::Object> host, - v8::Local<v8::Value> data) { - Frame* target = 0; - switch (V8ClassIndex::FromInt(data->Int32Value())) { - case V8ClassIndex::DOMWINDOW: { - v8::Handle<v8::Value> window = - V8Proxy::LookupDOMWrapper(V8ClassIndex::DOMWINDOW, host); - if (window.IsEmpty()) - return target; - - DOMWindow* target_win = - V8Proxy::ToNativeObject<DOMWindow>(V8ClassIndex::DOMWINDOW, window); - target = target_win->frame(); - break; - } - case V8ClassIndex::LOCATION: { - History* imp = - V8Proxy::ToNativeObject<History>(V8ClassIndex::HISTORY, host); - target = imp->frame(); - break; - } - case V8ClassIndex::HISTORY: { - Location* imp = - V8Proxy::ToNativeObject<Location>(V8ClassIndex::LOCATION, host); - target = imp->frame(); - break; - } - default: - break; - } - return target; -} - -#if ENABLE(SVG) -V8ClassIndex::V8WrapperType V8Custom::DowncastSVGPathSeg(void* path_seg) { - WebCore::SVGPathSeg *real_path_seg = - reinterpret_cast<WebCore::SVGPathSeg*>(path_seg); - - switch (real_path_seg->pathSegType()) { -#define MAKE_CASE(svg_val, v8_val) \ - case WebCore::SVGPathSeg::svg_val: \ - return V8ClassIndex::v8_val; - -MAKE_CASE(PATHSEG_CLOSEPATH, SVGPATHSEGCLOSEPATH) -MAKE_CASE(PATHSEG_MOVETO_ABS, SVGPATHSEGMOVETOABS) -MAKE_CASE(PATHSEG_MOVETO_REL, SVGPATHSEGMOVETOREL) -MAKE_CASE(PATHSEG_LINETO_ABS, SVGPATHSEGLINETOABS) -MAKE_CASE(PATHSEG_LINETO_REL, SVGPATHSEGLINETOREL) -MAKE_CASE(PATHSEG_CURVETO_CUBIC_ABS, SVGPATHSEGCURVETOCUBICABS) -MAKE_CASE(PATHSEG_CURVETO_CUBIC_REL, SVGPATHSEGCURVETOCUBICREL) -MAKE_CASE(PATHSEG_CURVETO_QUADRATIC_ABS, SVGPATHSEGCURVETOQUADRATICABS) -MAKE_CASE(PATHSEG_CURVETO_QUADRATIC_REL, SVGPATHSEGCURVETOQUADRATICREL) -MAKE_CASE(PATHSEG_ARC_ABS, SVGPATHSEGARCABS) -MAKE_CASE(PATHSEG_ARC_REL, SVGPATHSEGARCREL) -MAKE_CASE(PATHSEG_LINETO_HORIZONTAL_ABS, SVGPATHSEGLINETOHORIZONTALABS) -MAKE_CASE(PATHSEG_LINETO_HORIZONTAL_REL, SVGPATHSEGLINETOHORIZONTALREL) -MAKE_CASE(PATHSEG_LINETO_VERTICAL_ABS, SVGPATHSEGLINETOVERTICALABS) -MAKE_CASE(PATHSEG_LINETO_VERTICAL_REL, SVGPATHSEGLINETOVERTICALREL) -MAKE_CASE(PATHSEG_CURVETO_CUBIC_SMOOTH_ABS, SVGPATHSEGCURVETOCUBICSMOOTHABS) -MAKE_CASE(PATHSEG_CURVETO_CUBIC_SMOOTH_REL, SVGPATHSEGCURVETOCUBICSMOOTHREL) -MAKE_CASE(PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS, \ - SVGPATHSEGCURVETOQUADRATICSMOOTHABS) -MAKE_CASE(PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL, \ - SVGPATHSEGCURVETOQUADRATICSMOOTHREL) - -#undef MAKE_CASE - - default: - return V8ClassIndex::INVALID_CLASS_INDEX; - } -} - -#endif // ENABLE(SVG) - -} // namespace WebCore diff --git a/webkit/port/bindings/v8/v8_custom.h b/webkit/port/bindings/v8/v8_custom.h index 63e9b8a..e69de29 100644 --- a/webkit/port/bindings/v8/v8_custom.h +++ b/webkit/port/bindings/v8/v8_custom.h @@ -1,586 +0,0 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef V8_CUSTOM_H__ -#define V8_CUSTOM_H__ - -#include <v8.h> -#include "v8_index.h" - -struct NPObject; - -#define CALLBACK_FUNC_DECL(NAME) \ -v8::Handle<v8::Value> V8Custom::v8##NAME##Callback(const v8::Arguments& args) - -#define ACCESSOR_GETTER(NAME) \ -v8::Handle<v8::Value> V8Custom::v8##NAME##AccessorGetter(\ - v8::Local<v8::String> name, const v8::AccessorInfo& info) - -#define ACCESSOR_SETTER(NAME) \ -void V8Custom::v8##NAME##AccessorSetter(v8::Local<v8::String> name, \ - v8::Local<v8::Value> value, \ - const v8::AccessorInfo& info) - -#define INDEXED_PROPERTY_GETTER(NAME) \ -v8::Handle<v8::Value> V8Custom::v8##NAME##IndexedPropertyGetter(\ - uint32_t index, const v8::AccessorInfo& info) - -#define INDEXED_PROPERTY_SETTER(NAME) \ -v8::Handle<v8::Value> V8Custom::v8##NAME##IndexedPropertySetter(\ - uint32_t index, v8::Local<v8::Value> value, const v8::AccessorInfo& info) - -#define INDEXED_PROPERTY_DELETER(NAME) \ -v8::Handle<v8::Boolean> V8Custom::v8##NAME##IndexedPropertyDeleter(\ - uint32_t index, const v8::AccessorInfo& info) - -#define NAMED_PROPERTY_GETTER(NAME) \ - v8::Handle<v8::Value> V8Custom::v8##NAME##NamedPropertyGetter(\ - v8::Local<v8::String> name, const v8::AccessorInfo& info) - -#define NAMED_PROPERTY_SETTER(NAME) \ - v8::Handle<v8::Value> V8Custom::v8##NAME##NamedPropertySetter(\ - v8::Local<v8::String> name, v8::Local<v8::Value> value, \ - const v8::AccessorInfo& info) - -#define NAMED_PROPERTY_DELETER(NAME) \ - v8::Handle<v8::Boolean> V8Custom::v8##NAME##NamedPropertyDeleter(\ - v8::Local<v8::String> name, const v8::AccessorInfo& info) - -#define NAMED_ACCESS_CHECK(NAME) \ - bool V8Custom::v8##NAME##NamedSecurityCheck(v8::Local<v8::Object> host, \ - v8::Local<v8::Value> key, \ - v8::AccessType type, \ - v8::Local<v8::Value> data) - -#define INDEXED_ACCESS_CHECK(NAME) \ - bool V8Custom::v8##NAME##IndexedSecurityCheck(v8::Local<v8::Object> host, \ - uint32_t index, \ - v8::AccessType type, \ - v8::Local<v8::Value> data) - -namespace WebCore { - -class Frame; -class V8Proxy; -class String; -class HTMLCollection; -class DOMWindow; - -class V8Custom { - public: - - // Constants. - static const int kDOMWrapperTypeIndex = 0; - static const int kDOMWrapperObjectIndex = 1; - static const int kDefaultWrapperInternalFieldCount = 2; - - static const int kNPObjectInternalFieldCount = - kDefaultWrapperInternalFieldCount + 0; - - static const int kDocumentImplementationIndex = - kDefaultWrapperInternalFieldCount + 0; - static const int kDocumentMinimumInternalFieldCount = - kDefaultWrapperInternalFieldCount + 1; - - static const int kHTMLDocumentMarkerIndex = - kDocumentMinimumInternalFieldCount + 0; - static const int kHTMLDocumentShadowIndex = - kDocumentMinimumInternalFieldCount + 1; - static const int kHTMLDocumentInternalFieldCount = - kDocumentMinimumInternalFieldCount + 2; - - static const int kXMLHttpRequestCacheIndex = - kDefaultWrapperInternalFieldCount + 0; - static const int kXMLHttpRequestInternalFieldCount = - kDefaultWrapperInternalFieldCount + 1; - - static const int kMessageChannelPort1Index = - kDefaultWrapperInternalFieldCount + 0; - static const int kMessageChannelPort2Index = - kDefaultWrapperInternalFieldCount + 1; - static const int kMessageChannelInternalFieldCount = - kDefaultWrapperInternalFieldCount + 2; - - static const int kMessagePortRequestCacheIndex = - kDefaultWrapperInternalFieldCount + 0; - static const int kMessagePortEntangledPortIndex = - kDefaultWrapperInternalFieldCount + 1; - static const int kMessagePortInternalFieldCount = - kDefaultWrapperInternalFieldCount + 2; - -#if ENABLE(WORKERS) - static const int kWorkerRequestCacheIndex = - kDefaultWrapperInternalFieldCount + 0; - static const int kWorkerInternalFieldCount = - kDefaultWrapperInternalFieldCount + 1; - - static const int kWorkerContextRequestCacheIndex = - kDefaultWrapperInternalFieldCount + 0; - static const int kWorkerContextInternalFieldCount = - kDefaultWrapperInternalFieldCount + 1; -#endif - - static const int kDOMWindowConsoleIndex = - kDefaultWrapperInternalFieldCount + 0; - static const int kDOMWindowHistoryIndex = - kDefaultWrapperInternalFieldCount + 1; - static const int kDOMWindowLocationbarIndex = - kDefaultWrapperInternalFieldCount + 2; - static const int kDOMWindowMenubarIndex = - kDefaultWrapperInternalFieldCount + 3; - static const int kDOMWindowNavigatorIndex = - kDefaultWrapperInternalFieldCount + 4; - static const int kDOMWindowPersonalbarIndex = - kDefaultWrapperInternalFieldCount + 5; - static const int kDOMWindowScreenIndex = - kDefaultWrapperInternalFieldCount + 6; - static const int kDOMWindowScrollbarsIndex = - kDefaultWrapperInternalFieldCount + 7; - static const int kDOMWindowSelectionIndex = - kDefaultWrapperInternalFieldCount + 8; - static const int kDOMWindowStatusbarIndex = - kDefaultWrapperInternalFieldCount + 9; - static const int kDOMWindowToolbarIndex = - kDefaultWrapperInternalFieldCount + 10; - static const int kDOMWindowLocationIndex = - kDefaultWrapperInternalFieldCount + 11; - static const int kDOMWindowDOMSelectionIndex = - kDefaultWrapperInternalFieldCount + 12; - static const int kDOMWindowInternalFieldCount = - kDefaultWrapperInternalFieldCount + 13; - - static const int kStyleSheetOwnerNodeIndex = - kDefaultWrapperInternalFieldCount + 0; - static const int kStyleSheetInternalFieldCount = - kDefaultWrapperInternalFieldCount + 1; - -#define DECLARE_PROPERTY_ACCESSOR_GETTER(NAME) \ -static v8::Handle<v8::Value> v8##NAME##AccessorGetter(\ - v8::Local<v8::String> name, const v8::AccessorInfo& info); - -#define DECLARE_PROPERTY_ACCESSOR_SETTER(NAME) \ -static void v8##NAME##AccessorSetter(v8::Local<v8::String> name, \ - v8::Local<v8::Value> value, \ - const v8::AccessorInfo& info); - -#define DECLARE_PROPERTY_ACCESSOR(NAME) \ - DECLARE_PROPERTY_ACCESSOR_GETTER(NAME) \ - DECLARE_PROPERTY_ACCESSOR_SETTER(NAME) - - -#define DECLARE_NAMED_PROPERTY_GETTER(NAME) \ -static v8::Handle<v8::Value> v8##NAME##NamedPropertyGetter(\ - v8::Local<v8::String> name, const v8::AccessorInfo& info); - -#define DECLARE_NAMED_PROPERTY_SETTER(NAME) \ -static v8::Handle<v8::Value> v8##NAME##NamedPropertySetter(\ - v8::Local<v8::String> name, \ - v8::Local<v8::Value> value, \ - const v8::AccessorInfo& info); - -#define DECLARE_NAMED_PROPERTY_DELETER(NAME) \ -static v8::Handle<v8::Boolean> v8##NAME##NamedPropertyDeleter(\ - v8::Local<v8::String> name, const v8::AccessorInfo& info); - -#define USE_NAMED_PROPERTY_GETTER(NAME) \ - V8Custom::v8##NAME##NamedPropertyGetter - -#define USE_NAMED_PROPERTY_SETTER(NAME) \ - V8Custom::v8##NAME##NamedPropertySetter - -#define USE_NAMED_PROPERTY_DELETER(NAME) \ - V8Custom::v8##NAME##NamedPropertyDeleter - -#define DECLARE_INDEXED_PROPERTY_GETTER(NAME) \ -static v8::Handle<v8::Value> v8##NAME##IndexedPropertyGetter(\ - uint32_t index, const v8::AccessorInfo& info); - -#define DECLARE_INDEXED_PROPERTY_SETTER(NAME) \ -static v8::Handle<v8::Value> v8##NAME##IndexedPropertySetter(\ - uint32_t index, v8::Local<v8::Value> value, const v8::AccessorInfo& info); - -#define DECLARE_INDEXED_PROPERTY_DELETER(NAME) \ -static v8::Handle<v8::Boolean> v8##NAME##IndexedPropertyDeleter(\ - uint32_t index, const v8::AccessorInfo& info); - -#define USE_INDEXED_PROPERTY_GETTER(NAME) \ - V8Custom::v8##NAME##IndexedPropertyGetter - -#define USE_INDEXED_PROPERTY_SETTER(NAME) \ - V8Custom::v8##NAME##IndexedPropertySetter - -#define USE_INDEXED_PROPERTY_DELETER(NAME) \ - V8Custom::v8##NAME##IndexedPropertyDeleter - -#define DECLARE_CALLBACK(NAME) \ -static v8::Handle<v8::Value> v8##NAME##Callback(const v8::Arguments& args); - -#define USE_CALLBACK(NAME) \ - V8Custom::v8##NAME##Callback - -#define DECLARE_NAMED_ACCESS_CHECK(NAME) \ -static bool v8##NAME##NamedSecurityCheck(v8::Local<v8::Object> host, \ - v8::Local<v8::Value> key, \ - v8::AccessType type, \ - v8::Local<v8::Value> data); - -#define DECLARE_INDEXED_ACCESS_CHECK(NAME) \ -static bool v8##NAME##IndexedSecurityCheck(v8::Local<v8::Object> host, \ - uint32_t index, \ - v8::AccessType type, \ - v8::Local<v8::Value> data); - -DECLARE_PROPERTY_ACCESSOR(CanvasRenderingContext2DStrokeStyle) -DECLARE_PROPERTY_ACCESSOR(CanvasRenderingContext2DFillStyle) -DECLARE_PROPERTY_ACCESSOR_GETTER(DOMWindowEvent) -DECLARE_PROPERTY_ACCESSOR_GETTER(DOMWindowCrypto) -// Customized getter&setter of DOMWindow.location -DECLARE_PROPERTY_ACCESSOR_SETTER(DOMWindowLocation) -// Customized setter of DOMWindow.opener -DECLARE_PROPERTY_ACCESSOR_SETTER(DOMWindowOpener) - -DECLARE_PROPERTY_ACCESSOR(DocumentLocation) -DECLARE_PROPERTY_ACCESSOR(DocumentImplementation) -DECLARE_PROPERTY_ACCESSOR_GETTER(EventSrcElement) -DECLARE_PROPERTY_ACCESSOR(EventReturnValue) -DECLARE_PROPERTY_ACCESSOR_GETTER(EventDataTransfer) -DECLARE_PROPERTY_ACCESSOR_GETTER(EventClipboardData) - -// Getter/Setter for window event handlers -DECLARE_PROPERTY_ACCESSOR(DOMWindowEventHandler) -// Getter/Setter for Element event handlers -DECLARE_PROPERTY_ACCESSOR(ElementEventHandler) - -// HTMLCanvasElement -DECLARE_CALLBACK(HTMLCanvasElementGetContext) - -// Customized setter of src and location on HTMLFrameElement -DECLARE_PROPERTY_ACCESSOR_SETTER(HTMLFrameElementSrc) -DECLARE_PROPERTY_ACCESSOR_SETTER(HTMLFrameElementLocation) -// Customized setter of src on HTMLIFrameElement -DECLARE_PROPERTY_ACCESSOR_SETTER(HTMLIFrameElementSrc) -// Customized setter of Attr.value -DECLARE_PROPERTY_ACCESSOR_SETTER(AttrValue) - -// Customized setter of HTMLOptionsCollection length -DECLARE_PROPERTY_ACCESSOR(HTMLOptionsCollectionLength) - -DECLARE_CALLBACK(HTMLInputElementSetSelectionRange) - -// Customized accessors for HTMLInputElement -DECLARE_PROPERTY_ACCESSOR(HTMLInputElementSelectionStart) -DECLARE_PROPERTY_ACCESSOR(HTMLInputElementSelectionEnd) - -DECLARE_NAMED_ACCESS_CHECK(Location) -DECLARE_INDEXED_ACCESS_CHECK(History) - -DECLARE_NAMED_ACCESS_CHECK(History) -DECLARE_INDEXED_ACCESS_CHECK(Location) - -// HTMLCollection customized functions. -DECLARE_CALLBACK(HTMLCollectionItem) -DECLARE_CALLBACK(HTMLCollectionNamedItem) -// HTMLCollections are callable as functions. -DECLARE_CALLBACK(HTMLCollectionCallAsFunction) - -// HTMLSelectElement customized functions. -DECLARE_CALLBACK(HTMLSelectElementRemove) - -// HTMLOptionsCollection customized functions. -DECLARE_CALLBACK(HTMLOptionsCollectionRemove) -DECLARE_CALLBACK(HTMLOptionsCollectionAdd) - -// HTMLDocument customized functions -DECLARE_CALLBACK(HTMLDocumentWrite) -DECLARE_CALLBACK(HTMLDocumentWriteln) -DECLARE_CALLBACK(HTMLDocumentOpen) -DECLARE_PROPERTY_ACCESSOR(HTMLDocumentAll) -DECLARE_NAMED_PROPERTY_GETTER(HTMLDocument) -DECLARE_NAMED_PROPERTY_DELETER(HTMLDocument) - -// Document customized functions -DECLARE_CALLBACK(DocumentEvaluate) -DECLARE_CALLBACK(DocumentGetCSSCanvasContext) - -// Window customized functions -DECLARE_CALLBACK(DOMWindowAddEventListener) -DECLARE_CALLBACK(DOMWindowRemoveEventListener) -DECLARE_CALLBACK(DOMWindowPostMessage) -DECLARE_CALLBACK(DOMWindowSetTimeout) -DECLARE_CALLBACK(DOMWindowSetInterval) -DECLARE_CALLBACK(DOMWindowAtob) -DECLARE_CALLBACK(DOMWindowBtoa) -DECLARE_CALLBACK(DOMWindowNOP) -DECLARE_CALLBACK(DOMWindowToString) -DECLARE_CALLBACK(DOMWindowShowModalDialog) -DECLARE_CALLBACK(DOMWindowOpen) -DECLARE_CALLBACK(DOMWindowClearTimeout) -DECLARE_CALLBACK(DOMWindowClearInterval) - -DECLARE_CALLBACK(DOMParserConstructor) -DECLARE_CALLBACK(HTMLImageElementConstructor) -DECLARE_CALLBACK(HTMLOptionElementConstructor) -DECLARE_CALLBACK(MessageChannelConstructor) -DECLARE_CALLBACK(WebKitCSSMatrixConstructor) -DECLARE_CALLBACK(WebKitPointConstructor) -DECLARE_CALLBACK(XMLHttpRequestConstructor) -DECLARE_CALLBACK(XMLSerializerConstructor) -DECLARE_CALLBACK(XPathEvaluatorConstructor) -DECLARE_CALLBACK(XSLTProcessorConstructor) - -// Implementation of custom XSLTProcessor methods. -DECLARE_CALLBACK(XSLTProcessorImportStylesheet) -DECLARE_CALLBACK(XSLTProcessorTransformToFragment) -DECLARE_CALLBACK(XSLTProcessorTransformToDocument) -DECLARE_CALLBACK(XSLTProcessorSetParameter) -DECLARE_CALLBACK(XSLTProcessorGetParameter) -DECLARE_CALLBACK(XSLTProcessorRemoveParameter) - -// CSSPrimitiveValue customized functions -DECLARE_CALLBACK(CSSPrimitiveValueGetRGBColorValue) - -// Canvas 2D customized functions -DECLARE_CALLBACK(CanvasRenderingContext2DSetStrokeColor) -DECLARE_CALLBACK(CanvasRenderingContext2DSetFillColor) -DECLARE_CALLBACK(CanvasRenderingContext2DStrokeRect) -DECLARE_CALLBACK(CanvasRenderingContext2DSetShadow) -DECLARE_CALLBACK(CanvasRenderingContext2DDrawImage) -DECLARE_CALLBACK(CanvasRenderingContext2DDrawImageFromRect) -DECLARE_CALLBACK(CanvasRenderingContext2DCreatePattern) -DECLARE_CALLBACK(CanvasRenderingContext2DFillText) -DECLARE_CALLBACK(CanvasRenderingContext2DStrokeText) -DECLARE_CALLBACK(CanvasRenderingContext2DPutImageData) - -// Implementation of Clipboard attributes and methods. -DECLARE_PROPERTY_ACCESSOR_GETTER(ClipboardTypes) -DECLARE_CALLBACK(ClipboardClearData) -DECLARE_CALLBACK(ClipboardGetData) -DECLARE_CALLBACK(ClipboardSetData) -DECLARE_CALLBACK(ClipboardSetDragImage); - -// Implementation of Element methods. -DECLARE_CALLBACK(ElementQuerySelector) -DECLARE_CALLBACK(ElementQuerySelectorAll) -DECLARE_CALLBACK(ElementSetAttribute) -DECLARE_CALLBACK(ElementSetAttributeNode) -DECLARE_CALLBACK(ElementSetAttributeNS) -DECLARE_CALLBACK(ElementSetAttributeNodeNS) - -// Implementation of custom Location methods. -DECLARE_PROPERTY_ACCESSOR_SETTER(LocationProtocol) -DECLARE_PROPERTY_ACCESSOR_SETTER(LocationHost) -DECLARE_PROPERTY_ACCESSOR_SETTER(LocationHostname) -DECLARE_PROPERTY_ACCESSOR_SETTER(LocationPort) -DECLARE_PROPERTY_ACCESSOR_SETTER(LocationPathname) -DECLARE_PROPERTY_ACCESSOR_SETTER(LocationSearch) -DECLARE_PROPERTY_ACCESSOR_SETTER(LocationHash) -DECLARE_PROPERTY_ACCESSOR_SETTER(LocationHref) -DECLARE_PROPERTY_ACCESSOR_GETTER(LocationAssign) -DECLARE_PROPERTY_ACCESSOR_GETTER(LocationReplace) -DECLARE_PROPERTY_ACCESSOR_GETTER(LocationReload) -DECLARE_CALLBACK(LocationAssign) -DECLARE_CALLBACK(LocationReplace) -DECLARE_CALLBACK(LocationReload) -DECLARE_CALLBACK(LocationToString) -DECLARE_CALLBACK(LocationValueOf) - -// Implementation of custom Node methods. -DECLARE_CALLBACK(NodeAddEventListener) -DECLARE_CALLBACK(NodeRemoveEventListener) -DECLARE_CALLBACK(NodeInsertBefore) -DECLARE_CALLBACK(NodeReplaceChild) -DECLARE_CALLBACK(NodeRemoveChild) -DECLARE_CALLBACK(NodeAppendChild) - -// Custom implementation is Navigator properties. -// We actually only need this because WebKit has -// navigator.appVersion as custom. Our version just -// passes through. -DECLARE_PROPERTY_ACCESSOR(NavigatorAppVersion) - -// Custom implementation of XMLHttpRequest properties -DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestOnabort) -DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestOnerror) -DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestOnload) -DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestOnloadstart) -DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestOnprogress) -DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestOnreadystatechange) -DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestResponseText) -DECLARE_CALLBACK(XMLHttpRequestAddEventListener) -DECLARE_CALLBACK(XMLHttpRequestRemoveEventListener) -DECLARE_CALLBACK(XMLHttpRequestOpen) -DECLARE_CALLBACK(XMLHttpRequestSend) -DECLARE_CALLBACK(XMLHttpRequestSetRequestHeader) -DECLARE_CALLBACK(XMLHttpRequestGetResponseHeader) -DECLARE_CALLBACK(XMLHttpRequestOverrideMimeType) -DECLARE_CALLBACK(XMLHttpRequestDispatchEvent) - -// Custom implementation of XMLHttpRequestUpload properties -DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestUploadOnabort) -DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestUploadOnerror) -DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestUploadOnload) -DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestUploadOnloadstart) -DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestUploadOnprogress) -DECLARE_CALLBACK(XMLHttpRequestUploadAddEventListener) -DECLARE_CALLBACK(XMLHttpRequestUploadRemoveEventListener) -DECLARE_CALLBACK(XMLHttpRequestUploadDispatchEvent) - -// Custom implementation of TreeWalker functions -DECLARE_CALLBACK(TreeWalkerParentNode) -DECLARE_CALLBACK(TreeWalkerFirstChild) -DECLARE_CALLBACK(TreeWalkerLastChild) -DECLARE_CALLBACK(TreeWalkerNextNode) -DECLARE_CALLBACK(TreeWalkerPreviousNode) -DECLARE_CALLBACK(TreeWalkerNextSibling) -DECLARE_CALLBACK(TreeWalkerPreviousSibling) - -// Custom implementation of InspectorController functions -DECLARE_CALLBACK(InspectorControllerProfiles) -DECLARE_CALLBACK(InspectorControllerHighlightDOMNode) -DECLARE_CALLBACK(InspectorControllerAddResourceSourceToFrame) -DECLARE_CALLBACK(InspectorControllerGetResourceDocumentNode) -DECLARE_CALLBACK(InspectorControllerAddSourceToFrame) -DECLARE_CALLBACK(InspectorControllerSearch) -DECLARE_CALLBACK(InspectorControllerSetting) -DECLARE_CALLBACK(InspectorControllerInspectedWindow) -DECLARE_CALLBACK(InspectorControllerSetSetting) -DECLARE_CALLBACK(InspectorControllerCurrentCallFrame) -DECLARE_CALLBACK(InspectorControllerDebuggerEnabled) -DECLARE_CALLBACK(InspectorControllerPauseOnExceptions) -DECLARE_CALLBACK(InspectorControllerProfilerEnabled) -#if ENABLE(DATABASE) -DECLARE_CALLBACK(InspectorControllerDatabaseTableNames) -#endif -DECLARE_CALLBACK(InspectorControllerWrapCallback) - -// Custom implementation of NodeIterator functions -DECLARE_CALLBACK(NodeIteratorNextNode) -DECLARE_CALLBACK(NodeIteratorPreviousNode) - -// Custom implementation of NodeFilter function -DECLARE_CALLBACK(NodeFilterAcceptNode) - -// Custom implementation of HTMLFormElement -DECLARE_CALLBACK(HTMLFormElementSubmit) - -DECLARE_INDEXED_PROPERTY_GETTER(DOMStringList) -DECLARE_CALLBACK(DOMStringListItem) - -DECLARE_NAMED_PROPERTY_GETTER(DOMWindow) -DECLARE_INDEXED_PROPERTY_GETTER(DOMWindow) -DECLARE_NAMED_ACCESS_CHECK(DOMWindow) -DECLARE_INDEXED_ACCESS_CHECK(DOMWindow) - -DECLARE_NAMED_PROPERTY_GETTER(HTMLFrameSetElement) -DECLARE_NAMED_PROPERTY_GETTER(HTMLFormElement) -DECLARE_NAMED_PROPERTY_GETTER(NodeList) -DECLARE_NAMED_PROPERTY_GETTER(NamedNodeMap) -DECLARE_NAMED_PROPERTY_GETTER(CSSStyleDeclaration) -DECLARE_NAMED_PROPERTY_SETTER(CSSStyleDeclaration) -DECLARE_NAMED_PROPERTY_GETTER(HTMLPlugInElement) -DECLARE_NAMED_PROPERTY_SETTER(HTMLPlugInElement) -DECLARE_INDEXED_PROPERTY_GETTER(HTMLPlugInElement) -DECLARE_INDEXED_PROPERTY_SETTER(HTMLPlugInElement) - -// Plugin object can be called as function. -DECLARE_CALLBACK(HTMLPlugInElement) - -DECLARE_NAMED_PROPERTY_GETTER(StyleSheetList) -DECLARE_INDEXED_PROPERTY_GETTER(NamedNodeMap) -DECLARE_INDEXED_PROPERTY_GETTER(HTMLFormElement) -DECLARE_INDEXED_PROPERTY_GETTER(HTMLOptionsCollection) -DECLARE_INDEXED_PROPERTY_SETTER(HTMLOptionsCollection) -DECLARE_NAMED_PROPERTY_GETTER(HTMLSelectElementCollection) -DECLARE_INDEXED_PROPERTY_SETTER(HTMLSelectElementCollection) -DECLARE_NAMED_PROPERTY_GETTER(HTMLCollection) - -// Canvas and supporting classes -DECLARE_INDEXED_PROPERTY_GETTER(CanvasPixelArray) -DECLARE_INDEXED_PROPERTY_SETTER(CanvasPixelArray) - -// MessagePort -DECLARE_PROPERTY_ACCESSOR(MessagePortOnmessage) -DECLARE_PROPERTY_ACCESSOR(MessagePortOnclose) -DECLARE_CALLBACK(MessagePortStartConversation) -DECLARE_CALLBACK(MessagePortAddEventListener) -DECLARE_CALLBACK(MessagePortRemoveEventListener) - -// Database -DECLARE_CALLBACK(DatabaseChangeVersion) -DECLARE_CALLBACK(DatabaseTransaction) -DECLARE_CALLBACK(SQLTransactionExecuteSql) -DECLARE_CALLBACK(SQLResultSetRowListItem) - -// ClientRectList -DECLARE_INDEXED_PROPERTY_GETTER(ClientRectList) - -// SVG custom properties and callbacks -#if ENABLE(SVG) -DECLARE_PROPERTY_ACCESSOR_GETTER(SVGLengthValue) -DECLARE_CALLBACK(SVGLengthConvertToSpecifiedUnits) -DECLARE_CALLBACK(SVGMatrixInverse) -DECLARE_CALLBACK(SVGMatrixRotateFromVector) -DECLARE_CALLBACK(SVGElementInstanceAddEventListener) -DECLARE_CALLBACK(SVGElementInstanceRemoveEventListener) -#endif - -// Worker -#if ENABLE(WORKERS) -DECLARE_PROPERTY_ACCESSOR(WorkerOnmessage) -DECLARE_PROPERTY_ACCESSOR(WorkerOnerror) -DECLARE_CALLBACK(WorkerConstructor) -DECLARE_CALLBACK(WorkerAddEventListener) -DECLARE_CALLBACK(WorkerRemoveEventListener) - -DECLARE_PROPERTY_ACCESSOR_GETTER(WorkerContextSelf) -DECLARE_PROPERTY_ACCESSOR(WorkerContextOnmessage) -DECLARE_CALLBACK(WorkerContextImportScripts) -DECLARE_CALLBACK(WorkerContextSetTimeout) -DECLARE_CALLBACK(WorkerContextClearTimeout) -DECLARE_CALLBACK(WorkerContextSetInterval) -DECLARE_CALLBACK(WorkerContextClearInterval) -DECLARE_CALLBACK(WorkerContextAddEventListener) -DECLARE_CALLBACK(WorkerContextRemoveEventListener) -#endif - -#undef DECLARE_INDEXED_ACCESS_CHECK -#undef DECLARE_NAMED_ACCESS_CHECK - -#undef DECLARE_PROPERTY_ACCESSOR_SETTER -#undef DECLARE_PROPERTY_ACCESSOR_GETTER -#undef DECLARE_PROPERTY_ACCESSOR - -#undef DECLARE_NAMED_PROPERTY_GETTER -#undef DECLARE_NAMED_PROPERTY_SETTER -#undef DECLARE_NAMED_PROPERTY_DELETER - -#undef DECLARE_INDEXED_PROPERTY_GETTER -#undef DECLARE_INDEXED_PROPERTY_SETTER -#undef DECLARE_INDEXED_PROPERTY_DELETER - -#undef DECLARE_CALLBACK - - // Returns the NPObject corresponding to an HTMLElement object. - static NPObject* GetHTMLPlugInElementNPObject(v8::Handle<v8::Object> object); - - // Returns the owner frame pointer of a DOM wrapper object. It only works for - // these DOM objects requiring cross-domain access check. - static Frame* GetTargetFrame(v8::Local<v8::Object> host, - v8::Local<v8::Value> data); - - // Special case for downcasting SVG path segments -#if ENABLE(SVG) - static V8ClassIndex::V8WrapperType DowncastSVGPathSeg(void* path_seg); -#endif - - private: - static v8::Handle<v8::Value> WindowSetTimeoutImpl(const v8::Arguments& args, - bool single_shot); - static void ClearTimeoutImpl(const v8::Arguments& args); - static void WindowSetLocation(DOMWindow*, const String&); -}; - -} // namespace WebCore - -#endif // V8_CUSTOM_H__ diff --git a/webkit/port/bindings/v8/v8_proxy.cpp b/webkit/port/bindings/v8/v8_proxy.cpp index 0494044..48f0ec4 100644 --- a/webkit/port/bindings/v8/v8_proxy.cpp +++ b/webkit/port/bindings/v8/v8_proxy.cpp @@ -38,7 +38,6 @@ #include "v8_proxy.h" #include "v8_index.h" #include "v8_binding.h" -#include "v8_custom.h" #include "V8Collection.h" #include "V8DOMWindow.h" @@ -47,6 +46,7 @@ #include "DOMObjectsInclude.h" #include "DocumentLoader.h" #include "ScriptController.h" +#include "V8CustomBinding.h" #include "V8DOMMap.h" namespace WebCore { diff --git a/webkit/port/bindings/v8/v8_proxy.h b/webkit/port/bindings/v8/v8_proxy.h index 5fe78bf..48e20a9 100644 --- a/webkit/port/bindings/v8/v8_proxy.h +++ b/webkit/port/bindings/v8/v8_proxy.h @@ -7,7 +7,6 @@ #include <v8.h> #include "v8_index.h" -#include "v8_custom.h" #include "v8_utility.h" #include "ChromiumBridge.h" #include "Node.h" @@ -15,6 +14,7 @@ #include "PlatformString.h" // for WebCore::String #include "ScriptSourceCode.h" // for WebCore::ScriptSourceCode #include "SecurityOrigin.h" // for WebCore::SecurityOrigin +#include "V8CustomBinding.h" #include "V8DOMMap.h" #include "V8EventListenerList.h" #include <wtf/Assertions.h> diff --git a/webkit/tools/test_shell/image_decoder_unittest.cc b/webkit/tools/test_shell/image_decoder_unittest.cc index f946e48..0c767e8 100644 --- a/webkit/tools/test_shell/image_decoder_unittest.cc +++ b/webkit/tools/test_shell/image_decoder_unittest.cc @@ -46,21 +46,19 @@ std::wstring GetMD5SumPath(const std::wstring& path) { #ifdef CALCULATE_MD5_SUMS void SaveMD5Sum(const std::wstring& path, WebCore::RGBA32Buffer* buffer) { - // Create the file to write. - ScopedHandle handle(CreateFile(path.c_str(), GENERIC_WRITE, 0, - NULL, CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL, NULL)); - ASSERT_TRUE(handle.IsValid()); - // Calculate MD5 sum. MD5Digest digest; - SkAutoLockPixels bmp_lock(buffer->bitmap()); - MD5Sum(buffer->bitmap().getPixels(), - buffer->rect().width() * buffer->rect().height() * sizeof(unsigned), - &digest); + scoped_ptr<NativeImageSkia> image_data(buffer->asNewNativeImage()); + { + SkAutoLockPixels bmp_lock(*image_data); + MD5Sum(image_data->getPixels(), + image_data->width() * image_data->height() * sizeof(uint32_t), + &digest); + } // Write sum to disk. - int bytes_written = file_util::WriteFile(path, &digest, sizeof digest); + int bytes_written = file_util::WriteFile(path, + reinterpret_cast<const char*>(&digest), sizeof digest); ASSERT_EQ(sizeof digest, bytes_written); } #else @@ -77,9 +75,13 @@ void VerifyImage(WebCore::ImageDecoder* decoder, // Calculate MD5 sum. MD5Digest actual_digest; - SkAutoLockPixels bmp_lock(image_buffer->bitmap()); - MD5Sum(image_buffer->bitmap().getPixels(), image_buffer->rect().width() * - image_buffer->rect().height() * sizeof(unsigned), &actual_digest); + scoped_ptr<NativeImageSkia> image_data(image_buffer->asNewNativeImage()); + { + SkAutoLockPixels bmp_lock(*image_data); + MD5Sum(image_data->getPixels(), + image_data->width() * image_data->height() * sizeof(uint32_t), + &actual_digest); + } // Read the MD5 sum off disk. std::string file_bytes; diff --git a/webkit/webkit.gyp b/webkit/webkit.gyp index e032747..4015e4a 100644 --- a/webkit/webkit.gyp +++ b/webkit/webkit.gyp @@ -1057,6 +1057,7 @@ '../third_party/WebKit/WebCore/bindings/v8/custom/V8StyleSheetListCustom.cpp', '../third_party/WebKit/WebCore/bindings/v8/custom/V8TreeWalkerCustom.cpp', '../third_party/WebKit/WebCore/bindings/v8/custom/V8WebKitCSSMatrixConstructor.cpp', + '../third_party/WebKit/WebCore/bindings/v8/custom/V8WebKitPointConstructor.cpp', '../third_party/WebKit/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp', '../third_party/WebKit/WebCore/bindings/v8/custom/V8WorkerCustom.cpp', '../third_party/WebKit/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp', @@ -1144,8 +1145,6 @@ 'port/bindings/v8/npruntime_priv.h', 'port/bindings/v8/v8_binding.h', 'port/bindings/v8/v8_binding.cpp', - 'port/bindings/v8/v8_custom.cpp', - 'port/bindings/v8/v8_custom.h', 'port/bindings/v8/v8_helpers.cpp', 'port/bindings/v8/v8_helpers.h', 'port/bindings/v8/v8_index.cpp', |