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

Unified Diff: mojo/edk/embedder/platform_channel_pair.cc

Issue 1492623002: EDK: Add functions for converting between strings and numbers. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/edk/util/BUILD.gn » ('j') | mojo/edk/util/string_number_conversions.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/embedder/platform_channel_pair.cc
diff --git a/mojo/edk/embedder/platform_channel_pair.cc b/mojo/edk/embedder/platform_channel_pair.cc
index 98761deea44b855c9648ec032ea20ba45889d406..2a143b623d60d434fbeeb133c90e723ef5ca1fb9 100644
--- a/mojo/edk/embedder/platform_channel_pair.cc
+++ b/mojo/edk/embedder/platform_channel_pair.cc
@@ -11,12 +11,14 @@
#include "base/logging.h"
#include "base/posix/global_descriptors.h"
-#include "base/strings/string_number_conversions.h"
#include "build/build_config.h"
#include "mojo/edk/platform/platform_handle.h"
+#include "mojo/edk/util/string_number_conversions.h"
using mojo::platform::PlatformHandle;
using mojo::platform::ScopedPlatformHandle;
+using mojo::util::NumberToString;
+using mojo::util::StringToNumberWithError;
namespace mojo {
namespace embedder {
@@ -78,7 +80,7 @@ ScopedPlatformHandle PlatformChannelPair::PassClientHandle() {
ScopedPlatformHandle PlatformChannelPair::PassClientHandleFromParentProcess(
const std::string& string_from_parent) {
int client_fd = -1;
- if (!base::StringToInt(string_from_parent, &client_fd)) {
+ if (!StringToNumberWithError<int>(string_from_parent, &client_fd)) {
LOG(ERROR) << "Missing or invalid --" << kMojoPlatformChannelHandleSwitch;
return ScopedPlatformHandle();
}
@@ -106,7 +108,7 @@ void PlatformChannelPair::PrepareToPassClientHandleToChildProcess(
handle_passing_info->push_back(
std::pair<int, int>(client_handle_.get().fd, target_fd));
- *string_for_child = base::IntToString(target_fd);
+ *string_for_child = NumberToString<int>(target_fd);
}
void PlatformChannelPair::ChildProcessLaunched() {
« no previous file with comments | « no previous file | mojo/edk/util/BUILD.gn » ('j') | mojo/edk/util/string_number_conversions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698