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

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

Issue 18778002: Inherit EventTarget interface instead of duplicating its code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 21 matching lines...) Expand all
32 32
33 namespace WebCore { 33 namespace WebCore {
34 34
35 void V8DataView::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& ar gs) 35 void V8DataView::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& ar gs)
36 { 36 {
37 if (!args.Length()) { 37 if (!args.Length()) {
38 // see constructWebGLArray -- we don't seem to be able to distingish bet ween 38 // see constructWebGLArray -- we don't seem to be able to distingish bet ween
39 // 'new DataView()' and the call used to construct the cached DataView o bject. 39 // 'new DataView()' and the call used to construct the cached DataView o bject.
40 RefPtr<DataView> dataView = DataView::create(0); 40 RefPtr<DataView> dataView = DataView::create(0);
41 v8::Handle<v8::Object> wrapper = args.Holder(); 41 v8::Handle<v8::Object> wrapper = args.Holder();
42 V8DOMWrapper::associateObjectWithWrapper(dataView.release(), &info, wrap per, args.GetIsolate(), WrapperConfiguration::Dependent); 42 V8DOMWrapper::associateObjectWithWrapper<V8DataView>(dataView.release(), &info, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent);
43 args.GetReturnValue().Set(wrapper); 43 args.GetReturnValue().Set(wrapper);
44 return; 44 return;
45 } 45 }
46 if (args[0]->IsNull() || !V8ArrayBuffer::HasInstance(args[0], args.GetIsolat e(), worldType(args.GetIsolate()))) { 46 if (args[0]->IsNull() || !V8ArrayBuffer::HasInstance(args[0], args.GetIsolat e(), worldType(args.GetIsolate()))) {
47 throwTypeError(0, args.GetIsolate()); 47 throwTypeError(0, args.GetIsolate());
48 return; 48 return;
49 } 49 }
50 constructWebGLArrayWithArrayBufferArgument<DataView, char>(args, &info, v8:: kExternalByteArray, false); 50 constructWebGLArrayWithArrayBufferArgument<DataView, char, V8DataView>(args, &info, v8::kExternalByteArray, false);
51 } 51 }
52 52
53 // FIXME: Don't need this override. 53 // FIXME: Don't need this override.
54 v8::Handle<v8::Object> wrap(DataView* impl, v8::Handle<v8::Object> creationConte xt, v8::Isolate* isolate) 54 v8::Handle<v8::Object> wrap(DataView* impl, v8::Handle<v8::Object> creationConte xt, v8::Isolate* isolate)
55 { 55 {
56 ASSERT(impl); 56 ASSERT(impl);
57 return V8DataView::createWrapper(impl, creationContext, isolate); 57 return V8DataView::createWrapper(impl, creationContext, isolate);
58 } 58 }
59 59
60 } // namespace WebCore 60 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/custom/V8AudioContextCustom.cpp ('k') | Source/bindings/v8/custom/V8FormDataCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698