-
Notifications
You must be signed in to change notification settings - Fork 16.2k
refactor: use std::string instead of base::string16 for IPC channel names #14286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
2d0a152
to
db62ef3
Compare
@@ -34,8 +34,7 @@ RemoteCallbackFreer::RemoteCallbackFreer(v8::Isolate* isolate, | |||
RemoteCallbackFreer::~RemoteCallbackFreer() {} | |||
|
|||
void RemoteCallbackFreer::RunDestructor() { | |||
base::string16 channel = | |||
base::ASCIIToUTF16("ELECTRON_RENDERER_RELEASE_CALLBACK"); | |||
auto channel = "ELECTRON_RENDERER_RELEASE_CALLBACK"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FTBFS:
../../electron/atom/common/api/remote_callback_freer.cc:37:3: error: [chromium-style] auto variable type must not deduce to a raw pointer type.
auto channel = "ELECTRON_RENDERER_RELEASE_CALLBACK";
^~~~
auto*
1 error generated.
[17094/17960] CXX obj/electron/electron_lib/atom_renderer_client.o
[17095/17960] CXX obj/electron/electron_lib/atom_render_frame_observer.o
https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/PMxDx7eR_YY has this info:
the solution is typically to make the pointer part of the type be outside of auto, so instead of
auto foo = new Foo;
write
auto* foo = new Foo;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ckerr fixed
db62ef3
to
8493c9f
Compare
@ckerr this should not be a breaking change, it's just changing an implementation detail. I've added a test with special chars in the IPC channel name. |
8493c9f
to
e14be34
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice improvement. Thanks for thinking of this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of the CI runs are dying in the linker at
v8.dll.lib(v8.dll) : error LNK2005: "public: unsigned __int64 __cdecl v8_inspector::StringView::length(void)const " (?length@StringView@v8_inspector@@QEBA_KXZ) already defined in node_string.obj
v8.dll.lib(v8.dll) : error LNK2005: "public: unsigned short const * __cdecl v8_inspector::StringView::characters16(void)const " (?characters16@StringView@v8_inspector@@QEBAPEBGXZ) already defined in node_string.obj
./node_lib.dll : fatal error LNK1169: one or more multiply defined symbols found
18119
At first glance I don't see the cause, but it's suspicious that other PR's CI runs are passing. @miniak can you investigate this, ie either fix the problem if it's in this PR, or confirm that it's unrelated?
No Release Notes |
Description of Change
There is no need to use UTF-16 for IPC channel names, as they are almost always ASCII strings (UTF-8 is therefore more efficient). This change makes IPC messages slightly smaller, which should improve performance slightly.
Checklist
npm test
passesRelease Notes
Notes: no-notes