diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-24 19:00:20 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-24 19:00:20 +0000 |
commit | f5661ca939b76182990a5f2e75e0282cc4022546 (patch) | |
tree | 065709f6ae7b3e5c93db6043a43ef92d1059bb2b /base | |
parent | 669a674860fa52bb5ed97e056b3ecd60ea246e74 (diff) | |
download | chromium_src-f5661ca939b76182990a5f2e75e0282cc4022546.zip chromium_src-f5661ca939b76182990a5f2e75e0282cc4022546.tar.gz chromium_src-f5661ca939b76182990a5f2e75e0282cc4022546.tar.bz2 |
Base: A few more files using BASE_API (for base.dll)
BUG=76996
TEST=none
Review URL: http://codereview.chromium.org/6729002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79303 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/callback_internal.h | 3 | ||||
-rw-r--r-- | base/command_line.h | 3 | ||||
-rw-r--r-- | base/environment.h | 5 | ||||
-rw-r--r-- | base/hmac.h | 5 | ||||
-rw-r--r-- | base/json/json_reader.h | 3 | ||||
-rw-r--r-- | base/json/json_writer.h | 5 | ||||
-rw-r--r-- | base/json/string_escape.h | 19 | ||||
-rw-r--r-- | base/metrics/field_trial.h | 5 | ||||
-rw-r--r-- | base/process_util.h | 3 | ||||
-rw-r--r-- | base/rand_util.h | 11 | ||||
-rw-r--r-- | base/sha1.h | 10 | ||||
-rw-r--r-- | base/sha2.h | 9 | ||||
-rw-r--r-- | base/string_split.h | 61 | ||||
-rw-r--r-- | base/sys_string_conversions.h | 18 | ||||
-rw-r--r-- | base/task.h | 7 | ||||
-rw-r--r-- | base/task_queue.h | 3 | ||||
-rw-r--r-- | base/threading/platform_thread.h | 7 | ||||
-rw-r--r-- | base/threading/simple_thread.h | 12 | ||||
-rw-r--r-- | base/threading/thread_collision_warner.h | 11 | ||||
-rw-r--r-- | base/threading/thread_local_storage.h | 7 | ||||
-rw-r--r-- | base/threading/thread_restrictions.h | 9 | ||||
-rw-r--r-- | base/time.h | 7 | ||||
-rw-r--r-- | base/tracked.h | 7 | ||||
-rw-r--r-- | base/values.h | 17 | ||||
-rw-r--r-- | base/version.h | 3 |
25 files changed, 141 insertions, 109 deletions
diff --git a/base/callback_internal.h b/base/callback_internal.h index 6b8fdff2..5ff55a0 100644 --- a/base/callback_internal.h +++ b/base/callback_internal.h @@ -9,6 +9,7 @@ #define BASE_CALLBACK_INTERNAL_H_ #pragma once +#include "base/base_api.h" #include "base/ref_counted.h" namespace base { @@ -51,7 +52,7 @@ InvokerStorageHolder<T> MakeInvokerStorageHolder(T* o) { // Holds the Callback methods that don't require specialization to reduce // template bloat. -class CallbackBase { +class BASE_API CallbackBase { public: // Returns true if Callback is null (doesn't refer to anything). bool is_null() const; diff --git a/base/command_line.h b/base/command_line.h index 7ff5ab0..5af9742 100644 --- a/base/command_line.h +++ b/base/command_line.h @@ -19,12 +19,13 @@ #include <string> #include <vector> +#include "base/base_api.h" #include "base/basictypes.h" #include "build/build_config.h" class FilePath; -class CommandLine { +class BASE_API CommandLine { public: #if defined(OS_WIN) // The native command line string type. diff --git a/base/environment.h b/base/environment.h index 4c0691b..ebad820 100644 --- a/base/environment.h +++ b/base/environment.h @@ -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. @@ -8,6 +8,7 @@ #include <string> +#include "base/base_api.h" #include "base/basictypes.h" namespace base { @@ -20,7 +21,7 @@ extern const char kHome[]; } // namespace env_vars -class Environment { +class BASE_API Environment { public: virtual ~Environment(); diff --git a/base/hmac.h b/base/hmac.h index d467e1a..3b1a9fd 100644 --- a/base/hmac.h +++ b/base/hmac.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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. @@ -11,6 +11,7 @@ #include <string> +#include "base/base_api.h" #include "base/basictypes.h" #include "base/scoped_ptr.h" @@ -19,7 +20,7 @@ namespace base { // Simplify the interface and reduce includes by abstracting out the internals. struct HMACPlatformData; -class HMAC { +class BASE_API HMAC { public: // The set of supported hash functions. Extend as required. enum HashAlgorithm { diff --git a/base/json/json_reader.h b/base/json/json_reader.h index a6f0686..4f83492 100644 --- a/base/json/json_reader.h +++ b/base/json/json_reader.h @@ -34,6 +34,7 @@ #include <string> +#include "base/base_api.h" #include "base/basictypes.h" // Chromium and Chromium OS check out gtest to different places, so we're @@ -46,7 +47,7 @@ class Value; namespace base { -class JSONReader { +class BASE_API JSONReader { public: // A struct to hold a JS token. class Token { diff --git a/base/json/json_writer.h b/base/json/json_writer.h index eb17145..c019e87 100644 --- a/base/json/json_writer.h +++ b/base/json/json_writer.h @@ -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. @@ -8,13 +8,14 @@ #include <string> +#include "base/base_api.h" #include "base/basictypes.h" class Value; namespace base { -class JSONWriter { +class BASE_API JSONWriter { public: // Given a root node, generates a JSON string and puts it into |json|. // If |pretty_print| is true, return a slightly nicer formated json string diff --git a/base/json/string_escape.h b/base/json/string_escape.h index 2d7206b..e12e0bb 100644 --- a/base/json/string_escape.h +++ b/base/json/string_escape.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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. // @@ -10,6 +10,7 @@ #include <string> +#include "base/base_api.h" #include "base/string16.h" namespace base { @@ -19,19 +20,19 @@ namespace base { // If |put_in_quotes| is true, the result will be surrounded in double quotes. // The outputted literal, when interpreted by the browser, should result in a // javascript string that is identical and the same length as the input |str|. -void JsonDoubleQuote(const std::string& str, - bool put_in_quotes, - std::string* dst); +BASE_API void JsonDoubleQuote(const std::string& str, + bool put_in_quotes, + std::string* dst); // Same as above, but always returns the result double quoted. -std::string GetDoubleQuotedJson(const std::string& str); +BASE_API std::string GetDoubleQuotedJson(const std::string& str); -void JsonDoubleQuote(const string16& str, - bool put_in_quotes, - std::string* dst); +BASE_API void JsonDoubleQuote(const string16& str, + bool put_in_quotes, + std::string* dst); // Same as above, but always returns the result double quoted. -std::string GetDoubleQuotedJson(const string16& str); +BASE_API std::string GetDoubleQuotedJson(const string16& str); } // namespace base diff --git a/base/metrics/field_trial.h b/base/metrics/field_trial.h index 7db6e02..2ba31841 100644 --- a/base/metrics/field_trial.h +++ b/base/metrics/field_trial.h @@ -78,6 +78,7 @@ #include <map> #include <string> +#include "base/base_api.h" #include "base/gtest_prod_util.h" #include "base/ref_counted.h" #include "base/synchronization/lock.h" @@ -87,7 +88,7 @@ namespace base { class FieldTrialList; -class FieldTrial : public RefCounted<FieldTrial> { +class BASE_API FieldTrial : public RefCounted<FieldTrial> { public: typedef int Probability; // Probability type for being selected in a trial. @@ -210,7 +211,7 @@ class FieldTrial : public RefCounted<FieldTrial> { // Class with a list of all active field trials. A trial is active if it has // been registered, which includes evaluating its state based on its probaility. // Only one instance of this class exists. -class FieldTrialList { +class BASE_API FieldTrialList { public: // Define a separator charactor to use when creating a persistent form of an // instance. This is intended for use as a command line argument, passed to a diff --git a/base/process_util.h b/base/process_util.h index 29b08ca..725e04e 100644 --- a/base/process_util.h +++ b/base/process_util.h @@ -33,6 +33,7 @@ typedef struct _malloc_zone_t malloc_zone_t; #include <utility> #include <vector> +#include "base/base_api.h" #include "base/file_descriptor_shuffle.h" #include "base/file_path.h" #include "base/process.h" @@ -639,7 +640,7 @@ bool EnableLowFragmentationHeap(); // Enables 'terminate on heap corruption' flag. Helps protect against heap // overflow. Has no effect if the OS doesn't provide the necessary facility. -void EnableTerminationOnHeapCorruption(); +BASE_API void EnableTerminationOnHeapCorruption(); #if !defined(OS_WIN) // Turns on process termination if memory runs out. This is handled on Windows diff --git a/base/rand_util.h b/base/rand_util.h index 699fc7f..a4ea479 100644 --- a/base/rand_util.h +++ b/base/rand_util.h @@ -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. @@ -6,25 +6,26 @@ #define BASE_RAND_UTIL_H_ #pragma once +#include "base/base_api.h" #include "base/basictypes.h" namespace base { // Returns a random number in range [0, kuint64max]. Thread-safe. -uint64 RandUint64(); +BASE_API uint64 RandUint64(); // Returns a random number between min and max (inclusive). Thread-safe. -int RandInt(int min, int max); +BASE_API int RandInt(int min, int max); // Returns a random number in range [0, max). Thread-safe. // // Note that this can be used as an adapter for std::random_shuffle(): // Given a pre-populated |std::vector<int> myvector|, shuffle it as // std::random_shuffle(myvector.begin(), myvector.end(), base::RandGenerator); -uint64 RandGenerator(uint64 max); +BASE_API uint64 RandGenerator(uint64 max); // Returns a random double in range [0, 1). Thread-safe. -double RandDouble(); +BASE_API double RandDouble(); } // namespace base diff --git a/base/sha1.h b/base/sha1.h index 80540c1..7625189 100644 --- a/base/sha1.h +++ b/base/sha1.h @@ -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. @@ -8,6 +8,8 @@ #include <string> +#include "base/base_api.h" + namespace base { // This function performs SHA-1 operations. @@ -18,12 +20,12 @@ enum { // Computes the SHA-1 hash of the input string |str| and returns the full // hash. -std::string SHA1HashString(const std::string& str); +BASE_API std::string SHA1HashString(const std::string& str); // Computes the SHA-1 hash of the |len| bytes in |data| and puts the hash // in |hash|. |hash| must be SHA1_LENGTH bytes long. -void SHA1HashBytes(const unsigned char* data, size_t len, - unsigned char* hash); +BASE_API void SHA1HashBytes(const unsigned char* data, size_t len, + unsigned char* hash); } // namespace base diff --git a/base/sha2.h b/base/sha2.h index 19e41c3..b10b9f0 100644 --- a/base/sha2.h +++ b/base/sha2.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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. @@ -8,6 +8,8 @@ #include <string> +#include "base/base_api.h" + namespace base { // These functions perform SHA-256 operations. @@ -21,11 +23,12 @@ enum { // Computes the SHA-256 hash of the input string 'str' and stores the first // 'len' bytes of the hash in the output buffer 'output'. If 'len' > 32, // only 32 bytes (the full hash) are stored in the 'output' buffer. -void SHA256HashString(const std::string& str, void* output, size_t len); +BASE_API void SHA256HashString(const std::string& str, + void* output, size_t len); // Convenience version of the above that returns the result in a 32-byte // string. -std::string SHA256HashString(const std::string& str); +BASE_API std::string SHA256HashString(const std::string& str); } // namespace base diff --git a/base/string_split.h b/base/string_split.h index 9a9030a..f2e8c86 100644 --- a/base/string_split.h +++ b/base/string_split.h @@ -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. @@ -10,6 +10,7 @@ #include <utility> #include <vector> +#include "base/base_api.h" #include "base/string16.h" namespace base { @@ -22,52 +23,52 @@ namespace base { // Where wchar_t is char16 (i.e. Windows), |c| must be in BMP // (Basic Multilingual Plane). Elsewhere (Linux/Mac), wchar_t // should be a valid Unicode code point (32-bit). -void SplitString(const std::wstring& str, - wchar_t c, - std::vector<std::wstring>* r); +BASE_API void SplitString(const std::wstring& str, + wchar_t c, + std::vector<std::wstring>* r); // NOTE: |c| must be in BMP (Basic Multilingual Plane) -void SplitString(const string16& str, - char16 c, - std::vector<string16>* r); +BASE_API void SplitString(const string16& str, + char16 c, + std::vector<string16>* r); // |str| should not be in a multi-byte encoding like Shift-JIS or GBK in which // the trailing byte of a multi-byte character can be in the ASCII range. // UTF-8, and other single/multi-byte ASCII-compatible encodings are OK. // Note: |c| must be in the ASCII range. -void SplitString(const std::string& str, - char c, - std::vector<std::string>* r); +BASE_API void SplitString(const std::string& str, + char c, + std::vector<std::string>* r); -bool SplitStringIntoKeyValues( +BASE_API bool SplitStringIntoKeyValues( const std::string& line, char key_value_delimiter, std::string* key, std::vector<std::string>* values); -bool SplitStringIntoKeyValuePairs( +BASE_API bool SplitStringIntoKeyValuePairs( const std::string& line, char key_value_delimiter, char key_value_pair_delimiter, std::vector<std::pair<std::string, std::string> >* kv_pairs); // The same as SplitString, but use a substring delimiter instead of a char. -void SplitStringUsingSubstr(const string16& str, - const string16& s, - std::vector<string16>* r); -void SplitStringUsingSubstr(const std::string& str, - const std::string& s, - std::vector<std::string>* r); +BASE_API void SplitStringUsingSubstr(const string16& str, + const string16& s, + std::vector<string16>* r); +BASE_API void SplitStringUsingSubstr(const std::string& str, + const std::string& s, + std::vector<std::string>* r); // The same as SplitString, but don't trim white space. // NOTE: |c| must be in BMP (Basic Multilingual Plane) -void SplitStringDontTrim(const string16& str, - char16 c, - std::vector<string16>* r); +BASE_API void SplitStringDontTrim(const string16& str, + char16 c, + std::vector<string16>* r); // |str| should not be in a multi-byte encoding like Shift-JIS or GBK in which // the trailing byte of a multi-byte character can be in the ASCII range. // UTF-8, and other single/multi-byte ASCII-compatible encodings are OK. // Note: |c| must be in the ASCII range. -void SplitStringDontTrim(const std::string& str, - char c, - std::vector<std::string>* r); +BASE_API void SplitStringDontTrim(const std::string& str, + char c, + std::vector<std::string>* r); // WARNING: this uses whitespace as defined by the HTML5 spec. If you need // a function similar to this but want to trim all types of whitespace, then @@ -77,12 +78,12 @@ void SplitStringDontTrim(const std::string& str, // Splits the string along whitespace (where whitespace is the five space // characters defined by HTML 5). Each contiguous block of non-whitespace // characters is added to result. -void SplitStringAlongWhitespace(const std::wstring& str, - std::vector<std::wstring>* result); -void SplitStringAlongWhitespace(const string16& str, - std::vector<string16>* result); -void SplitStringAlongWhitespace(const std::string& str, - std::vector<std::string>* result); +BASE_API void SplitStringAlongWhitespace(const std::wstring& str, + std::vector<std::wstring>* result); +BASE_API void SplitStringAlongWhitespace(const string16& str, + std::vector<string16>* result); +BASE_API void SplitStringAlongWhitespace(const std::string& str, + std::vector<std::string>* result); } // namespace base diff --git a/base/sys_string_conversions.h b/base/sys_string_conversions.h index a96a687..4cf4b7a 100644 --- a/base/sys_string_conversions.h +++ b/base/sys_string_conversions.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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. @@ -11,6 +11,8 @@ // but it is used in some shared code. Dependencies should be minimal. #include <string> + +#include "base/base_api.h" #include "base/basictypes.h" #include "base/string16.h" @@ -29,14 +31,14 @@ class StringPiece; // Converts between wide and UTF-8 representations of a string. On error, the // result is system-dependent. -std::string SysWideToUTF8(const std::wstring& wide); -std::wstring SysUTF8ToWide(const StringPiece& utf8); +BASE_API std::string SysWideToUTF8(const std::wstring& wide); +BASE_API std::wstring SysUTF8ToWide(const StringPiece& utf8); // Converts between wide and the system multi-byte representations of a string. // DANGER: This will lose information and can change (on Windows, this can // change between reboots). -std::string SysWideToNativeMB(const std::wstring& wide); -std::wstring SysNativeMBToWide(const StringPiece& native_mb); +BASE_API std::string SysWideToNativeMB(const std::wstring& wide); +BASE_API std::wstring SysNativeMBToWide(const StringPiece& native_mb); // Windows-specific ------------------------------------------------------------ @@ -45,8 +47,10 @@ std::wstring SysNativeMBToWide(const StringPiece& native_mb); // Converts between 8-bit and wide strings, using the given code page. The // code page identifier is one accepted by the Windows function // MultiByteToWideChar(). -std::wstring SysMultiByteToWide(const StringPiece& mb, uint32 code_page); -std::string SysWideToMultiByte(const std::wstring& wide, uint32 code_page); +BASE_API std::wstring SysMultiByteToWide(const StringPiece& mb, + uint32 code_page); +BASE_API std::string SysWideToMultiByte(const std::wstring& wide, + uint32 code_page); #endif // defined(OS_WIN) diff --git a/base/task.h b/base/task.h index 2deee56..7fd5b52 100644 --- a/base/task.h +++ b/base/task.h @@ -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. @@ -6,6 +6,7 @@ #define BASE_TASK_H_ #pragma once +#include "base/base_api.h" #include "base/raw_scoped_refptr_mismatch_checker.h" #include "base/tracked.h" #include "base/tuple.h" @@ -16,7 +17,7 @@ // A task is a generic runnable thingy, usually used for running code on a // different thread or for scheduling future tasks off of the message loop. -class Task : public tracked_objects::Tracked { +class BASE_API Task : public tracked_objects::Tracked { public: Task(); virtual ~Task(); @@ -25,7 +26,7 @@ class Task : public tracked_objects::Tracked { virtual void Run() = 0; }; -class CancelableTask : public Task { +class BASE_API CancelableTask : public Task { public: CancelableTask(); virtual ~CancelableTask(); diff --git a/base/task_queue.h b/base/task_queue.h index 75b38b2..8bd3cb7 100644 --- a/base/task_queue.h +++ b/base/task_queue.h @@ -8,12 +8,13 @@ #include <deque> +#include "base/base_api.h" #include "base/task.h" // A TaskQueue is a queue of tasks waiting to be run. To run the tasks, call // the Run method. A task queue is itself a Task so that it can be placed in a // message loop or another task queue. -class TaskQueue : public Task { +class BASE_API TaskQueue : public Task { public: TaskQueue(); ~TaskQueue(); diff --git a/base/threading/platform_thread.h b/base/threading/platform_thread.h index 0a3c75d7..40d445f 100644 --- a/base/threading/platform_thread.h +++ b/base/threading/platform_thread.h @@ -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. @@ -10,6 +10,7 @@ #define BASE_THREADING_PLATFORM_THREAD_H_ #pragma once +#include "base/base_api.h" #include "base/basictypes.h" #include "build/build_config.h" @@ -47,11 +48,11 @@ typedef pid_t PlatformThreadId; const PlatformThreadId kInvalidThreadId = 0; // A namespace for low-level thread functions. -class PlatformThread { +class BASE_API PlatformThread { public: // Implement this interface to run code on a background thread. Your // ThreadMain method will be called on the newly created thread. - class Delegate { + class BASE_API Delegate { public: virtual ~Delegate() {} virtual void ThreadMain() = 0; diff --git a/base/threading/simple_thread.h b/base/threading/simple_thread.h index 1631336..f1b644b 100644 --- a/base/threading/simple_thread.h +++ b/base/threading/simple_thread.h @@ -45,6 +45,7 @@ #include <queue> #include <vector> +#include "base/base_api.h" #include "base/basictypes.h" #include "base/threading/platform_thread.h" #include "base/synchronization/lock.h" @@ -54,9 +55,9 @@ namespace base { // This is the base SimpleThread. You can derive from it and implement the // virtual Run method, or you can use the DelegateSimpleThread interface. -class SimpleThread : public PlatformThread::Delegate { +class BASE_API SimpleThread : public PlatformThread::Delegate { public: - class Options { + class BASE_API Options { public: Options() : stack_size_(0) { } ~Options() { } @@ -113,9 +114,9 @@ class SimpleThread : public PlatformThread::Delegate { bool joined_; // True if Join has been called. }; -class DelegateSimpleThread : public SimpleThread { +class BASE_API DelegateSimpleThread : public SimpleThread { public: - class Delegate { + class BASE_API Delegate { public: Delegate() { } virtual ~Delegate() { } @@ -143,7 +144,8 @@ class DelegateSimpleThread : public SimpleThread { // JoinAll() will make sure that all outstanding work is processed, and wait // for everything to finish. You can reuse a pool, so you can call Start() // again after you've called JoinAll(). -class DelegateSimpleThreadPool : public DelegateSimpleThread::Delegate { +class BASE_API DelegateSimpleThreadPool + : public DelegateSimpleThread::Delegate { public: typedef DelegateSimpleThread::Delegate Delegate; diff --git a/base/threading/thread_collision_warner.h b/base/threading/thread_collision_warner.h index 17ed5a4..38294a3 100644 --- a/base/threading/thread_collision_warner.h +++ b/base/threading/thread_collision_warner.h @@ -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. @@ -8,6 +8,7 @@ #include <memory> +#include "base/base_api.h" #include "base/atomicops.h" // A helper class alongside macros to be used to verify assumptions about thread @@ -140,7 +141,7 @@ struct DCheckAsserter : public AsserterBase { virtual void warn(); }; -class ThreadCollisionWarner { +class BASE_API ThreadCollisionWarner { public: // The parameter asserter is there only for test purpose ThreadCollisionWarner(AsserterBase* asserter = new DCheckAsserter()) @@ -157,7 +158,7 @@ class ThreadCollisionWarner { // it doesn't leave the critical section, as opposed to ScopedCheck, // because the critical section being pinned is allowed to be used only // from one thread - class Check { + class BASE_API Check { public: explicit Check(ThreadCollisionWarner* warner) : warner_(warner) { @@ -174,7 +175,7 @@ class ThreadCollisionWarner { // This class is meant to be used through the macro // DFAKE_SCOPED_LOCK - class ScopedCheck { + class BASE_API ScopedCheck { public: explicit ScopedCheck(ThreadCollisionWarner* warner) : warner_(warner) { @@ -193,7 +194,7 @@ class ThreadCollisionWarner { // This class is meant to be used through the macro // DFAKE_SCOPED_RECURSIVE_LOCK - class ScopedRecursiveCheck { + class BASE_API ScopedRecursiveCheck { public: explicit ScopedRecursiveCheck(ThreadCollisionWarner* warner) : warner_(warner) { diff --git a/base/threading/thread_local_storage.h b/base/threading/thread_local_storage.h index 204b6530..f882729 100644 --- a/base/threading/thread_local_storage.h +++ b/base/threading/thread_local_storage.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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. @@ -6,6 +6,7 @@ #define BASE_THREADING_THREAD_LOCAL_STORAGE_H_ #pragma once +#include "base/base_api.h" #include "base/basictypes.h" #if defined(OS_POSIX) @@ -16,7 +17,7 @@ namespace base { // Wrapper for thread local storage. This class doesn't do much except provide // an API for portability. -class ThreadLocalStorage { +class BASE_API ThreadLocalStorage { public: // Prototype for the TLS destructor function, which can be optionally used to @@ -25,7 +26,7 @@ class ThreadLocalStorage { typedef void (*TLSDestructorFunc)(void* value); // A key representing one value stored in TLS. - class Slot { + class BASE_API Slot { public: explicit Slot(TLSDestructorFunc destructor = NULL); diff --git a/base/threading/thread_restrictions.h b/base/threading/thread_restrictions.h index de8174f..98e0422 100644 --- a/base/threading/thread_restrictions.h +++ b/base/threading/thread_restrictions.h @@ -1,10 +1,11 @@ -// 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_THREADING_THREAD_RESTRICTIONS_H_ #define BASE_THREADING_THREAD_RESTRICTIONS_H_ +#include "base/base_api.h" #include "base/basictypes.h" namespace base { @@ -35,11 +36,11 @@ namespace base { // only calls other functions in Chrome and not fopen(), you should go // add the AssertIOAllowed checks in the helper functions. -class ThreadRestrictions { +class BASE_API ThreadRestrictions { public: // Constructing a ScopedAllowIO temporarily allows IO for the current // thread. Doing this is almost certainly always incorrect. - class ScopedAllowIO { + class BASE_API ScopedAllowIO { public: ScopedAllowIO() { previous_value_ = SetIOAllowed(true); } ~ScopedAllowIO() { SetIOAllowed(previous_value_); } @@ -52,7 +53,7 @@ class ThreadRestrictions { // Constructing a ScopedAllowSingleton temporarily allows accessing for the // current thread. Doing this is almost always incorrect. - class ScopedAllowSingleton { + class BASE_API ScopedAllowSingleton { public: ScopedAllowSingleton() { previous_value_ = SetSingletonAllowed(true); } ~ScopedAllowSingleton() { SetSingletonAllowed(previous_value_); } diff --git a/base/time.h b/base/time.h index ed4e772..a19a826 100644 --- a/base/time.h +++ b/base/time.h @@ -25,6 +25,7 @@ #include <time.h> +#include "base/base_api.h" #include "base/basictypes.h" #if defined(OS_POSIX) @@ -48,7 +49,7 @@ class PageLoadTrackerUnitTest; // TimeDelta ------------------------------------------------------------------ -class TimeDelta { +class BASE_API TimeDelta { public: TimeDelta() : delta_(0) { } @@ -178,7 +179,7 @@ inline TimeDelta operator*(int64 a, TimeDelta td) { // Time ----------------------------------------------------------------------- // Represents a wall clock time. -class Time { +class BASE_API Time { public: static const int64 kMillisecondsPerSecond = 1000; static const int64 kMicrosecondsPerMillisecond = 1000; @@ -449,7 +450,7 @@ inline Time TimeDelta::operator+(Time t) const { // TimeTicks ------------------------------------------------------------------ -class TimeTicks { +class BASE_API TimeTicks { public: TimeTicks() : ticks_(0) { } diff --git a/base/tracked.h b/base/tracked.h index b4f6e36..45776d1 100644 --- a/base/tracked.h +++ b/base/tracked.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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. @@ -21,6 +21,7 @@ #include <string> +#include "base/base_api.h" #include "base/time.h" #ifndef NDEBUG @@ -35,7 +36,7 @@ namespace tracked_objects { // Location provides basic info where of an object was constructed, or was // significantly brought to life. -class Location { +class BASE_API Location { public: // Constructor should be called with a long-lived char*, such as __FILE__. // It assumes the provided value will persist as a global constant, and it @@ -87,7 +88,7 @@ class Location { class Births; -class Tracked { +class BASE_API Tracked { public: Tracked(); virtual ~Tracked(); diff --git a/base/values.h b/base/values.h index b341517..e4949b1 100644 --- a/base/values.h +++ b/base/values.h @@ -27,6 +27,7 @@ #include <string> #include <vector> +#include "base/base_api.h" #include "base/basictypes.h" #include "base/string16.h" #include "build/build_config.h" @@ -44,7 +45,7 @@ typedef std::map<std::string, Value*> ValueMap; // The Value class is the base class for Values. A Value can be // instantiated via the Create*Value() factory methods, or by directly // creating instances of the subclasses. -class Value { +class BASE_API Value { public: enum ValueType { TYPE_NULL = 0, @@ -122,7 +123,7 @@ class Value { }; // FundamentalValue represents the simple fundamental types of values. -class FundamentalValue : public Value { +class BASE_API FundamentalValue : public Value { public: explicit FundamentalValue(bool in_value); explicit FundamentalValue(int in_value); @@ -146,7 +147,7 @@ class FundamentalValue : public Value { DISALLOW_COPY_AND_ASSIGN(FundamentalValue); }; -class StringValue : public Value { +class BASE_API StringValue : public Value { public: // Initializes a StringValue with a UTF-8 narrow character string. explicit StringValue(const std::string& in_value); @@ -168,7 +169,7 @@ class StringValue : public Value { DISALLOW_COPY_AND_ASSIGN(StringValue); }; -class BinaryValue: public Value { +class BASE_API BinaryValue: public Value { public: virtual ~BinaryValue(); @@ -205,7 +206,7 @@ class BinaryValue: public Value { // DictionaryValue provides a key-value dictionary with (optional) "path" // parsing for recursive access; see the comment at the top of the file. Keys // are |std::string|s and should be UTF-8 encoded. -class DictionaryValue : public Value { +class BASE_API DictionaryValue : public Value { public: DictionaryValue(); virtual ~DictionaryValue(); @@ -313,7 +314,7 @@ class DictionaryValue : public Value { // YOU SHOULD ALWAYS USE THE XXXWithoutPathExpansion() APIs WITH THESE, NOT // THE NORMAL XXX() APIs. This makes sure things will work correctly if any // keys have '.'s in them. - class key_iterator + class BASE_API key_iterator : private std::iterator<std::input_iterator_tag, const std::string> { public: explicit key_iterator(ValueMap::const_iterator itr) { itr_ = itr; } @@ -343,7 +344,7 @@ class DictionaryValue : public Value { }; // This type of Value represents a list of other Value values. -class ListValue : public Value { +class BASE_API ListValue : public Value { public: typedef ValueVector::iterator iterator; typedef ValueVector::const_iterator const_iterator; @@ -432,7 +433,7 @@ class ListValue : public Value { // This interface is implemented by classes that know how to serialize and // deserialize Value objects. -class ValueSerializer { +class BASE_API ValueSerializer { public: virtual ~ValueSerializer(); diff --git a/base/version.h b/base/version.h index 28ee227..d256d06 100644 --- a/base/version.h +++ b/base/version.h @@ -9,13 +9,14 @@ #include <string> #include <vector> +#include "base/base_api.h" #include "base/basictypes.h" #include "base/gtest_prod_util.h" // Version represents a dotted version number, like "1.2.3.4", supporting // parsing and comparison. // Each component is limited to a uint16. -class Version { +class BASE_API Version { public: // Exposed only so that a Version can be stored in STL containers; // any call to the methods below on a default-constructed Version |