Skip to content

Commit

Permalink
Exclude content/plugin/ when plugins are disabled.
Browse files Browse the repository at this point in the history
- Also exclude plugin_data_remover_impl from the build.

BUG=162667


Review URL: https://chromiumcodereview.appspot.com/11475007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171747 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
nileshagrawal@chromium.org committed Dec 7, 2012
1 parent ef4fc80 commit c3cdc73
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 67 deletions.
2 changes: 2 additions & 0 deletions chrome/browser/browsing_data/browsing_data_remover.cc
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ void BrowsingDataRemover::RemoveImpl(int remove_mask,
base::Unretained(this)));
}

#if defined(ENABLE_PLUGINS)
// Plugin is data not separated for protected and unprotected web origins. We
// check the origin_set_mask_ to prevent unintended deletion.
if (remove_mask & REMOVE_PLUGIN_DATA &&
Expand All @@ -419,6 +420,7 @@ void BrowsingDataRemover::RemoveImpl(int remove_mask,
plugin_data_remover_->StartRemoving(delete_begin_);
watcher_.StartWatching(event, this);
}
#endif

if (remove_mask & REMOVE_PASSWORDS) {
content::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords"));
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/browsing_data/browsing_data_remover.h
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,11 @@ class BrowsingDataRemover : public content::NotificationObserver,
scoped_refptr<net::URLRequestContextGetter> main_context_getter_;
scoped_refptr<net::URLRequestContextGetter> media_context_getter_;

#if defined(ENABLE_PLUGINS)
// Used to delete plugin data.
scoped_ptr<content::PluginDataRemover> plugin_data_remover_;
base::WaitableEventWatcher watcher_;

#if defined(ENABLE_PLUGINS)
// Used to deauthorize content licenses for Pepper Flash.
scoped_ptr<PepperFlashSettingsManager> pepper_flash_settings_manager_;
#endif
Expand Down
15 changes: 1 addition & 14 deletions content/browser/plugin_data_remover_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/pepper_plugin_info.h"
#include "ppapi/proxy/ppapi_messages.h"
#include "webkit/plugins/npapi/plugin_utils.h"
#include "webkit/plugins/plugin_constants.h"

#if defined(ENABLE_PLUGINS)
#include "ppapi/proxy/ppapi_messages.h"
#endif

namespace content {

namespace {
Expand Down Expand Up @@ -181,10 +178,8 @@ class PluginDataRemoverImpl::Context
IPC_BEGIN_MESSAGE_MAP(Context, message)
IPC_MESSAGE_HANDLER(PluginHostMsg_ClearSiteDataResult,
OnClearSiteDataResult)
#if defined(ENABLE_PLUGINS)
IPC_MESSAGE_HANDLER(PpapiHostMsg_ClearSiteDataResult,
OnPpapiClearSiteDataResult)
#endif
IPC_MESSAGE_UNHANDLED_ERROR()
IPC_END_MESSAGE_MAP()

Expand All @@ -205,7 +200,6 @@ class PluginDataRemoverImpl::Context
friend class base::DeleteHelper<Context>;
virtual ~Context() {}

#if defined(ENABLE_PLUGINS)
IPC::Message* CreatePpapiClearSiteDataMsg(uint64 max_age) {
FilePath profile_path =
PepperFileMessageFilter::GetDataDirName(browser_context_path_);
Expand All @@ -222,13 +216,6 @@ class PluginDataRemoverImpl::Context
return new PpapiMsg_ClearSiteData(0u, plugin_data_path, std::string(),
kClearAllData, max_age);
}
#else
IPC::Message* CreatePpapiClearSiteDataMsg(uint64 max_age) {
NOTREACHED() << "CreatePpapiClearSiteDataMsg called with "
<< "ENABLE_PLUGINS undefined.";
return NULL;
}
#endif // defined(ENABLE_PLUGINS)

// Connects the client side of a newly opened plug-in channel.
void ConnectToChannel(const IPC::ChannelHandle& handle, bool is_ppapi) {
Expand Down
2 changes: 2 additions & 0 deletions content/content_browser.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,8 @@
],
}, { # enable_plugins==0
'sources!': [
'browser/plugin_data_remover_impl.cc',
'browser/plugin_data_remover_impl.h',
'browser/ppapi_plugin_process_host.cc',
],
'sources/': [
Expand Down
108 changes: 56 additions & 52 deletions content/content_plugin.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,67 @@
# found in the LICENSE file.

{
'dependencies': [
'../skia/skia.gyp:skia',
'../third_party/npapi/npapi.gyp:npapi',
'../webkit/support/webkit_support.gyp:glue',
],
'include_dirs': [
'<(INTERMEDIATE_DIR)',
],
'sources': [
# All .cc, .h, .m, and .mm files under plugins except for tests and
# mocks.
'plugin/plugin_channel.cc',
'plugin/plugin_channel.h',
'plugin/plugin_interpose_util_mac.mm',
'plugin/plugin_interpose_util_mac.h',
'plugin/plugin_main.cc',
'plugin/plugin_main_linux.cc',
'plugin/plugin_main_mac.mm',
'plugin/plugin_thread.cc',
'plugin/plugin_thread.h',
'plugin/webplugin_accelerated_surface_proxy_mac.cc',
'plugin/webplugin_accelerated_surface_proxy_mac.h',
'plugin/webplugin_delegate_stub.cc',
'plugin/webplugin_delegate_stub.h',
'plugin/webplugin_proxy.cc',
'plugin/webplugin_proxy.h',
'public/plugin/content_plugin_client.h',
],
# These are layered in conditionals in the event other platforms
# end up using this module as well.
'conditions': [
['os_bsd==1', {
'sources/': [
['exclude', '^plugin/plugin_main_linux\\.cc$'],
['enable_plugins==1', {
'dependencies': [
'../skia/skia.gyp:skia',
'../third_party/npapi/npapi.gyp:npapi',
'../webkit/support/webkit_support.gyp:glue',
],
}],
['OS=="win"', {
'include_dirs': [
'<(DEPTH)/third_party/wtl/include',
'<(INTERMEDIATE_DIR)',
],
}],
['toolkit_uses_gtk == 1', {
'dependencies': [
'../build/linux/system.gyp:gtk',
'sources': [
# All .cc, .h, .m, and .mm files under plugins except for tests and
# mocks.
'plugin/plugin_channel.cc',
'plugin/plugin_channel.h',
'plugin/plugin_interpose_util_mac.mm',
'plugin/plugin_interpose_util_mac.h',
'plugin/plugin_main.cc',
'plugin/plugin_main_linux.cc',
'plugin/plugin_main_mac.mm',
'plugin/plugin_thread.cc',
'plugin/plugin_thread.h',
'plugin/webplugin_accelerated_surface_proxy_mac.cc',
'plugin/webplugin_accelerated_surface_proxy_mac.h',
'plugin/webplugin_delegate_stub.cc',
'plugin/webplugin_delegate_stub.h',
'plugin/webplugin_proxy.cc',
'plugin/webplugin_proxy.h',
'public/plugin/content_plugin_client.h',
],
# These are layered in conditionals in the event other platforms
# end up using this module as well.
'conditions': [
['os_bsd==1', {
'sources/': [
['exclude', '^plugin/plugin_main_linux\\.cc$'],
],
}],
['OS=="win"', {
'include_dirs': [
'<(DEPTH)/third_party/wtl/include',
],
}],
['toolkit_uses_gtk == 1', {
'dependencies': [
'../build/linux/system.gyp:gtk',
],
'link_settings': {
'libraries': [
'-lXext',
],
},
}],
['use_aura==1 and OS!="win"', {
'link_settings': {
'libraries': [
'-lXext',
],
},
}],
],
'link_settings': {
'libraries': [
'-lXext',
],
},
}],
['use_aura==1 and OS!="win"', {
'link_settings': {
'libraries': [
'-lXext',
],
},
}],
],
}

0 comments on commit c3cdc73

Please sign in to comment.