Descriptionbindings: Adjust usage of CORE_EXPORT in IDLTypes and NativeValueTraits
Follow-up to https://codereview.chromium.org/2730183003:
* The types in IDLTypes.h are traits types with no member functions, so
using CORE_EXPORT does not have any effect and we can drop it.
* Export the entire NativeValueTraits specializations in
NativeValueTraitsImpl.h instead of only their nativeValue() member
functions.
In addition to avoiding some repetition in the code, doing so also solves
some linkage issues on Windows with debug component builds, where targets
such as 'webkit_unit_tests' or 'blink_media_unittests' would fail to
reference the aforementioned specializations and lead to errors like this:
FAILED: media_blink_unittests.exe media_blink_unittests.exe.pdb
E:/b/depot_tools/python276_bin/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 False link.exe /nologo /OUT:./media_blink_unittests.exe /PDB:./media_blink_unittests.exe.pdb @./media_blink_unittests.exe.rsp
V8RecordTest.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class WTF::Vector<struct std::pair<class WTF::String,int>,0,class WTF::PartitionAllocator> __cdecl blink::NativeValueTraits<struct blink::IDLRecord<struct blink::IDLString,struct blink::IDLLong> >::nativeValue(class v8::Isolate *,class v8::Local<class v8::Value>,class blink::ExceptionState &)" (__imp_?nativeValue@?$NativeValueTraits@U?$IDLRecord@UIDLString@blink@@UIDLLong@2@@blink@@@blink@@SA?AV?$Vector@U?$pair@VString@WTF@@H@std@@$0A@VPartitionAllocator@WTF@@@WTF@@PEAVIsolate@v8@@V?$Local@VValue@v8@@@6@AEAVExceptionState@2@@Z) referenced in function "void __cdecl blink::RecordTestV8Internal::setStringLongRecordMethod(class v8::FunctionCallbackInfo<class v8::Value> const &)" (?setStringLongRecordMethod@RecordTestV8Internal@blink@@YAXAEBV?$FunctionCallbackInfo@VValue@v8@@@v8@@@Z)
The exception to the rule here is IDLSequence: since it needs template
parameters of its own, it is not a full specialization of
NativeValueTraitsBase, and at least win_clang complains when it is
exported:
E:\b\c\b\win_clang\src\third_party\WebKit\Source\bindings\core\v8\NativeValueTraitsImpl.h(289,8): error: 'dllimport' attribute ignored [-Werror,-Wignored-attributes]
struct CORE_EXPORT NativeValueTraits<IDLSequence<T>>
BUG=685754
R=bashi@chromium.org,haraken@chromium.org,yukishiino@chromium.org
Review-Url: https://codereview.chromium.org/2742453002
Cr-Commit-Position: refs/heads/master@{#455750}
Committed: https://chromium.googlesource.com/chromium/src/+/5254358bc67bb4f7ef54cc68a69387d5aabd719e
Patch Set 1 #Patch Set 2 : Stop exporting NativeValueTraits<IDLSequence<T>> #
Total comments: 3
Dependent Patchsets: Messages
Total messages: 17 (10 generated)
|