summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-13 01:27:48 +0000
committerdpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-13 01:27:48 +0000
commit2f841580eb2158cd0e94b0872f2795a949e357e1 (patch)
treebfb8461b1fd169ab17e5fac3b87151e89407bfd4
parent200a1f1c1db2260a8737d83cf0f592ef8e4d866b (diff)
downloadchromium_src-2f841580eb2158cd0e94b0872f2795a949e357e1.zip
chromium_src-2f841580eb2158cd0e94b0872f2795a949e357e1.tar.gz
chromium_src-2f841580eb2158cd0e94b0872f2795a949e357e1.tar.bz2
Prepare appcache to build as a DLL in the component build.
This is needed to break the circular dependencies between appcache, chrome, and content (once we fix the messageloopproxy issue as seen in http://codereview.chromium.org/7841052/ ). R=michaeln@chromium.org, jam@chromium.org BUG=none TEST=none Review URL: http://codereview.chromium.org/7859021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100831 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/appcache/appcache_backend_impl.h3
-rw-r--r--webkit/appcache/appcache_export.h27
-rw-r--r--webkit/appcache/appcache_frontend_impl.h5
-rw-r--r--webkit/appcache/appcache_interceptor.h4
-rw-r--r--webkit/appcache/appcache_interfaces.h11
-rw-r--r--webkit/appcache/appcache_service.h5
-rw-r--r--webkit/appcache/view_appcache_internals_job.h3
-rw-r--r--webkit/appcache/web_application_cache_host_impl.h4
-rw-r--r--webkit/appcache/webkit_appcache.gypi10
9 files changed, 59 insertions, 13 deletions
diff --git a/webkit/appcache/appcache_backend_impl.h b/webkit/appcache/appcache_backend_impl.h
index 9a0e1ae..67e7e99 100644
--- a/webkit/appcache/appcache_backend_impl.h
+++ b/webkit/appcache/appcache_backend_impl.h
@@ -6,13 +6,14 @@
#define WEBKIT_APPCACHE_APPCACHE_BACKEND_IMPL_H_
#include "base/hash_tables.h"
+#include "webkit/appcache/appcache_export.h"
#include "webkit/appcache/appcache_host.h"
namespace appcache {
class AppCacheService;
-class AppCacheBackendImpl {
+class APPCACHE_EXPORT AppCacheBackendImpl {
public:
AppCacheBackendImpl();
~AppCacheBackendImpl();
diff --git a/webkit/appcache/appcache_export.h b/webkit/appcache/appcache_export.h
new file mode 100644
index 0000000..130816a
--- /dev/null
+++ b/webkit/appcache/appcache_export.h
@@ -0,0 +1,27 @@
+// 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 WEBKIT_APPCACHE_APPCACHE_EXPORT_H_
+#define WEBKIT_APPCACHE_APPCACHE_EXPORT_H_
+#pragma once
+
+// TODO(dpranke): Uncomment to enable appcache component build.
+#if 0 // defined(COMPONENT_BUILD)
+#if defined(WIN32)
+
+#if defined(APPCACHE_IMPLEMENTATION)
+#define APPCACHE_EXPORT __declspec(dllexport)
+#else
+#define APPCACHE_EXPORT __declspec(dllimport)
+#endif // defined(APPCACHE_IMPLEMENTATION)
+
+#else // defined(WIN32)
+#define APPCACHE_EXPORT __attribute__((visibility("default")))
+#endif
+
+#else // defined(COMPONENT_BUILD)
+#define APPCACHE_EXPORT
+#endif
+
+#endif // WEBKIT_APPCACHE_APPCACHE_EXPORT_H_
diff --git a/webkit/appcache/appcache_frontend_impl.h b/webkit/appcache/appcache_frontend_impl.h
index 159cbec..ce37d26 100644
--- a/webkit/appcache/appcache_frontend_impl.h
+++ b/webkit/appcache/appcache_frontend_impl.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.
@@ -7,11 +7,12 @@
#include <string>
#include <vector>
+#include "webkit/appcache/appcache_export.h"
#include "webkit/appcache/appcache_interfaces.h"
namespace appcache {
-class AppCacheFrontendImpl : public AppCacheFrontend {
+class APPCACHE_EXPORT AppCacheFrontendImpl : public AppCacheFrontend {
public:
virtual void OnCacheSelected(
int host_id, const appcache::AppCacheInfo& info);
diff --git a/webkit/appcache/appcache_interceptor.h b/webkit/appcache/appcache_interceptor.h
index 1ddd7d2..423fd65 100644
--- a/webkit/appcache/appcache_interceptor.h
+++ b/webkit/appcache/appcache_interceptor.h
@@ -8,6 +8,7 @@
#include "base/memory/singleton.h"
#include "googleurl/src/gurl.h"
#include "net/url_request/url_request.h"
+#include "webkit/appcache/appcache_export.h"
#include "webkit/glue/resource_type.h"
namespace appcache {
@@ -17,7 +18,8 @@ class AppCacheService;
// An interceptor to hijack requests and potentially service them out of
// the appcache.
-class AppCacheInterceptor : public net::URLRequest::Interceptor {
+class APPCACHE_EXPORT AppCacheInterceptor
+ : public net::URLRequest::Interceptor {
public:
// Registers a singleton instance with the net library.
// Should be called early in the IO thread prior to initiating requests.
diff --git a/webkit/appcache/appcache_interfaces.h b/webkit/appcache/appcache_interfaces.h
index d04a7da..70baf3a 100644
--- a/webkit/appcache/appcache_interfaces.h
+++ b/webkit/appcache/appcache_interfaces.h
@@ -11,6 +11,7 @@
#include "base/file_path.h"
#include "base/time.h"
#include "googleurl/src/gurl.h"
+#include "webkit/appcache/appcache_export.h"
namespace net {
class URLRequest;
@@ -54,7 +55,7 @@ enum LogLevel {
LOG_ERROR,
};
-struct AppCacheInfo {
+struct APPCACHE_EXPORT AppCacheInfo {
AppCacheInfo();
~AppCacheInfo();
@@ -71,7 +72,7 @@ struct AppCacheInfo {
typedef std::vector<AppCacheInfo> AppCacheInfoVector;
// Type to hold information about a single appcache resource.
-struct AppCacheResourceInfo {
+struct APPCACHE_EXPORT AppCacheResourceInfo {
AppCacheResourceInfo();
~AppCacheResourceInfo();
@@ -88,7 +89,7 @@ struct AppCacheResourceInfo {
typedef std::vector<AppCacheResourceInfo> AppCacheResourceInfoVector;
// Interface used by backend (browser-process) to talk to frontend (renderer).
-class AppCacheFrontend {
+class APPCACHE_EXPORT AppCacheFrontend {
public:
virtual void OnCacheSelected(
int host_id, const appcache::AppCacheInfo& info) = 0;
@@ -109,7 +110,7 @@ class AppCacheFrontend {
};
// Interface used by frontend (renderer) to talk to backend (browser-process).
-class AppCacheBackend {
+class APPCACHE_EXPORT AppCacheBackend {
public:
virtual void RegisterHost(int host_id) = 0;
virtual void UnregisterHost(int host_id) = 0;
@@ -149,7 +150,7 @@ bool IsSchemeSupported(const GURL& url);
bool IsMethodSupported(const std::string& method);
bool IsSchemeAndMethodSupported(const net::URLRequest* request);
-extern const FilePath::CharType kAppCacheDatabaseName[];
+APPCACHE_EXPORT extern const FilePath::CharType kAppCacheDatabaseName[];
} // namespace
diff --git a/webkit/appcache/appcache_service.h b/webkit/appcache/appcache_service.h
index 2b8cdd4..f8bc5b7 100644
--- a/webkit/appcache/appcache_service.h
+++ b/webkit/appcache/appcache_service.h
@@ -14,6 +14,7 @@
#include "net/base/completion_callback.h"
#include "net/base/net_errors.h"
#include "testing/gtest/include/gtest/gtest_prod.h"
+#include "webkit/appcache/appcache_export.h"
#include "webkit/appcache/appcache_interfaces.h"
#include "webkit/appcache/appcache_storage.h"
@@ -39,7 +40,7 @@ class AppCacheQuotaClient;
class AppCachePolicy;
// Refcounted container to avoid copying the collection in callbacks.
-struct AppCacheInfoCollection
+struct APPCACHE_EXPORT AppCacheInfoCollection
: public base::RefCountedThreadSafe<AppCacheInfoCollection> {
AppCacheInfoCollection();
virtual ~AppCacheInfoCollection();
@@ -50,7 +51,7 @@ struct AppCacheInfoCollection
// Class that manages the application cache service. Sends notifications
// to many frontends. One instance per user-profile. Each instance has
// exclusive access to it's cache_directory on disk.
-class AppCacheService {
+class APPCACHE_EXPORT AppCacheService {
public:
// If not using quota management, the proxy may be NULL.
explicit AppCacheService(quota::QuotaManagerProxy* quota_manager_proxy);
diff --git a/webkit/appcache/view_appcache_internals_job.h b/webkit/appcache/view_appcache_internals_job.h
index 2d45c51..762a703 100644
--- a/webkit/appcache/view_appcache_internals_job.h
+++ b/webkit/appcache/view_appcache_internals_job.h
@@ -6,6 +6,7 @@
#define WEBKIT_APPCACHE_VIEW_APPCACHE_INTERNALS_JOB_H_
#include "base/basictypes.h"
+#include "webkit/appcache/appcache_export.h"
namespace net {
class URLRequest;
@@ -16,7 +17,7 @@ namespace appcache {
class AppCacheService;
-class ViewAppCacheInternalsJobFactory {
+class APPCACHE_EXPORT ViewAppCacheInternalsJobFactory {
public:
static net::URLRequestJob* CreateJobForRequest(
net::URLRequest* request, AppCacheService* service);
diff --git a/webkit/appcache/web_application_cache_host_impl.h b/webkit/appcache/web_application_cache_host_impl.h
index 7b6789a..7595a5d 100644
--- a/webkit/appcache/web_application_cache_host_impl.h
+++ b/webkit/appcache/web_application_cache_host_impl.h
@@ -11,6 +11,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebApplicationCacheHostClient.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h"
+#include "webkit/appcache/appcache_export.h"
#include "webkit/appcache/appcache_interfaces.h"
namespace WebKit {
@@ -19,7 +20,8 @@ class WebFrame;
namespace appcache {
-class WebApplicationCacheHostImpl : public WebKit::WebApplicationCacheHost {
+class APPCACHE_EXPORT WebApplicationCacheHostImpl
+ : NON_EXPORTED_BASE(public WebKit::WebApplicationCacheHost) {
public:
// Returns the host having given id or NULL if there is no such host.
static WebApplicationCacheHostImpl* FromId(int id);
diff --git a/webkit/appcache/webkit_appcache.gypi b/webkit/appcache/webkit_appcache.gypi
index cfce447..6c46d1a 100644
--- a/webkit/appcache/webkit_appcache.gypi
+++ b/webkit/appcache/webkit_appcache.gypi
@@ -6,11 +6,20 @@
'targets': [
{
'target_name': 'appcache',
+ # TODO(dpranke): Uncomment '<(component)',
+ # 'type': '<(component)',
'type': 'static_library',
+ 'defines': [
+ 'APPCACHE_IMPLEMENTATION',
+ ],
'dependencies': [
+ 'quota',
+ '<(DEPTH)/base/base.gyp:base_i18n',
'<(DEPTH)/build/temp_gyp/googleurl.gyp:googleurl',
'<(DEPTH)/net/net.gyp:net',
'<(DEPTH)/sql/sql.gyp:sql',
+ '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
+ '<(DEPTH)/third_party/WebKit/Source/WebKit/chromium/WebKit.gyp:webkit',
],
'sources': [
# This list contains all .h and .cc in appcache except for test code.
@@ -23,6 +32,7 @@
'appcache_disk_cache.cc',
'appcache_disk_cache.h',
'appcache_entry.h',
+ 'appcache_export.h',
'appcache_frontend_impl.cc',
'appcache_frontend_impl.h',
'appcache_group.cc',