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

Unified Diff: third_party/mojo/src/mojo/edk/system/unique_identifier.cc

Issue 1676913002: [mojo] Delete third_party/mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: let's try that again Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/mojo/src/mojo/edk/system/unique_identifier.cc
diff --git a/third_party/mojo/src/mojo/edk/system/unique_identifier.cc b/third_party/mojo/src/mojo/edk/system/unique_identifier.cc
deleted file mode 100644
index 22abf221b9536a942e244a9809aa55f349ff2225..0000000000000000000000000000000000000000
--- a/third_party/mojo/src/mojo/edk/system/unique_identifier.cc
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "third_party/mojo/src/mojo/edk/system/unique_identifier.h"
-
-#include <stdint.h>
-
-#include <vector>
-
-#include "base/strings/string_number_conversions.h"
-#include "third_party/mojo/src/mojo/edk/embedder/platform_support.h"
-
-namespace mojo {
-namespace system {
-
-// static
-UniqueIdentifier UniqueIdentifier::Generate(
- embedder::PlatformSupport* platform_support) {
- UniqueIdentifier rv;
- platform_support->GetCryptoRandomBytes(rv.data_, sizeof(rv.data_));
- return rv;
-}
-
-// static
-UniqueIdentifier UniqueIdentifier::FromString(const std::string& s,
- bool* success) {
- UniqueIdentifier rv;
- std::vector<uint8_t> bytes;
- if (base::HexStringToBytes(s, &bytes) && bytes.size() == sizeof(rv.data_)) {
- memcpy(rv.data_, &bytes[0], sizeof(rv.data_));
- *success = true;
- } else {
- *success = false;
- }
- return rv;
-}
-
-std::string UniqueIdentifier::ToString() const {
- // TODO(vtl): Maybe we should base-64 encode instead?
- return base::HexEncode(data_, sizeof(data_));
-}
-
-} // namespace system
-} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698