-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core: move logging soruce to googleurl
- Loading branch information
1 parent
e6a84a1
commit b8e9207
Showing
18 changed files
with
232 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2012 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// This file contains utility functions for dealing with the local | ||
// filesystem. | ||
|
||
#ifndef BASE_FILES_FILE_UTIL_H_ | ||
#define BASE_FILES_FILE_UTIL_H_ | ||
|
||
#include <string> | ||
|
||
#include "base/base_export.h" | ||
|
||
namespace gurl_base { | ||
|
||
// Get the temporary directory provided by the system. | ||
// | ||
// WARNING: In general, you should use CreateTemporaryFile variants below | ||
// instead of this function. Those variants will ensure that the proper | ||
// permissions are set so that other users on the system can't edit them while | ||
// they're open (which can lead to security issues). | ||
BASE_EXPORT bool GetTempDir(std::string* path); | ||
|
||
} // namespace gurl_base | ||
|
||
#endif // BASE_FILES_FILE_UTIL_H_ |
38 changes: 38 additions & 0 deletions
38
third_party/googleurl-override/base/files/file_util_apple.mm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2012 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "base/files/file_util.h" | ||
|
||
#import <Foundation/Foundation.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
#include "base/strings/sys_string_conversions.h" | ||
|
||
namespace gurl_base { | ||
|
||
bool GetTempDir(std::string* path) { | ||
// In order to facilitate hermetic runs on macOS, first check | ||
// MAC_CHROMIUM_TMPDIR. This is used instead of TMPDIR for historical reasons. | ||
// This was originally done for https://crbug.com/698759 (TMPDIR too long for | ||
// process singleton socket path), but is hopefully obsolete as of | ||
// https://crbug.com/1266817 (allows a longer process singleton socket path). | ||
// Continue tracking MAC_CHROMIUM_TMPDIR as that's what build infrastructure | ||
// sets on macOS. | ||
const char* env_tmpdir = getenv("GURL_BASE_TMPDIR"); | ||
if (env_tmpdir) { | ||
*path = std::string(env_tmpdir); | ||
return true; | ||
} | ||
|
||
// If we didn't find it, fall back to the native function. | ||
NSString* tmp = NSTemporaryDirectory(); | ||
if (tmp == nil) { | ||
return false; | ||
} | ||
*path = gurl_base::SysNSStringToUTF8(tmp); | ||
return true; | ||
} | ||
|
||
} // namespace gurl_base |
52 changes: 52 additions & 0 deletions
52
third_party/googleurl-override/base/process/process_handle.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright 2013 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef BASE_PROCESS_PROCESS_HANDLE_H_ | ||
#define BASE_PROCESS_PROCESS_HANDLE_H_ | ||
|
||
#include <stdint.h> | ||
#include <sys/types.h> | ||
|
||
#include <compare> | ||
#include <iosfwd> | ||
|
||
#include "base/base_export.h" | ||
#include "build/build_config.h" | ||
|
||
#if BUILDFLAG(IS_WIN) | ||
#include "base/win/windows_types.h" | ||
#endif | ||
|
||
namespace gurl_base { | ||
|
||
// ProcessHandle is a platform specific type which represents the underlying OS | ||
// handle to a process. | ||
// ProcessId is a number which identifies the process in the OS. | ||
#if BUILDFLAG(IS_WIN) | ||
typedef HANDLE ProcessHandle; | ||
typedef DWORD ProcessId; | ||
typedef HANDLE UserTokenHandle; | ||
const ProcessHandle kNullProcessHandle = NULL; | ||
const ProcessId kNullProcessId = 0; | ||
#elif BUILDFLAG(IS_FUCHSIA) | ||
typedef zx_handle_t ProcessHandle; | ||
typedef zx_koid_t ProcessId; | ||
const ProcessHandle kNullProcessHandle = ZX_HANDLE_INVALID; | ||
const ProcessId kNullProcessId = ZX_KOID_INVALID; | ||
#elif BUILDFLAG(IS_POSIX) | ||
// On POSIX, our ProcessHandle will just be the PID. | ||
typedef pid_t ProcessHandle; | ||
typedef pid_t ProcessId; | ||
const ProcessHandle kNullProcessHandle = 0; | ||
const ProcessId kNullProcessId = 0; | ||
#endif // BUILDFLAG(IS_WIN) | ||
|
||
// Returns the id of the current process. | ||
// Note that on some platforms, this is not guaranteed to be unique across | ||
// processes (use GetUniqueIdForProcess if uniqueness is required). | ||
BASE_EXPORT ProcessId GetCurrentProcId(); | ||
|
||
} // namespace gurl_base | ||
|
||
#endif // BASE_PROCESS_PROCESS_HANDLE_H_ |
15 changes: 15 additions & 0 deletions
15
third_party/googleurl-override/base/process/process_handle_posix.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright 2013 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "base/process/process_handle.h" | ||
|
||
#include <unistd.h> | ||
|
||
namespace gurl_base { | ||
|
||
ProcessId GetCurrentProcId() { | ||
return getpid(); | ||
} | ||
|
||
} // namespace gurl_base |
15 changes: 15 additions & 0 deletions
15
third_party/googleurl-override/base/process/process_handle_win.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright 2013 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "base/process/process_handle.h" | ||
|
||
#include <windows.h> | ||
|
||
namespace gurl_base { | ||
|
||
ProcessId GetCurrentProcId() { | ||
return ::GetCurrentProcessId(); | ||
} | ||
|
||
} // namespace gurl_base |
File renamed without changes.
Oops, something went wrong.