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

Side by Side Diff: Source/bindings/v8/custom/V8FormDataCustom.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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 29 matching lines...) Expand all
40 namespace WebCore { 40 namespace WebCore {
41 41
42 void V8FormData::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& ar gs) 42 void V8FormData::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& ar gs)
43 { 43 {
44 HTMLFormElement* form = 0; 44 HTMLFormElement* form = 0;
45 if (args.Length() > 0 && V8HTMLFormElement::HasInstance(args[0], args.GetIso late(), worldType(args.GetIsolate()))) 45 if (args.Length() > 0 && V8HTMLFormElement::HasInstance(args[0], args.GetIso late(), worldType(args.GetIsolate())))
46 form = V8HTMLFormElement::toNative(args[0]->ToObject()); 46 form = V8HTMLFormElement::toNative(args[0]->ToObject());
47 RefPtr<DOMFormData> domFormData = DOMFormData::create(form); 47 RefPtr<DOMFormData> domFormData = DOMFormData::create(form);
48 48
49 v8::Handle<v8::Object> wrapper = args.Holder(); 49 v8::Handle<v8::Object> wrapper = args.Holder();
50 V8DOMWrapper::associateObjectWithWrapper(domFormData.release(), &info, wrapp er, args.GetIsolate(), WrapperConfiguration::Dependent); 50 V8DOMWrapper::associateObjectWithWrapper<V8FormData>(domFormData.release(), &info, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent);
51 args.GetReturnValue().Set(wrapper); 51 args.GetReturnValue().Set(wrapper);
52 } 52 }
53 53
54 void V8FormData::appendMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& a rgs) 54 void V8FormData::appendMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& a rgs)
55 { 55 {
56 if (args.Length() < 2) { 56 if (args.Length() < 2) {
57 throwError(v8SyntaxError, "Not enough arguments", args.GetIsolate()); 57 throwError(v8SyntaxError, "Not enough arguments", args.GetIsolate());
58 return; 58 return;
59 } 59 }
60 60
(...skipping 10 matching lines...) Expand all
71 String filename; 71 String filename;
72 if (args.Length() >= 3 && !args[2]->IsUndefined()) 72 if (args.Length() >= 3 && !args[2]->IsUndefined())
73 filename = toWebCoreStringWithNullCheck(args[2]); 73 filename = toWebCoreStringWithNullCheck(args[2]);
74 74
75 domFormData->append(name, blob, filename); 75 domFormData->append(name, blob, filename);
76 } else 76 } else
77 domFormData->append(name, toWebCoreStringWithNullCheck(arg)); 77 domFormData->append(name, toWebCoreStringWithNullCheck(arg));
78 } 78 }
79 79
80 } // namespace WebCore 80 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/custom/V8DataViewCustom.cpp ('k') | Source/bindings/v8/custom/V8HTMLImageElementConstructor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698