diff options
author | caitkp@chromium.org <caitkp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-11 20:24:20 +0000 |
---|---|---|
committer | caitkp@chromium.org <caitkp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-11 20:24:20 +0000 |
commit | 84efa823aece2b561dbd2764e06aa7ea618f1b81 (patch) | |
tree | c871e96334127002675866f17b5ef9cfa478af56 | |
parent | e6868d84710b95d85626d909598a5ba66fd51e08 (diff) | |
download | chromium_src-84efa823aece2b561dbd2764e06aa7ea618f1b81.zip chromium_src-84efa823aece2b561dbd2764e06aa7ea618f1b81.tar.gz chromium_src-84efa823aece2b561dbd2764e06aa7ea618f1b81.tar.bz2 |
Build WebData as shared-lib component.
TBR=ben@chromium.org (chrome_browser.gypi change)
BUG=181277
Review URL: https://chromiumcodereview.appspot.com/14101004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193727 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/chrome_browser.gypi | 18 | ||||
-rw-r--r-- | components/autofill.gypi | 6 | ||||
-rw-r--r-- | components/webdata.gypi | 32 | ||||
-rw-r--r-- | components/webdata/common/web_data_results.h | 3 | ||||
-rw-r--r-- | components/webdata/common/web_data_service_base.h | 6 | ||||
-rw-r--r-- | components/webdata/common/web_database.h | 3 | ||||
-rw-r--r-- | components/webdata/common/web_database_service.h | 6 | ||||
-rw-r--r-- | components/webdata/common/web_database_table.h | 3 | ||||
-rw-r--r-- | components/webdata/common/webdata_constants.h | 3 | ||||
-rw-r--r-- | components/webdata/common/webdata_export.h | 29 |
10 files changed, 84 insertions, 25 deletions
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 281cda6..140fec2 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -31,6 +31,7 @@ '../components/components.gyp:user_prefs', '../components/components.gyp:visitedlink_browser', '../components/components.gyp:visitedlink_common', + '../components/components.gyp:webdata_common', '../content/content.gyp:content_browser', '../content/content.gyp:content_common', '../crypto/crypto.gyp:crypto', @@ -2126,23 +2127,6 @@ 'test/perf/perf_test.cc', 'test/perf/perf_test.h', - # TODO(joi): Move to //components/components.gypi once - # remaining dependencies back to //chrome are eliminated. - '../components/webdata/common/web_database.cc', - '../components/webdata/common/web_database.h', - '../components/webdata/common/web_database_service.cc', - '../components/webdata/common/web_database_service.h', - '../components/webdata/common/web_database_table.cc', - '../components/webdata/common/web_database_table.h', - '../components/webdata/common/web_data_request_manager.cc', - '../components/webdata/common/web_data_request_manager.h', - '../components/webdata/common/web_data_results.h', - '../components/webdata/common/web_data_service_base.cc', - '../components/webdata/common/web_data_service_base.h', - '../components/webdata/common/web_data_service_consumer.h', - '../components/webdata/common/webdata_constants.cc', - '../components/webdata/common/webdata_constants.h', - # These files are generated by GRIT. '<(grit_out_dir)/grit/component_extension_resources_map.cc', '<(grit_out_dir)/grit/devtools_discovery_page_resources_map.cc', diff --git a/components/autofill.gypi b/components/autofill.gypi index 50a1d3f..00f31c0 100644 --- a/components/autofill.gypi +++ b/components/autofill.gypi @@ -104,12 +104,16 @@ 'autofill_common', 'autofill_regexes', 'autofill_risk_proto', + 'encryptor', + 'webdata_common', '../base/base.gyp:base', + '../base/base.gyp:base_i18n', '../build/temp_gyp/googleurl.gyp:googleurl', '../content/content.gyp:content_browser', '../content/content.gyp:content_common', '../ipc/ipc.gyp:ipc', '../skia/skia.gyp:skia', + '../sql/sql.gyp:sql', '../third_party/icu/icu.gyp:icui18n', '../third_party/icu/icu.gyp:icuuc', '../third_party/libjingle/libjingle.gyp:libjingle', @@ -120,8 +124,6 @@ # For grip/generated_resources.h and grit/chromium_strings.h # TODO(kaiwang): Remove this dependency on chrome. '../chrome/chrome_resources.gyp:chrome_strings', - - # TODO(kaiwang): Add webdata after it's fully componentized. ], 'sources': [ 'autofill/browser/address.cc', diff --git a/components/webdata.gypi b/components/webdata.gypi index 321438d..ef99c61 100644 --- a/components/webdata.gypi +++ b/components/webdata.gypi @@ -30,5 +30,37 @@ }], ], }, + { + 'target_name': 'webdata_common', + 'type': '<(component)', + 'include_dirs': [ + '..', + ], + 'dependencies': [ + '../base/base.gyp:base', + '../content/content.gyp:content_browser', + '../sql/sql.gyp:sql', + ], + 'defines': [ + 'WEBDATA_IMPLEMENTATION', + ], + 'sources': [ + 'webdata/common/web_database.cc', + 'webdata/common/web_database.h', + 'webdata/common/web_database_service.cc', + 'webdata/common/web_database_service.h', + 'webdata/common/web_database_table.cc', + 'webdata/common/web_database_table.h', + 'webdata/common/web_data_request_manager.cc', + 'webdata/common/web_data_request_manager.h', + 'webdata/common/web_data_results.h', + 'webdata/common/web_data_service_base.cc', + 'webdata/common/web_data_service_base.h', + 'webdata/common/web_data_service_consumer.h', + 'webdata/common/webdata_constants.cc', + 'webdata/common/webdata_constants.h', + 'webdata/common/webdata_export.h' + ], + }, ], } diff --git a/components/webdata/common/web_data_results.h b/components/webdata/common/web_data_results.h index 9b27a3e..7a225e9 100644 --- a/components/webdata/common/web_data_results.h +++ b/components/webdata/common/web_data_results.h @@ -7,6 +7,7 @@ #include "base/basictypes.h" #include "base/callback.h" +#include "components/webdata/common/webdata_export.h" class WDTypedResult; @@ -38,7 +39,7 @@ typedef base::Callback<void(const WDTypedResult*)> DestroyCallback; // // The top level class for a result. // -class WDTypedResult { +class WEBDATA_EXPORT WDTypedResult { public: virtual ~WDTypedResult() { } diff --git a/components/webdata/common/web_data_service_base.h b/components/webdata/common/web_data_service_base.h index f46fc91..dec0a0d 100644 --- a/components/webdata/common/web_data_service_base.h +++ b/components/webdata/common/web_data_service_base.h @@ -10,6 +10,7 @@ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/supports_user_data.h" +#include "components/webdata/common/webdata_export.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_source.h" #include "sql/init_status.h" @@ -23,7 +24,7 @@ class Thread; } // Base for WebDataService class hierarchy. -class WebDataServiceBase +class WEBDATA_EXPORT WebDataServiceBase : public base::RefCountedThreadSafe<WebDataServiceBase, content::BrowserThread::DeleteOnUIThread> { public: @@ -99,6 +100,9 @@ class WebDataServiceBase friend struct content::BrowserThread::DeleteOnThread< content::BrowserThread::UI>; friend class base::DeleteHelper<WebDataServiceBase>; + // We have to friend RCTS<> so WIN shared-lib build is happy (crbug/112250). + friend class base::RefCountedThreadSafe<WebDataServiceBase, + content::BrowserThread::DeleteOnUIThread>; ProfileErrorCallback profile_error_callback_; diff --git a/components/webdata/common/web_database.h b/components/webdata/common/web_database.h index 298f0fa..62aff94 100644 --- a/components/webdata/common/web_database.h +++ b/components/webdata/common/web_database.h @@ -9,6 +9,7 @@ #include "base/memory/scoped_ptr.h" #include "components/webdata/common/web_database_table.h" +#include "components/webdata/common/webdata_export.h" #include "sql/connection.h" #include "sql/init_status.h" #include "sql/meta_table.h" @@ -22,7 +23,7 @@ class NotificationService; } // This class manages a SQLite database that stores various web page meta data. -class WebDatabase { +class WEBDATA_EXPORT WebDatabase { public: enum State { COMMIT_NOT_NEEDED, diff --git a/components/webdata/common/web_database_service.h b/components/webdata/common/web_database_service.h index 047dd8b..624660d 100644 --- a/components/webdata/common/web_database_service.h +++ b/components/webdata/common/web_database_service.h @@ -17,6 +17,7 @@ #include "base/memory/scoped_ptr.h" #include "components/webdata/common/web_data_service_base.h" #include "components/webdata/common/web_database.h" +#include "components/webdata/common/webdata_export.h" class WebDataServiceBackend; class WebDataRequestManager; @@ -41,7 +42,7 @@ class WebDataServiceConsumer; // //////////////////////////////////////////////////////////////////////////////// -class WebDatabaseService +class WEBDATA_EXPORT WebDatabaseService : public base::RefCountedThreadSafe< WebDatabaseService, content::BrowserThread::DeleteOnUIThread> { @@ -93,6 +94,9 @@ class WebDatabaseService friend struct content::BrowserThread::DeleteOnThread< content::BrowserThread::UI>; friend class base::DeleteHelper<WebDatabaseService>; + // We have to friend RCTS<> so WIN shared-lib build is happy (crbug/112250). + friend class base::RefCountedThreadSafe<WebDatabaseService, + content::BrowserThread::DeleteOnUIThread>; virtual ~WebDatabaseService(); diff --git a/components/webdata/common/web_database_table.h b/components/webdata/common/web_database_table.h index 25ebf7d..b920ff6 100644 --- a/components/webdata/common/web_database_table.h +++ b/components/webdata/common/web_database_table.h @@ -6,6 +6,7 @@ #define COMPONENTS_WEBDATA_COMMON_WEB_DATABASE_TABLE_H_ #include "base/logging.h" +#include "components/webdata/common/webdata_export.h" namespace sql { class Connection; @@ -14,7 +15,7 @@ class MetaTable; // An abstract base class representing a table within a WebDatabase. // Each table should subclass this, adding type-specific methods as needed. -class WebDatabaseTable { +class WEBDATA_EXPORT WebDatabaseTable { public: // To look up a WebDatabaseTable of a certain type from WebDatabase, // we use a void* key, so that we can simply use the address of one diff --git a/components/webdata/common/webdata_constants.h b/components/webdata/common/webdata_constants.h index 3a5d26e..0aeb1f7 100644 --- a/components/webdata/common/webdata_constants.h +++ b/components/webdata/common/webdata_constants.h @@ -6,7 +6,8 @@ #define COMPONENTS_WEBDATA_COMMON_WEBDATA_CONSTANTS_H_ #include "base/files/file_path.h" +#include "components/webdata/common/webdata_export.h" -extern const base::FilePath::CharType kWebDataFilename[]; +WEBDATA_EXPORT extern const base::FilePath::CharType kWebDataFilename[]; #endif // COMPONENTS_WEBDATA_COMMON_WEBDATA_CONSTANTS_H_ diff --git a/components/webdata/common/webdata_export.h b/components/webdata/common/webdata_export.h new file mode 100644 index 0000000..9441f19 --- /dev/null +++ b/components/webdata/common/webdata_export.h @@ -0,0 +1,29 @@ +// Copyright (c) 2013 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 COMPONENTS_WEBDATA_COMMON_WEBDATA_EXPORT_H_ +#define COMPONENTS_WEBDATA_COMMON_WEBDATA_EXPORT_H_ + +#if defined(COMPONENT_BUILD) +#if defined(WIN32) + +#if defined(WEBDATA_IMPLEMENTATION) +#define WEBDATA_EXPORT __declspec(dllexport) +#else +#define WEBDATA_EXPORT __declspec(dllimport) +#endif // defined(WEBDATA_IMPLEMENTATION) + +#else // defined(WIN32) +#if defined(WEBDATA_IMPLEMENTATION) +#define WEBDATA_EXPORT __attribute__((visibility("default"))) +#else +#define WEBDATA_EXPORT +#endif +#endif + +#else // defined(COMPONENT_BUILD) +#define WEBDATA_EXPORT +#endif + +#endif // COMPONENTS_WEBDATA_COMMON_WEBDATA_EXPORT_H_ |