Skip to content

Commit

Permalink
linux: components build
Browse files Browse the repository at this point in the history
Reapply r83630, r83629, r83583, and fix the one compile error.

TBR=rvargas

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83740 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
evan@chromium.org committed May 2, 2011
1 parent 4d223f4 commit 68a008e
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 24 deletions.
2 changes: 1 addition & 1 deletion base/debug/trace_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class ProcessMetrics;

namespace debug {

class TraceLog {
class BASE_API TraceLog {
public:
enum EventType {
EVENT_BEGIN,
Expand Down
2 changes: 1 addition & 1 deletion base/environment.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace base {
namespace env_vars {

#if defined(OS_POSIX)
extern const char kHome[];
BASE_API extern const char kHome[];
#endif

} // namespace env_vars
Expand Down
6 changes: 3 additions & 3 deletions base/file_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ BASE_API bool SetLastModifiedTime(const FilePath& path,

#if defined(OS_POSIX)
// Store inode number of |path| in |inode|. Return true on success.
bool GetInode(const FilePath& path, ino_t* inode);
BASE_API bool GetInode(const FilePath& path, ino_t* inode);
#endif

// Wrapper for fopen-like calls. Returns non-NULL FILE* on success.
Expand All @@ -365,7 +365,7 @@ BASE_API int ReadFile(const FilePath& filename, char* data, int size);
BASE_API int WriteFile(const FilePath& filename, const char* data, int size);
#if defined(OS_POSIX)
// Append the data to |fd|. Does not close |fd| when done.
int WriteFileDescriptor(const int fd, const char* data, int size);
BASE_API int WriteFileDescriptor(const int fd, const char* data, int size);
#endif

// Gets the current working directory for the process.
Expand Down Expand Up @@ -648,7 +648,7 @@ enum FileSystemType {

// Attempts determine the FileSystemType for |path|.
// Returns false if |path| doesn't exist.
bool GetFileSystemType(const FilePath& path, FileSystemType* type);
BASE_API bool GetFileSystemType(const FilePath& path, FileSystemType* type);
#endif

} // namespace file_util
Expand Down
2 changes: 1 addition & 1 deletion base/global_descriptors_posix.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace base {
// It maps from an abstract key to a descriptor. If independent modules each
// need to define keys, then values should be chosen randomly so as not to
// collide.
class GlobalDescriptors {
class BASE_API GlobalDescriptors {
public:
typedef uint32_t Key;
typedef std::vector<std::pair<Key, int> > Mapping;
Expand Down
6 changes: 4 additions & 2 deletions base/linux_util.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.

Expand All @@ -11,6 +11,8 @@

#include <string>

#include "base/base_api.h"

namespace base {

static const char kFindInodeSwitch[] = "--find-inode";
Expand All @@ -26,7 +28,7 @@ std::string GetLinuxDistro();
void SetLinuxDistro(const std::string& distro);

// Return the inode number for the UNIX domain socket |fd|.
bool FileDescriptorGetInode(ino_t* inode_out, int fd);
BASE_API bool FileDescriptorGetInode(ino_t* inode_out, int fd);

// Find the process which holds the given socket, named by inode number. If
// multiple processes hold the socket, this function returns false.
Expand Down
13 changes: 8 additions & 5 deletions base/mime_util.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.

Expand All @@ -8,6 +8,9 @@

#include <string>

#include "base/base_api.h"
#include "build/build_config.h"

class FilePath;

namespace mime_util {
Expand All @@ -16,23 +19,23 @@ namespace mime_util {
// have to exist. Please note because it doesn't touch the disk, this does not
// work for directories.
// If the mime type is unknown, this will return application/octet-stream.
std::string GetFileMimeType(const FilePath& filepath);
BASE_API std::string GetFileMimeType(const FilePath& filepath);

// Get the mime type for a byte vector.
std::string GetDataMimeType(const std::string& data);
BASE_API std::string GetDataMimeType(const std::string& data);

#if defined(TOOLKIT_GTK)
// This detects the current GTK theme by calling gtk_settings_get_default().
// It should only be executed on the UI thread and must be called before
// GetMimeIcon().
void DetectGtkTheme();
BASE_API void DetectGtkTheme();
#endif

// Gets the file name for an icon given the mime type and icon pixel size.
// Where an icon is a square image of |size| x |size|.
// This will try to find the closest matching icon. If that's not available,
// then a generic icon, and finally an empty FilePath if all else fails.
FilePath GetMimeIcon(const std::string& mime_type, size_t size);
BASE_API FilePath GetMimeIcon(const std::string& mime_type, size_t size);

} // namespace mime_util

Expand Down
6 changes: 3 additions & 3 deletions base/process_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ BASE_API ProcessId GetProcId(ProcessHandle process);

#if defined(OS_LINUX)
// Returns the path to the executable of the given process.
FilePath GetProcessExecutablePath(ProcessHandle process);
BASE_API FilePath GetProcessExecutablePath(ProcessHandle process);

// Parse the data found in /proc/<pid>/stat and return the sum of the
// CPU-related ticks. Returns -1 on parse error.
Expand All @@ -177,7 +177,7 @@ static const char kAdjustOOMScoreSwitch[] = "--adjust-oom-score";
// This adjusts /proc/process/oom_adj so the Linux OOM killer will prefer
// certain process types over others. The range for the adjustment is
// [-17,15], with [0,15] being user accessible.
bool AdjustOOMScore(ProcessId process, int score);
BASE_API bool AdjustOOMScore(ProcessId process, int score);
#endif

#if defined(OS_POSIX)
Expand All @@ -187,7 +187,7 @@ BASE_API ProcessId GetParentProcessId(ProcessHandle process);
// Close all file descriptors, except those which are a destination in the
// given multimap. Only call this function in a child process where you know
// that there aren't any other threads.
void CloseSuperfluousFds(const InjectiveMultimap& saved_map);
BASE_API void CloseSuperfluousFds(const InjectiveMultimap& saved_map);
#endif

#if defined(OS_WIN)
Expand Down
6 changes: 4 additions & 2 deletions base/rand_util_c.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.

#ifndef BASE_RAND_UTIL_C_H_
#define BASE_RAND_UTIL_C_H_
#pragma once

#include "base/base_api.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand All @@ -15,7 +17,7 @@ extern "C" {

// Returns an FD for /dev/urandom, possibly pre-opened before sandboxing
// was switched on. This is a C function so that Native Client can use it.
int GetUrandomFD(void);
BASE_API int GetUrandomFD(void);

#ifdef __cplusplus
}
Expand Down
8 changes: 5 additions & 3 deletions base/safe_strerror_posix.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.

Expand All @@ -8,6 +8,8 @@

#include <string>

#include "base/base_api.h"

// BEFORE using anything from this file, first look at PLOG and friends in
// logging.h and use them instead if applicable.
//
Expand All @@ -24,14 +26,14 @@
// result is always null-terminated. The value of errno is never changed.
//
// Use this instead of strerror_r().
void safe_strerror_r(int err, char *buf, size_t len);
BASE_API void safe_strerror_r(int err, char *buf, size_t len);

// Calls safe_strerror_r with a buffer of suitable size and returns the result
// in a C++ string.
//
// Use this instead of strerror(). Note though that safe_strerror_r will be
// more robust in the case of heap corruption errors, since it doesn't need to
// allocate a string.
std::string safe_strerror(int err);
BASE_API std::string safe_strerror(int err);

#endif // BASE_SAFE_STRERROR_POSIX_H_
3 changes: 2 additions & 1 deletion net/proxy/proxy_config_service_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <string>
#include <vector>

#include "base/base_api.h"
#include "base/basictypes.h"
#include "base/environment.h"
#include "base/memory/ref_counted.h"
Expand All @@ -23,7 +24,7 @@ namespace net {

// Implementation of ProxyConfigService that retrieves the system proxy
// settings from environment variables or gconf.
class ProxyConfigServiceLinux : public ProxyConfigService {
class BASE_API ProxyConfigServiceLinux : public ProxyConfigService {
public:

// Forward declaration of Delegate.
Expand Down
6 changes: 4 additions & 2 deletions sandbox/linux/suid/process_util.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 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.

Expand All @@ -11,11 +11,13 @@
#include <stdbool.h>
#include <sys/types.h>

#include "base/base_api.h"

static const char kAdjustOOMScoreSwitch[] = "--adjust-oom-score";

// This adjusts /proc/process/oom_adj so the Linux OOM killer will prefer
// certain process types over others. The range for the adjustment is
// [-17,15], with [0,15] being user accessible.
bool AdjustOOMScore(pid_t process, int score);
BASE_API bool AdjustOOMScore(pid_t process, int score);

#endif // SANDBOX_LINUX_SUID_PROCESS_UTIL_H_

0 comments on commit 68a008e

Please sign in to comment.