diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-14 22:03:13 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-14 22:03:13 +0000 |
commit | 1889dc1b1226cac60273a2e28ad36e019292be21 (patch) | |
tree | 0cc002bbc9b22ef7a2b34a7f114b79463a02c8d7 /webkit | |
parent | 19d9f3aa28eb43ba6c7e016536c2ddcba420bb3f (diff) | |
download | chromium_src-1889dc1b1226cac60273a2e28ad36e019292be21.zip chromium_src-1889dc1b1226cac60273a2e28ad36e019292be21.tar.gz chromium_src-1889dc1b1226cac60273a2e28ad36e019292be21.tar.bz2 |
FBTF: More ctor/dtor cleanup.
(3.5 megs off debug linux .a files)
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/3806005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62654 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/database/databases_table.cc | 4 | ||||
-rw-r--r-- | webkit/database/databases_table.h | 3 | ||||
-rw-r--r-- | webkit/fileapi/file_system_quota.cc | 4 | ||||
-rw-r--r-- | webkit/fileapi/file_system_quota.h | 4 | ||||
-rw-r--r-- | webkit/glue/plugins/plugin_group_unittest.cc | 40 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugininfo.cc | 44 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugininfo.h | 13 | ||||
-rw-r--r-- | webkit/glue/webkit_glue.gypi | 1 |
8 files changed, 88 insertions, 25 deletions
diff --git a/webkit/database/databases_table.cc b/webkit/database/databases_table.cc index 0afede3..fd174ce 100644 --- a/webkit/database/databases_table.cc +++ b/webkit/database/databases_table.cc @@ -10,6 +10,10 @@ namespace webkit_database { +DatabaseDetails::DatabaseDetails() : estimated_size(0) { } + +DatabaseDetails::~DatabaseDetails() {} + bool DatabasesTable::Init() { // 'Databases' schema: // id A unique ID assigned to each database diff --git a/webkit/database/databases_table.h b/webkit/database/databases_table.h index 4443c76..4caab805 100644 --- a/webkit/database/databases_table.h +++ b/webkit/database/databases_table.h @@ -16,7 +16,8 @@ class Connection; namespace webkit_database { struct DatabaseDetails { - DatabaseDetails() : estimated_size(0) { } + DatabaseDetails(); + ~DatabaseDetails(); string16 origin_identifier; string16 database_name; diff --git a/webkit/fileapi/file_system_quota.cc b/webkit/fileapi/file_system_quota.cc index eb69beb..7133082 100644 --- a/webkit/fileapi/file_system_quota.cc +++ b/webkit/fileapi/file_system_quota.cc @@ -13,6 +13,10 @@ namespace fileapi { const int64 FileSystemQuota::kUnknownSize = -1; +FileSystemQuota::FileSystemQuota() {} + +FileSystemQuota::~FileSystemQuota() {} + bool FileSystemQuota::CheckOriginQuota(const GURL& origin, int64) { return CheckIfOriginGrantedUnlimitedQuota(origin); } diff --git a/webkit/fileapi/file_system_quota.h b/webkit/fileapi/file_system_quota.h index 80888ed1..9b77c9b 100644 --- a/webkit/fileapi/file_system_quota.h +++ b/webkit/fileapi/file_system_quota.h @@ -16,9 +16,11 @@ namespace fileapi { // and just allows unlimited quota for apps. class FileSystemQuota { public: - FileSystemQuota() { } static const int64 kUnknownSize; + FileSystemQuota(); + ~FileSystemQuota(); + // Checks if the origin can grow its usage by |growth| bytes. // This only performs in-memory check and returns immediately. // For now it just returns false for any origins (regardless of the size) diff --git a/webkit/glue/plugins/plugin_group_unittest.cc b/webkit/glue/plugins/plugin_group_unittest.cc index a523c73..467c273 100644 --- a/webkit/glue/plugins/plugin_group_unittest.cc +++ b/webkit/glue/plugins/plugin_group_unittest.cc @@ -25,26 +25,21 @@ static const PluginGroupDefinition kPluginDefNotVulnerable = { "myplugin-latest", "MyPlugin", "MyPlugin", "", "", "", "http://latest" }; // name, path, version, desc, mime_types, enabled. -static WebPluginInfo kPlugin2043 = { - ASCIIToUTF16("MyPlugin"), FilePath(), ASCIIToUTF16("2.0.43"), - ASCIIToUTF16("MyPlugin version 2.0.43"), - std::vector<WebPluginMimeType>(), true }; -static WebPluginInfo kPlugin3043 = { - ASCIIToUTF16("MyPlugin"), FilePath(), ASCIIToUTF16("3.0.43"), - ASCIIToUTF16("MyPlugin version 3.0.43"), - std::vector<WebPluginMimeType>(), true }; -static WebPluginInfo kPlugin3044 = { - ASCIIToUTF16("MyPlugin"), FilePath(), ASCIIToUTF16("3.0.44"), - ASCIIToUTF16("MyPlugin version 3.0.44"), - std::vector<WebPluginMimeType>(), true }; -static WebPluginInfo kPlugin3045 = { - ASCIIToUTF16("MyPlugin"), FilePath(), ASCIIToUTF16("3.0.45"), - ASCIIToUTF16("MyPlugin version 3.0.45"), - std::vector<WebPluginMimeType>(), true }; -static WebPluginInfo kPlugin4043 = { - ASCIIToUTF16("MyPlugin"), FilePath(), ASCIIToUTF16("4.0.43"), - ASCIIToUTF16("MyPlugin version 4.0.43"), - std::vector<WebPluginMimeType>(), true }; +static WebPluginInfo kPlugin2043 = WebPluginInfo( + ASCIIToUTF16("MyPlugin"), ASCIIToUTF16("2.0.43"), + ASCIIToUTF16("MyPlugin version 2.0.43")); +static WebPluginInfo kPlugin3043 = WebPluginInfo( + ASCIIToUTF16("MyPlugin"), ASCIIToUTF16("3.0.43"), + ASCIIToUTF16("MyPlugin version 3.0.43")); +static WebPluginInfo kPlugin3044 = WebPluginInfo( + ASCIIToUTF16("MyPlugin"), ASCIIToUTF16("3.0.44"), + ASCIIToUTF16("MyPlugin version 3.0.44")); +static WebPluginInfo kPlugin3045 = WebPluginInfo( + ASCIIToUTF16("MyPlugin"), ASCIIToUTF16("3.0.45"), + ASCIIToUTF16("MyPlugin version 3.0.45")); +static WebPluginInfo kPlugin4043 = WebPluginInfo( + ASCIIToUTF16("MyPlugin"), ASCIIToUTF16("4.0.43"), + ASCIIToUTF16("MyPlugin version 4.0.43")); class PluginGroupTest : public testing::Test { protected: @@ -160,9 +155,8 @@ TEST(PluginGroupTest, VersionExtraction) { }; for (size_t i = 0; i < arraysize(versions); i++) { - const WebPluginInfo plugin = { - ASCIIToUTF16("Blah Plugin"), FilePath(), ASCIIToUTF16(versions[i][0]), - string16(),std::vector<WebPluginMimeType>(), true }; + const WebPluginInfo plugin = WebPluginInfo( + ASCIIToUTF16("Blah Plugin"), ASCIIToUTF16(versions[i][0]), string16()); scoped_ptr<PluginGroup> group(PluginGroup::FromWebPluginInfo(plugin)); EXPECT_TRUE(group->Match(plugin)); group->AddPlugin(plugin, 0); diff --git a/webkit/glue/plugins/webplugininfo.cc b/webkit/glue/plugins/webplugininfo.cc new file mode 100644 index 0000000..7d2b4e4 --- /dev/null +++ b/webkit/glue/plugins/webplugininfo.cc @@ -0,0 +1,44 @@ +// Copyright (c) 2010 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. + +#include "webkit/glue/plugins/webplugininfo.h" + +WebPluginMimeType::WebPluginMimeType() {} + +WebPluginMimeType::~WebPluginMimeType() {} + +WebPluginInfo::WebPluginInfo() : enabled(false) {} + +WebPluginInfo::WebPluginInfo(const WebPluginInfo& rhs) + : name(rhs.name), + path(rhs.path), + version(rhs.version), + desc(rhs.desc), + mime_types(rhs.mime_types), + enabled(rhs.enabled) { +} + +WebPluginInfo::~WebPluginInfo() {} + +WebPluginInfo& WebPluginInfo::operator=(const WebPluginInfo& rhs) { + name = rhs.name; + path = rhs.path; + version = rhs.version; + desc = rhs.desc; + mime_types = rhs.mime_types; + enabled = rhs.enabled; + return *this; +} + +WebPluginInfo::WebPluginInfo(const string16& fake_name, + const string16& fake_version, + const string16& fake_desc) + : name(fake_name), + path(), + version(fake_version), + desc(fake_desc), + mime_types(), + enabled(true) { +} + diff --git a/webkit/glue/plugins/webplugininfo.h b/webkit/glue/plugins/webplugininfo.h index 9d2ab6e..34eff3d 100644 --- a/webkit/glue/plugins/webplugininfo.h +++ b/webkit/glue/plugins/webplugininfo.h @@ -13,6 +13,9 @@ // Describes a mime type entry for a plugin. struct WebPluginMimeType { + WebPluginMimeType(); + ~WebPluginMimeType(); + // The name of the mime type (e.g., "application/x-shockwave-flash"). std::string mime_type; @@ -25,6 +28,16 @@ struct WebPluginMimeType { // Describes an available NPAPI plugin. struct WebPluginInfo { + WebPluginInfo(); + WebPluginInfo(const WebPluginInfo& rhs); + ~WebPluginInfo(); + WebPluginInfo& operator=(const WebPluginInfo& rhs); + + // Special constructor only used during unit testing: + WebPluginInfo(const string16& fake_name, + const string16& fake_version, + const string16& fake_desc); + // The name of the plugin (i.e. Flash). string16 name; diff --git a/webkit/glue/webkit_glue.gypi b/webkit/glue/webkit_glue.gypi index 48f48d3..e8e1a3e 100644 --- a/webkit/glue/webkit_glue.gypi +++ b/webkit/glue/webkit_glue.gypi @@ -300,6 +300,7 @@ 'plugins/webplugin_delegate_impl_win.cc', 'plugins/webplugin_impl.cc', 'plugins/webplugin_impl.h', + 'plugins/webplugininfo.cc', 'plugins/webplugininfo.h', 'alt_error_page_resource_fetcher.cc', 'alt_error_page_resource_fetcher.h', |