diff options
54 files changed, 54 insertions, 594 deletions
diff --git a/base/bind_unittest.cc b/base/bind_unittest.cc index 9a6e23f..0f91b2e 100644 --- a/base/bind_unittest.cc +++ b/base/bind_unittest.cc @@ -179,10 +179,6 @@ int Sum(int a, int b, int c, int d, int e, int f) { return a + b + c + d + e + f; } -void OutputSum(int* output, int a, int b, int c, int d, int e) { - *output = a + b + c + d + e; -} - const char* CStringIdentity(const char* s) { return s; } diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index 3cccc86..b16f73f 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -222,24 +222,6 @@ void PostTask(BrowserThread::ID id, const base::Closure& callback) { BrowserThread::PostTask(id, FROM_HERE, callback); } -void SendMouseClick(int flags) { - ui_controls::MouseButton button = ui_controls::LEFT; - if ((flags & ui::EF_LEFT_MOUSE_BUTTON) == - ui::EF_LEFT_MOUSE_BUTTON) { - button = ui_controls::LEFT; - } else if ((flags & ui::EF_RIGHT_MOUSE_BUTTON) == - ui::EF_RIGHT_MOUSE_BUTTON) { - button = ui_controls::RIGHT; - } else if ((flags & ui::EF_MIDDLE_MOUSE_BUTTON) == - ui::EF_MIDDLE_MOUSE_BUTTON) { - button = ui_controls::MIDDLE; - } else { - NOTREACHED(); - } - - ui_controls::SendMouseClick(button); -} - class AutomationInterstitialPage : public content::InterstitialPageDelegate { public: AutomationInterstitialPage(WebContents* tab, diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc index e8d5176..e504234 100644 --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc @@ -468,9 +468,11 @@ bool HasImportSwitch(const CommandLine& command_line) { command_line.HasSwitch(switches::kImportFromFile)); } +#if defined(ENABLE_RLZ) bool IsGoogleUrl(const GURL& url) { return google_util::IsGoogleHomePageUrl(url.possibly_invalid_spec()); } +#endif } // namespace diff --git a/chrome/browser/component_updater/pepper_flash_component_installer.cc b/chrome/browser/component_updater/pepper_flash_component_installer.cc index 05ac5dd..77f678c 100644 --- a/chrome/browser/component_updater/pepper_flash_component_installer.cc +++ b/chrome/browser/component_updater/pepper_flash_component_installer.cc @@ -81,6 +81,7 @@ FilePath GetPepperFlashBaseDirectory() { return result; } +#if defined(GOOGLE_CHROME_BUILD) // Pepper Flash plugins have the version encoded in the path itself // so we need to enumerate the directories to find the full path. // On success, |latest_dir| returns something like: @@ -115,6 +116,7 @@ bool GetPepperFlashDirectory(FilePath* latest_dir, } return found; } +#endif // Returns true if the Pepper |interface_name| is implemented by this browser. // It does not check if the interface is proxied. @@ -300,6 +302,7 @@ bool CheckPepperFlashManifest(base::DictionaryValue* manifest, namespace { +#if defined(GOOGLE_CHROME_BUILD) void FinishPepperFlashUpdateRegistration(ComponentUpdateService* cus, const Version& version) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); @@ -346,6 +349,7 @@ void StartPepperFlashUpdateRegistration(ComponentUpdateService* cus) { file_util::Delete(*iter, true); } } +#endif // defined(GOOGLE_CHROME_BUILD) } // namespace diff --git a/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc b/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc index 204d6bf..726262e 100644 --- a/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc +++ b/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc @@ -34,25 +34,6 @@ using ::testing::_; using content::BrowserThread; -namespace { - -void ExpectObsoleteGeolocationSetting( - const DictionaryValue& geo_settings_dictionary, - const GURL& primary_origin, - const GURL& secondary_origin, - ContentSetting expected_setting) { - - const DictionaryValue* one_origin_settings; - ASSERT_TRUE(geo_settings_dictionary.GetDictionaryWithoutPathExpansion( - std::string(primary_origin.spec()), &one_origin_settings)); - int setting_value; - ASSERT_TRUE(one_origin_settings->GetIntegerWithoutPathExpansion( - std::string(secondary_origin.spec()), &setting_value)); - EXPECT_EQ(expected_setting, setting_value); -} - -} // namespace - namespace content_settings { class DeadlockCheckerThread : public base::PlatformThread::Delegate { diff --git a/chrome/browser/download/save_page_browsertest.cc b/chrome/browser/download/save_page_browsertest.cc index 435fc34..39d9801 100644 --- a/chrome/browser/download/save_page_browsertest.cc +++ b/chrome/browser/download/save_page_browsertest.cc @@ -53,22 +53,15 @@ using content::DownloadManager; using content::DownloadPersistentStoreInfo; using content::WebContents; -namespace { +const FilePath::CharType kTestDir[] = FILE_PATH_LITERAL("save_page"); -static const FilePath::CharType* kTestDir = FILE_PATH_LITERAL("save_page"); - -static const char* kAppendedExtension = +const char kAppendedExtension[] = #if defined(OS_WIN) ".htm"; #else ".html"; #endif -void NullFunction() { -} - -} // namespace - // Loosely based on logic in DownloadTestObserver. class DownloadItemCreatedObserver : public DownloadManager::Observer { public: diff --git a/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc b/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc index 7e568fa..1ce20ab 100644 --- a/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc +++ b/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc @@ -54,12 +54,6 @@ const char kOneAtATimeError[] = "Only one 'browsingData' API call can run at " } // namespace extension_browsing_data_api_constants namespace { -// Converts the JavaScript API's numeric input (miliseconds since epoch) into an -// appropriate base::Time that we can pass into the BrowsingDataRemove. -bool ParseTimeFromValue(const double& ms_since_epoch, base::Time* time) { - return true; -} - // Given a DictionaryValue |dict|, returns either the value stored as |key|, or // false, if the given key doesn't exist in the dictionary. bool RemoveType(base::DictionaryValue* dict, const std::string& key) { diff --git a/chrome/browser/extensions/api/declarative/declarative_api.cc b/chrome/browser/extensions/api/declarative/declarative_api.cc index ce226fd..5665e8f 100644 --- a/chrome/browser/extensions/api/declarative/declarative_api.cc +++ b/chrome/browser/extensions/api/declarative/declarative_api.cc @@ -20,22 +20,6 @@ namespace AddRules = extensions::api::events::Event::AddRules; namespace GetRules = extensions::api::events::Event::GetRules; namespace RemoveRules = extensions::api::events::Event::RemoveRules; -namespace { - -// Adds all entries from |list| to |out|. Assumes that all entries of |list| -// are strings. Returns true if successful. -bool AddAllStringValues(ListValue* list, std::vector<std::string>* out) { - for (ListValue::iterator i = list->begin(); i != list->end(); ++i) { - std::string value; - if (!(*i)->GetAsString(&value)) - return false; - out->push_back(value); - } - return true; -} - -} // namespace - namespace extensions { RulesFunction::RulesFunction() : rules_registry_(NULL) {} diff --git a/chrome/browser/extensions/api/extension_action/page_action_apitest.cc b/chrome/browser/extensions/api/extension_action/page_action_apitest.cc index 4e18704..9747bd6 100644 --- a/chrome/browser/extensions/api/extension_action/page_action_apitest.cc +++ b/chrome/browser/extensions/api/extension_action/page_action_apitest.cc @@ -18,21 +18,9 @@ #include "chrome/common/extensions/extension_action.h" #include "chrome/test/base/ui_test_utils.h" #include "content/public/browser/web_contents.h" -#include "ui/gfx/image/image_skia.h" using extensions::Extension; -namespace { - -gfx::Image CreateNonEmptyImage() { - SkBitmap bitmap; - bitmap.setConfig(SkBitmap::kARGB_8888_Config, 16, 16); - bitmap.allocPixels(); - return gfx::Image(bitmap); -} - -} // namespace - IN_PROC_BROWSER_TEST_F(ExtensionApiTest, PageAction) { ASSERT_TRUE(test_server()->Start()); ASSERT_TRUE(RunExtensionTest("page_action/basics")) << message_; diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc index 8fa1fbf..5e4883a 100644 --- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc +++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc @@ -101,18 +101,6 @@ const char kNoPreviousBeginInstallWithManifestError[] = "* does not match a previous call to beginInstallWithManifest3"; const char kUserCancelledError[] = "User cancelled install"; -ProfileSyncService* test_sync_service = NULL; - -// Returns either the test sync service, or the real one from |profile|. -ProfileSyncService* GetSyncService(Profile* profile) { - // TODO(webstore): It seems |test_sync_service| is not used anywhere. It - // should be removed. - if (test_sync_service) - return test_sync_service; - else - return ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); -} - // Helper to create a dictionary with login and token properties set from // the appropriate values in the passed-in |profile|. DictionaryValue* CreateLoginResult(Profile* profile) { @@ -138,12 +126,6 @@ WebstoreInstaller::Delegate* test_webstore_installer_delegate = NULL; } // namespace // static -void WebstorePrivateApi::SetTestingProfileSyncService( - ProfileSyncService* service) { - test_sync_service = service; -} - -// static void WebstorePrivateApi::SetWebstoreInstallerDelegateForTesting( WebstoreInstaller::Delegate* delegate) { test_webstore_installer_delegate = delegate; diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_api.h b/chrome/browser/extensions/api/webstore_private/webstore_private_api.h index c69afdd..f77a135 100644 --- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.h +++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.h @@ -28,10 +28,6 @@ namespace extensions { class WebstorePrivateApi { public: - // Allows you to set the ProfileSyncService the function will use for - // testing purposes. - static void SetTestingProfileSyncService(ProfileSyncService* service); - // Allows you to override the WebstoreInstaller delegate for testing. static void SetWebstoreInstallerDelegateForTesting( WebstoreInstaller::Delegate* delegate); diff --git a/chrome/browser/extensions/settings/settings_sync_unittest.cc b/chrome/browser/extensions/settings/settings_sync_unittest.cc index 430cdd6..e561cfc 100644 --- a/chrome/browser/extensions/settings/settings_sync_unittest.cc +++ b/chrome/browser/extensions/settings/settings_sync_unittest.cc @@ -194,12 +194,6 @@ class TestingValueStoreFactory : public SettingsStorageFactory { std::map<std::string, TestingValueStore*> created_; }; -void AssignSettingsService(syncer::SyncableService** dst, - const SettingsFrontend* frontend, - syncer::ModelType type) { - *dst = frontend->GetBackendForSync(type); -} - } // namespace class ExtensionSettingsSyncTest : public testing::Test { diff --git a/chrome/browser/google_apis/gdata_util_unittest.cc b/chrome/browser/google_apis/gdata_util_unittest.cc index 9cf33e2..06cf464a 100644 --- a/chrome/browser/google_apis/gdata_util_unittest.cc +++ b/chrome/browser/google_apis/gdata_util_unittest.cc @@ -15,6 +15,9 @@ namespace gdata { namespace util { +#if defined(OS_CHROMEOS) +// TODO(yoshiki): Find platform independent way to get/set local timezone. +// (http://crbug.com/147524). namespace { std::string FormatTime(const base::Time& time) { @@ -23,9 +26,6 @@ std::string FormatTime(const base::Time& time) { } // namespace -// TODO(yoshiki): Find platform independent way to get/set local timezone. -// (http://crbug.com/147524). -#if defined(OS_CHROMEOS) TEST(GDataUtilTest, GetTimeFromStringLocalTimezone) { // Creates time object GMT. base::Time::Exploded exploded = {2012, 7, 0, 14, 1, 3, 21, 151}; diff --git a/chrome/browser/importer/importer_list.cc b/chrome/browser/importer/importer_list.cc index 1c3d0ab..53b9249 100644 --- a/chrome/browser/importer/importer_list.cc +++ b/chrome/browser/importer/importer_list.cc @@ -93,6 +93,7 @@ void DetectFirefoxProfiles(std::vector<importer::SourceProfile*>* profiles) { profiles->push_back(firefox); } +#if defined(OS_WIN) void DetectGoogleToolbarProfiles( std::vector<importer::SourceProfile*>* profiles, scoped_refptr<net::URLRequestContextGetter> request_context_getter) { @@ -109,6 +110,7 @@ void DetectGoogleToolbarProfiles( google_toolbar->request_context_getter = request_context_getter; profiles->push_back(google_toolbar); } +#endif } // namespace diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc index 8025882..2771aa9 100644 --- a/chrome/browser/metrics/metrics_log.cc +++ b/chrome/browser/metrics/metrics_log.cc @@ -242,6 +242,7 @@ void WriteProfilerData(const ProcessDataSnapshot& profiler_data, } } +#if defined(GOOGLE_CHROME_BUILD) && defined(OS_WIN) void ProductDataToProto(const GoogleUpdateSettings::ProductData& product_data, ProductInfo* product_info) { product_info->set_version(product_data.version); @@ -254,6 +255,7 @@ void ProductDataToProto(const GoogleUpdateSettings::ProductData& product_data, static_cast<ProductInfo::InstallResult>(product_data.last_result)); } } +#endif } // namespace diff --git a/chrome/browser/sessions/base_session_service.cc b/chrome/browser/sessions/base_session_service.cc index b89c6a3..7f3385e 100644 --- a/chrome/browser/sessions/base_session_service.cc +++ b/chrome/browser/sessions/base_session_service.cc @@ -52,18 +52,6 @@ void WriteStringToPickle(Pickle& pickle, int* bytes_written, int max_bytes, } } -// string16 version of WriteStringToPickle. -void WriteString16ToPickle(Pickle& pickle, int* bytes_written, int max_bytes, - const string16& str) { - int num_bytes = str.size() * sizeof(char16); - if (*bytes_written + num_bytes < max_bytes) { - *bytes_written += num_bytes; - pickle.WriteString16(str); - } else { - pickle.WriteString16(string16()); - } -} - } // namespace // Delay between when a command is received, and when we save it to the diff --git a/chrome/browser/sync/glue/sync_backend_host_unittest.cc b/chrome/browser/sync/glue/sync_backend_host_unittest.cc index 945de64..d912d33 100644 --- a/chrome/browser/sync/glue/sync_backend_host_unittest.cc +++ b/chrome/browser/sync/glue/sync_backend_host_unittest.cc @@ -46,11 +46,7 @@ ACTION_P(Signal, event) { event->Signal(); } -void SignalEvent(base::WaitableEvent* event) { - event->Signal(); -} - -static void QuitMessageLoop() { +void QuitMessageLoop() { MessageLoop::current()->Quit(); } diff --git a/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm b/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm index d48e287..4ad0c59 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm @@ -96,16 +96,6 @@ enum { kExtensionContextManage = 7, }; -int CurrentTabId() { - Browser* browser = browser::GetLastActiveBrowser(); - if(!browser) - return -1; - WebContents* contents = chrome::GetActiveWebContents(browser); - if (!contents) - return -1; - return ExtensionTabUtil::GetTabId(contents); -} - } // namespace - (id)initWithExtension:(const Extension*)extension diff --git a/chrome/browser/ui/panels/base_panel_browser_test.cc b/chrome/browser/ui/panels/base_panel_browser_test.cc index c39c8b2..8294c1f 100644 --- a/chrome/browser/ui/panels/base_panel_browser_test.cc +++ b/chrome/browser/ui/panels/base_panel_browser_test.cc @@ -178,11 +178,6 @@ void MockDisplaySettingsProviderImpl::SetDesktopBarThickness( OnAutoHidingDesktopBarChanged(); } -bool ExistsPanel(Panel* panel) { - std::vector<Panel*> panels = PanelManager::GetInstance()->panels(); - return std::find(panels.begin(), panels.end(), panel) != panels.end(); -} - } // namespace const FilePath::CharType* BasePanelBrowserTest::kTestDir = diff --git a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc index 681855a..37a2e02 100644 --- a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc +++ b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc @@ -363,6 +363,7 @@ void PDFUnsupportedFeaturePromptDelegate::Cancel() { UserMetricsAction("PDF_InstallReaderInfoBarCancel")); } +#if defined(OS_WIN) && defined(ENABLE_PLUGIN_INSTALLATION) void GotPluginsCallback(int process_id, int routing_id, const std::vector<webkit::WebPluginInfo>& plugins) { @@ -400,6 +401,7 @@ void GotPluginsCallback(int process_id, PDFTabHelper* pdf_tab_helper = PDFTabHelper::FromWebContents(web_contents); pdf_tab_helper->ShowOpenInReaderPrompt(prompt.Pass()); } +#endif // defined(OS_WIN) && defined(ENABLE_PLUGIN_INSTALLATION) } // namespace diff --git a/chrome/browser/ui/tab_contents/tab_contents_iterator_unittest.cc b/chrome/browser/ui/tab_contents/tab_contents_iterator_unittest.cc index ec6f25e..9c4966c 100644 --- a/chrome/browser/ui/tab_contents/tab_contents_iterator_unittest.cc +++ b/chrome/browser/ui/tab_contents/tab_contents_iterator_unittest.cc @@ -35,13 +35,6 @@ size_t CountAllTabs() { return count; } -// Helper function to navigate to the print preview page. -void NavigateToPrintUrl(TabContents* tab, int page_id) { - content::RenderViewHostTester::For( - tab->web_contents()->GetRenderViewHost())->SendNavigate( - page_id, GURL(chrome::kChromeUIPrintURL)); -} - } // namespace TEST_F(BrowserListTest, TabContentsIteratorVerifyCount) { @@ -153,86 +146,6 @@ TEST_F(BrowserListTest, TabContentsIteratorVerifyBrowser) { chrome::CloseAllTabs(browser3.get()); } -#if 0 -// TODO(thestig) Fix or remove this test. http://crbug.com/100309 -TEST_F(BrowserListTest, TabContentsIteratorBackgroundPrinting) { - // Make sure we have 1 window to start with. - EXPECT_EQ(1U, BrowserList::size()); - - // Create more browsers/windows. - scoped_ptr<Browser> browser2( - chrome::CreateBrowserWithTestWindowForProfile(profile())); - scoped_ptr<Browser> browser3( - chrome::CreateBrowserWithTestWindowForProfile(profile())); - - EXPECT_EQ(0U, CountAllTabs()); - - // Add some tabs. - for (size_t i = 0; i < 3; ++i) - chrome::NewTab(browser2); - chrome::NewTab(browser3); - - EXPECT_EQ(4U, CountAllTabs()); - - TestingBrowserProcess* browser_process = - static_cast<TestingBrowserProcess*>(g_browser_process); - printing::BackgroundPrintingManager* bg_print_manager = - browser_process->background_printing_manager(); - - // Grab a tab and give ownership to BackgroundPrintingManager. - TabContentsIterator tab_iterator; - TabContents* tab = *tab_iterator; - int page_id = 1; - NavigateToPrintUrl(tab, page_id++); - - bg_print_manager->OwnPrintPreviewTab(tab); - - EXPECT_EQ(4U, CountAllTabs()); - - // Close remaining tabs. - chrome::CloseAllTabs(browser2.get()); - chrome::CloseAllTabs(browser3.get()); - - EXPECT_EQ(1U, CountAllTabs()); - - // Delete the last remaining tab. - delete tab; - - EXPECT_EQ(0U, CountAllTabs()); - - // Add some tabs. - for (size_t i = 0; i < 3; ++i) { - chrome::NewTab(browser2.get()); - chrome::NewTab(browser3.get()); - } - - EXPECT_EQ(6U, CountAllTabs()); - - // Tell BackgroundPrintingManager to take ownership of all tabs. - // Save the tabs in |owned_tabs| because manipulating tabs in the middle of - // TabContentsIterator is a bad idea. - std::vector<TabContents*> owned_tabs; - for (TabContentsIterator iterator; !iterator.done(); ++iterator) { - NavigateToPrintUrl(*iterator, page_id++); - owned_tabs.push_back(*iterator); - } - for (std::vector<TabContents*>::iterator it = owned_tabs.begin(); - it != owned_tabs.end(); ++it) { - bg_print_manager->OwnPrintPreviewTab(*it); - } - - EXPECT_EQ(6U, CountAllTabs()); - - // Delete all tabs to clean up. - for (std::vector<TabContents*>::iterator it = owned_tabs.begin(); - it != owned_tabs.end(); ++it) { - delete *it; - } - - EXPECT_EQ(0U, CountAllTabs()); -} -#endif - #if defined(OS_CHROMEOS) // Calling AttemptRestart on ChromeOS will exit the test. #define MAYBE_AttemptRestart DISABLED_AttemptRestart diff --git a/chrome/browser/ui/webui/chrome_url_data_manager_backend.cc b/chrome/browser/ui/webui/chrome_url_data_manager_backend.cc index a8b60c2..1592754 100644 --- a/chrome/browser/ui/webui/chrome_url_data_manager_backend.cc +++ b/chrome/browser/ui/webui/chrome_url_data_manager_backend.cc @@ -566,6 +566,7 @@ void ChromeURLDataManagerBackend::DataAvailable(RequestID request_id, namespace { +#if defined(DEBUG_DEVTOOLS) bool IsSupportedDevToolsURL(const GURL& url, FilePath* path) { if (!url.SchemeIs(chrome::kChromeDevToolsScheme)) return false; @@ -606,6 +607,7 @@ bool IsSupportedDevToolsURL(const GURL& url, FilePath* path) { *path = inspector_dir.AppendASCII(relative_path); return true; } +#endif // defined(DEBUG_DEVTOOLS) class DevToolsJobFactory : public net::URLRequestJobFactory::ProtocolHandler { diff --git a/chrome/browser/ui/webui/gpu_internals_ui.cc b/chrome/browser/ui/webui/gpu_internals_ui.cc index 9ada4d0..d813c41 100644 --- a/chrome/browser/ui/webui/gpu_internals_ui.cc +++ b/chrome/browser/ui/webui/gpu_internals_ui.cc @@ -84,6 +84,7 @@ Value* NewStatusValue(const char* name, const char* status) { return value; } +#if defined(OS_WIN) // Output DxDiagNode tree as nested array of {description,value} pairs ListValue* DxDiagNodeToList(const content::DxDiagNode& node) { ListValue* list = new ListValue(); @@ -103,6 +104,7 @@ ListValue* DxDiagNodeToList(const content::DxDiagNode& node) { } return list; } +#endif std::string GPUDeviceToString(const content::GPUInfo::GPUDevice& gpu) { std::string vendor = base::StringPrintf("0x%04x", gpu.vendor_id); diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc index 6c90c7d..15fd8b1 100644 --- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc +++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc @@ -13,9 +13,6 @@ #include "base/i18n/rtl.h" #include "base/metrics/field_trial.h" #include "base/metrics/histogram.h" -#include "base/string_number_conversions.h" -#include "base/string_split.h" -#include "base/string_util.h" #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/extensions/app_notification.h" @@ -51,9 +48,7 @@ #include "grit/browser_resources.h" #include "grit/generated_resources.h" #include "net/base/escape.h" -#include "ui/base/animation/animation.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/gfx/codec/png_codec.h" #include "ui/gfx/favicon_size.h" using application_launch::LaunchParams; @@ -63,23 +58,9 @@ using extensions::CrxInstaller; using extensions::Extension; using extensions::ExtensionPrefs; -namespace { - const net::UnescapeRule::Type kUnescapeRules = net::UnescapeRule::NORMAL | net::UnescapeRule::URL_SPECIAL_CHARS; -extension_misc::AppLaunchBucket ParseLaunchSource( - const std::string& launch_source) { - int bucket_num = extension_misc::APP_LAUNCH_BUCKET_INVALID; - base::StringToInt(launch_source, &bucket_num); - extension_misc::AppLaunchBucket bucket = - static_cast<extension_misc::AppLaunchBucket>(bucket_num); - CHECK(bucket < extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); - return bucket; -} - -} // namespace - AppLauncherHandler::AppInstallInfo::AppInstallInfo() {} AppLauncherHandler::AppInstallInfo::~AppInstallInfo() {} diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc index becc43f..43ae74f 100644 --- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc +++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc @@ -64,7 +64,6 @@ #include "chrome/browser/platform_util.h" #endif -using base::Time; using content::BrowserThread; namespace { @@ -173,13 +172,6 @@ std::string GetNewTabBackgroundTilingCSS( return ThemeService::TilingToString(repeat_mode); } -// Is the current time within a given date range? -bool InDateRange(double begin, double end) { - Time start_time = Time::FromDoubleT(begin); - Time end_time = Time::FromDoubleT(end); - return start_time < Time::Now() && end_time > Time::Now(); -} - } // namespace NTPResourceCache::NTPResourceCache(Profile* profile) diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc index 027e7cb..5950d85 100644 --- a/chrome/browser/ui/webui/options/content_settings_handler.cc +++ b/chrome/browser/ui/webui/options/content_settings_handler.cc @@ -159,15 +159,6 @@ DictionaryValue* GetNotificationExceptionForPage( return exception; } -// Returns true whenever the hosted |app|'s extent enjoys protected storage -// under the current |profile|. -// Must have the AppFilter signature. -bool HasProtectedStorage(const extensions::Extension& app, Profile* profile) { - ExtensionSpecialStoragePolicy* policy = - profile->GetExtensionSpecialStoragePolicy(); - return policy->NeedsProtection(&app); -} - // Returns true whenever the |extension| is hosted and has |permission|. // Must have the AppFilter signature. template <APIPermission::ID permission> diff --git a/chrome/browser/ui/webui/sync_setup_handler.cc b/chrome/browser/ui/webui/sync_setup_handler.cc index 20bf3bf..d278632 100644 --- a/chrome/browser/ui/webui/sync_setup_handler.cc +++ b/chrome/browser/ui/webui/sync_setup_handler.cc @@ -166,15 +166,6 @@ bool GetConfiguration(const std::string& json, SyncConfigInfo* config) { return true; } -bool GetPassphrase(const std::string& json, std::string* passphrase) { - scoped_ptr<Value> parsed_value(base::JSONReader::Read(json)); - if (!parsed_value.get() || !parsed_value->IsType(Value::TYPE_DICTIONARY)) - return false; - - DictionaryValue* result = static_cast<DictionaryValue*>(parsed_value.get()); - return result->GetString("passphrase", passphrase); -} - string16 NormalizeUserName(const string16& user) { if (user.find_first_of(ASCIIToUTF16("@")) != string16::npos) return user; diff --git a/chrome/browser/value_store/value_store_unittest.cc b/chrome/browser/value_store/value_store_unittest.cc index 980a557..23860f4 100644 --- a/chrome/browser/value_store/value_store_unittest.cc +++ b/chrome/browser/value_store/value_store_unittest.cc @@ -24,20 +24,6 @@ std::string GetJSON(const Value& value) { return json; } -// Pretty-prints a set of strings. -std::string ToString(const std::set<std::string>& strings) { - std::string string("{"); - for (std::set<std::string>::const_iterator it = strings.begin(); - it != strings.end(); ++it) { - if (it != strings.begin()) { - string.append(", "); - } - string.append(*it); - } - string.append("}"); - return string; -} - } // namespace // Compares two possibly NULL values for equality, filling |error| with an diff --git a/chrome/browser/webdata/keyword_table.cc b/chrome/browser/webdata/keyword_table.cc index 47d4852..fd0cb02 100644 --- a/chrome/browser/webdata/keyword_table.cc +++ b/chrome/browser/webdata/keyword_table.cc @@ -101,17 +101,6 @@ void BindURLToStatement(const TemplateURLData& data, s->BindString(starting_column + 15, data.sync_guid); } -// Signs search provider id and returns its signature. -std::string GetSearchProviderIDSignature(int64 id) { - return protector::SignSetting(base::Int64ToString(id)); -} - -// Checks if signature for search provider id is correct and returns the -// result. -bool IsSearchProviderIDValid(int64 id, const std::string& signature) { - return protector::IsSettingValid(base::Int64ToString(id), signature); -} - } // anonymous namespace KeywordTable::KeywordTable(sql::Connection* db, sql::MetaTable* meta_table) diff --git a/chrome/common/extensions/extension_unittest.cc b/chrome/common/extensions/extension_unittest.cc index 8306ff6..e9bfc4f 100644 --- a/chrome/common/extensions/extension_unittest.cc +++ b/chrome/common/extensions/extension_unittest.cc @@ -46,16 +46,7 @@ namespace errors = extension_manifest_errors; namespace { -void CompareLists(const std::vector<std::string>& expected, - const std::vector<std::string>& actual) { - ASSERT_EQ(expected.size(), actual.size()); - - for (size_t i = 0; i < expected.size(); ++i) { - EXPECT_EQ(expected[i], actual[i]); - } -} - -static scoped_refptr<Extension> LoadManifestUnchecked( +scoped_refptr<Extension> LoadManifestUnchecked( const std::string& dir, const std::string& test_file, Extension::Location location, diff --git a/chrome/common/extensions/permissions/permission_set_unittest.cc b/chrome/common/extensions/permissions/permission_set_unittest.cc index 6b65c11..f32b38b 100644 --- a/chrome/common/extensions/permissions/permission_set_unittest.cc +++ b/chrome/common/extensions/permissions/permission_set_unittest.cc @@ -25,9 +25,9 @@ namespace keys = extension_manifest_keys; namespace values = extension_manifest_values; namespace { -static scoped_refptr<Extension> LoadManifest(const std::string& dir, - const std::string& test_file, - int extra_flags) { +scoped_refptr<Extension> LoadManifest(const std::string& dir, + const std::string& test_file, + int extra_flags) { FilePath path; PathService::Get(chrome::DIR_TEST_DATA, &path); path = path.AppendASCII("extensions") @@ -49,27 +49,18 @@ static scoped_refptr<Extension> LoadManifest(const std::string& dir, return extension; } -static scoped_refptr<Extension> LoadManifest(const std::string& dir, - const std::string& test_file) { +scoped_refptr<Extension> LoadManifest(const std::string& dir, + const std::string& test_file) { return LoadManifest(dir, test_file, Extension::NO_FLAGS); } -void CompareLists(const std::vector<std::string>& expected, - const std::vector<std::string>& actual) { - ASSERT_EQ(expected.size(), actual.size()); - - for (size_t i = 0; i < expected.size(); ++i) { - EXPECT_EQ(expected[i], actual[i]); - } -} - static void AddPattern(URLPatternSet* extent, const std::string& pattern) { int schemes = URLPattern::SCHEME_ALL; extent->AddPattern(URLPattern(schemes, pattern)); } -static size_t IndexOf(const std::vector<string16>& warnings, - const std::string& warning) { +size_t IndexOf(const std::vector<string16>& warnings, + const std::string& warning) { for (size_t i = 0; i < warnings.size(); ++i) { if (warnings[i] == ASCIIToUTF16(warning)) return i; @@ -78,8 +69,8 @@ static size_t IndexOf(const std::vector<string16>& warnings, return warnings.size(); } -static bool Contains(const std::vector<string16>& warnings, - const std::string& warning) { +bool Contains(const std::vector<string16>& warnings, + const std::string& warning) { return IndexOf(warnings, warning) != warnings.size(); } diff --git a/chrome/common/pepper_flash.cc b/chrome/common/pepper_flash.cc index ddaf733..a13b221 100644 --- a/chrome/common/pepper_flash.cc +++ b/chrome/common/pepper_flash.cc @@ -4,68 +4,8 @@ #include "chrome/common/pepper_flash.h" -#include "base/basictypes.h" -#include "base/command_line.h" -#include "base/memory/ref_counted.h" -#include "base/metrics/field_trial.h" -#include "chrome/common/chrome_switches.h" -#include "chrome/common/chrome_version_info.h" #include "ppapi/shared_impl/ppapi_permissions.h" -#if defined(OS_WIN) -#include "base/win/metro.h" -#endif - -namespace { - -const char* const kFieldTrialName = "ApplyPepperFlash"; -const char* const kDisableGroupName = "DisableByDefault"; -const char* const kEnableGroupName = "EnableByDefault"; -int g_disabled_group_number = -1; - -void ActivateFieldTrial() { - // The field trial will expire on Jan 1st, 2014. - scoped_refptr<base::FieldTrial> trial( - base::FieldTrialList::FactoryGetFieldTrial( - kFieldTrialName, 1000, kDisableGroupName, 2014, 1, 1, - &g_disabled_group_number)); - - CommandLine* command_line = CommandLine::ForCurrentProcess(); - if (command_line->HasSwitch(switches::kPpapiFlashFieldTrial)) { - std::string switch_value = - command_line->GetSwitchValueASCII(switches::kPpapiFlashFieldTrial); - if (switch_value == switches::kPpapiFlashFieldTrialEnableByDefault) { - trial->AppendGroup(kEnableGroupName, 1000); - return; - } else if (switch_value == - switches::kPpapiFlashFieldTrialDisableByDefault) { - return; - } - } - - // Disable by default if one time randomization is not available. - if (!base::FieldTrialList::IsOneTimeRandomizationEnabled()) - return; - - trial->UseOneTimeRandomization(); - // 50% goes into the enable-by-default group. - trial->AppendGroup(kEnableGroupName, 500); -} - -bool IsInFieldTrialGroup() { - static bool activated = false; - if (!activated) { - ActivateFieldTrial(); - activated = true; - } - - int group = base::FieldTrialList::FindValue(kFieldTrialName); - return group != base::FieldTrial::kNotFinalized && - group != g_disabled_group_number; -} - -} // namespace - bool ConductingPepperFlashFieldTrial() { #if defined(OS_WIN) return true; diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc index b074f06..481be2d 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc @@ -125,6 +125,7 @@ void AcceleratedSurfaceBuffersSwappedCompletedForGPU(int host_id, } } +#if defined(OS_WIN) // This sends a ViewMsg_SwapBuffers_ACK directly to the renderer process // (RenderWidget). This path is currently not used with the threaded compositor. void AcceleratedSurfaceBuffersSwappedCompletedForRenderer( @@ -167,6 +168,7 @@ void AcceleratedSurfaceBuffersSwappedCompleted(int host_id, AcceleratedSurfaceBuffersSwappedCompletedForRenderer(surface_id, timebase, interval); } +#endif // defined(OS_WIN) } // anonymous namespace @@ -663,7 +665,6 @@ void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped( #endif // OS_MACOSX #if defined(OS_WIN) - void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped( const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params) { TRACE_EVENT0("gpu", "GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped"); diff --git a/content/browser/renderer_host/gesture_event_filter.cc b/content/browser/renderer_host/gesture_event_filter.cc index 7e0c6e4..af331c3 100644 --- a/content/browser/renderer_host/gesture_event_filter.cc +++ b/content/browser/renderer_host/gesture_event_filter.cc @@ -50,16 +50,6 @@ static int GetTapDownDeferralTimeMs() { switches::kTapDownDeferralTimeMs); return tap_down_deferral_time_window; } - - -// TODO(rjkroege): Coalesce pinch updates. -// Returns |true| if two gesture events should be coalesced. -bool ShouldCoalesceGestureEvents(const WebKit::WebGestureEvent& last_event, - const WebKit::WebGestureEvent& new_event) { - return new_event.type == WebInputEvent::GestureScrollUpdate && - last_event.type == new_event.type && - last_event.modifiers == new_event.modifiers; -} } // namespace GestureEventFilter::GestureEventFilter(RenderWidgetHostImpl* rwhv) diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc index 0e09eda..14fa05a 100644 --- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc +++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc @@ -44,11 +44,6 @@ static base::LazyInstance<std::set<WebGraphicsContext3DCommandBufferImpl*> > namespace { -void ClearSharedContexts() { - base::AutoLock lock(g_all_shared_contexts_lock.Get()); - g_all_shared_contexts.Pointer()->clear(); -} - void ClearSharedContextsIfInShareSet( WebGraphicsContext3DCommandBufferImpl* context) { // If the given context isn't in the share set, that means that it diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc index c60d75c..b1a81f6 100644 --- a/content/gpu/gpu_main.cc +++ b/content/gpu/gpu_main.cc @@ -48,7 +48,9 @@ namespace { void WarmUpSandbox(const content::GPUInfo&, bool); +#if defined(OS_LINUX) void CollectGraphicsInfo(content::GPUInfo*); +#endif } // Main function for starting the Gpu process. @@ -227,6 +229,7 @@ int GpuMain(const content::MainFunctionParams& parameters) { namespace { +#if defined(OS_LINUX) void CreateDummyGlContext() { scoped_refptr<gfx::GLSurface> surface( gfx::GLSurface::CreateOffscreenGLSurface(false, gfx::Size(1, 1))); @@ -253,6 +256,7 @@ void CreateDummyGlContext() { VLOG(1) << "gfx::GLContext::MakeCurrent failed"; } } +#endif void WarmUpSandbox(const content::GPUInfo& gpu_info, bool should_initialize_gl_context) { @@ -309,11 +313,13 @@ void WarmUpSandbox(const content::GPUInfo& gpu_info, #endif } +#if defined(OS_LINUX) void CollectGraphicsInfo(content::GPUInfo* gpu_info) { if (!gpu_info_collector::CollectGraphicsInfo(gpu_info)) VLOG(1) << "gpu_info_collector::CollectGraphicsInfo failed"; content::GetContentClient()->SetGpuInfo(*gpu_info); } +#endif } // namespace. diff --git a/content/renderer/browser_plugin/browser_plugin_bindings.cc b/content/renderer/browser_plugin/browser_plugin_bindings.cc index 2e6fafc..a9d5bb9 100644 --- a/content/renderer/browser_plugin/browser_plugin_bindings.cc +++ b/content/renderer/browser_plugin/browser_plugin_bindings.cc @@ -110,16 +110,6 @@ std::string StringFromNPVariant(const NPVariant& variant) { return std::string(np_string.UTF8Characters, np_string.UTF8Length); } -string16 String16FromNPVariant(const NPVariant& variant) { - if (!NPVARIANT_IS_STRING(variant)) - return string16(); - const NPString& np_string = NPVARIANT_TO_STRING(variant); - string16 wstr; - if (!UTF8ToUTF16(np_string.UTF8Characters, np_string.UTF8Length, &wstr)) - return string16(); - return wstr; -} - bool StringToNPVariant(const std::string &in, NPVariant *variant) { size_t length = in.size(); NPUTF8 *chars = static_cast<NPUTF8 *>(malloc(length)); diff --git a/content/renderer/pepper/pepper_url_request_unittest.cc b/content/renderer/pepper/pepper_url_request_unittest.cc index ed7c59e..6716d87 100644 --- a/content/renderer/pepper/pepper_url_request_unittest.cc +++ b/content/renderer/pepper/pepper_url_request_unittest.cc @@ -42,10 +42,6 @@ bool IsExpected(const WebString& web_string, const char* expected) { return IsExpected(web_string.utf8(), expected); } -bool IsNullOrEmpty(const WebString& web_string) { - return web_string.isNull() || web_string.isEmpty(); -} - // The base class destructor is protected, so derive. class TestWebFrameClient : public WebFrameClient { }; diff --git a/net/base/net_util.cc b/net/base/net_util.cc index 55ad010..e40c822 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -165,6 +165,7 @@ static const int kAllowedFtpPorts[] = { 22, // ssh }; +#if defined(OS_WIN) std::string::size_type CountTrailingChars( const std::string& input, const std::string::value_type trailing_chars[]) { @@ -172,6 +173,7 @@ std::string::size_type CountTrailingChars( return (last_good_char == std::string::npos) ? input.length() : (input.length() - last_good_char - 1); } +#endif // Similar to Base64Decode. Decodes a Q-encoded string to a sequence // of bytes. If input is invalid, return false. diff --git a/net/base/x509_util_nss.cc b/net/base/x509_util_nss.cc index a4eaf6f..c86b9c5 100644 --- a/net/base/x509_util_nss.cc +++ b/net/base/x509_util_nss.cc @@ -254,6 +254,7 @@ bool CreateDomainBoundCertInternal( return true; } +#if defined(USE_NSS) || defined(OS_IOS) // Callback for CERT_DecodeCertPackage(), used in // CreateOSCertHandlesFromBytes(). SECStatus PR_CALLBACK CollectCertsCallback(void* arg, @@ -272,6 +273,7 @@ SECStatus PR_CALLBACK CollectCertsCallback(void* arg, return SECSuccess; } +#endif // defined(USE_NSS) || defined(OS_IOS) } // namespace diff --git a/net/base/x509_util_nss_unittest.cc b/net/base/x509_util_nss_unittest.cc index be719d7..e6c0175 100644 --- a/net/base/x509_util_nss_unittest.cc +++ b/net/base/x509_util_nss_unittest.cc @@ -31,6 +31,7 @@ CERTCertificate* CreateNSSCertHandleFromBytes(const char* data, size_t length) { PR_FALSE, PR_TRUE); } +#if !defined(OS_WIN) && !defined(OS_MACOSX) void VerifyCertificateSignature(const std::string& der_cert, const std::vector<uint8>& der_spki) { crypto::ScopedPLArenaPool arena(PORT_NewArena(DER_DEFAULT_CHUNKSIZE)); @@ -73,6 +74,7 @@ void VerifyCertificateSignature(const std::string& der_cert, ok = verifier.VerifyFinal(); EXPECT_TRUE(ok); } +#endif // !defined(OS_WIN) && !defined(OS_MACOSX) void VerifyDomainBoundCert(const std::string& domain, const std::string& der_cert) { diff --git a/ppapi/proxy/ppb_file_ref_proxy.cc b/ppapi/proxy/ppb_file_ref_proxy.cc index 3889c77..dcfb137 100644 --- a/ppapi/proxy/ppb_file_ref_proxy.cc +++ b/ppapi/proxy/ppb_file_ref_proxy.cc @@ -165,14 +165,6 @@ int FileRef::SendCallback(scoped_refptr<TrackedCallback> callback) { return next_callback_id_++; } -namespace { - -InterfaceProxy* CreateFileRefProxy(Dispatcher* dispatcher) { - return new PPB_FileRef_Proxy(dispatcher); -} - -} // namespace - PPB_FileRef_Proxy::PPB_FileRef_Proxy(Dispatcher* dispatcher) : InterfaceProxy(dispatcher), callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { diff --git a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc index 2400312..836f2d0 100644 --- a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc +++ b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc @@ -237,10 +237,6 @@ static const PPP_ContentDecryptor_Private content_decryptor_interface = { &DecryptAndDecode }; -InterfaceProxy* CreateContentDecryptorPPPProxy(Dispatcher* dispatcher) { - return new PPP_ContentDecryptor_Private_Proxy(dispatcher); -} - } // namespace PPP_ContentDecryptor_Private_Proxy::PPP_ContentDecryptor_Private_Proxy( diff --git a/ppapi/proxy/ppp_instance_proxy.cc b/ppapi/proxy/ppp_instance_proxy.cc index f7c7dfd..16287ba 100644 --- a/ppapi/proxy/ppp_instance_proxy.cc +++ b/ppapi/proxy/ppp_instance_proxy.cc @@ -28,17 +28,6 @@ namespace proxy { namespace { -void GetFullscreenStates(PP_Instance instance, - HostDispatcher* dispatcher, - PP_Bool* fullscreen, - PP_Bool* flash_fullscreen) { - const PPB_Fullscreen* fullscreen_interface = - static_cast<const PPB_Fullscreen*>( - dispatcher->local_get_interface()(PPB_FULLSCREEN_INTERFACE)); - DCHECK(fullscreen_interface); - *fullscreen = fullscreen_interface->IsFullscreen(instance); -} - PP_Bool IsFlashFullscreen(PP_Instance instance, HostDispatcher* dispatcher) { const PPB_FlashFullscreen* flash_fullscreen_interface = diff --git a/ppapi/thunk/ppb_view_thunk.cc b/ppapi/thunk/ppb_view_thunk.cc index ea6f624..c9a88b7 100644 --- a/ppapi/thunk/ppb_view_thunk.cc +++ b/ppapi/thunk/ppb_view_thunk.cc @@ -25,14 +25,6 @@ PP_Bool IsView(PP_Resource resource) { return enter.succeeded() ? PP_TRUE : PP_FALSE; } -PP_Bool GetSize(PP_Resource resource, PP_Size* size) { - EnterView enter(resource, true); - if (enter.failed() || !size) - return PP_FALSE; - *size = enter.object()->GetData().rect.size; - return PP_TRUE; -} - PP_Bool GetRect(PP_Resource resource, PP_Rect* viewport) { EnterView enter(resource, true); if (enter.failed() || !viewport) @@ -63,13 +55,6 @@ PP_Bool IsPageVisible(PP_Resource resource) { return PP_FromBool(enter.object()->GetData().is_page_visible); } -PP_Bool IsClipVisible(PP_Resource resource) { - EnterView enter(resource, true); - if (enter.failed()) - return PP_FALSE; - return PP_FromBool(IsRectVisible(enter.object()->GetData().clip_rect)); -} - PP_Bool GetClipRect(PP_Resource resource, PP_Rect* clip) { EnterView enter(resource, true); if (enter.failed() || !clip) diff --git a/remoting/jingle_glue/xmpp_signal_strategy.cc b/remoting/jingle_glue/xmpp_signal_strategy.cc index 9a04f7b..03adcb8 100644 --- a/remoting/jingle_glue/xmpp_signal_strategy.cc +++ b/remoting/jingle_glue/xmpp_signal_strategy.cc @@ -21,8 +21,6 @@ #include "third_party/libjingle/source/talk/xmpp/prexmppauth.h" #include "third_party/libjingle/source/talk/xmpp/saslcookiemechanism.h" -namespace { - const char kDefaultResourceName[] = "chromoting"; // Use 58 seconds keep-alive interval, in case routers terminate @@ -34,12 +32,6 @@ const int kKeepAliveIntervalSeconds = 50; const size_t kReadBufferSize = 4096; const size_t kWriteBufferSize = 4096; -void DisconnectXmppClient(buzz::XmppClient* client) { - client->Disconnect(); -} - -} // namespace - namespace remoting { XmppSignalStrategy::XmppSignalStrategy( diff --git a/remoting/protocol/util.cc b/remoting/protocol/util.cc index 7b2ffe1..9b4b2bf 100644 --- a/remoting/protocol/util.cc +++ b/remoting/protocol/util.cc @@ -10,14 +10,6 @@ #include "net/base/io_buffer.h" #include "third_party/libjingle/source/talk/base/byteorder.h" -namespace { - -void DeleteMessage(google::protobuf::MessageLite* message) { - delete message; -} - -} // namespace - namespace remoting { namespace protocol { diff --git a/sync/internal_api/sync_manager_impl_unittest.cc b/sync/internal_api/sync_manager_impl_unittest.cc index acbe46f..51b6689 100644 --- a/sync/internal_api/sync_manager_impl_unittest.cc +++ b/sync/internal_api/sync_manager_impl_unittest.cc @@ -94,8 +94,6 @@ namespace { const char kTestChromeVersion[] = "test chrome version"; -void DoNothing() {} - void ExpectInt64Value(int64 expected_value, const DictionaryValue& value, const std::string& key) { std::string int64_str; diff --git a/ui/base/layout.cc b/ui/base/layout.cc index 4ae7805..84b3712 100644 --- a/ui/base/layout.cc +++ b/ui/base/layout.cc @@ -30,6 +30,7 @@ namespace { +#if defined(OS_WIN) || defined(USE_ASH) // Helper function that determines whether we want to optimize the UI for touch. bool UseTouchOptimizedUI() { // If --touch-optimized-ui is specified and not set to "auto", then override @@ -59,6 +60,7 @@ bool UseTouchOptimizedUI() { return false; #endif } +#endif // defined(OS_WIN) || defined(USE_ASH) const float kScaleFactorScales[] = {1.0f, 1.4f, 1.8f, 2.0f}; COMPILE_ASSERT(ui::NUM_SCALE_FACTORS == arraysize(kScaleFactorScales), diff --git a/ui/gfx/codec/jpeg_codec.cc b/ui/gfx/codec/jpeg_codec.cc index bfa47b9..1cfd68d 100644 --- a/ui/gfx/codec/jpeg_codec.cc +++ b/ui/gfx/codec/jpeg_codec.cc @@ -143,6 +143,7 @@ void TermDestination(jpeg_compress_struct* cinfo) { state->out->resize(state->image_buffer_used); } +#if !defined(JCS_EXTENSIONS) // Converts RGBA to RGB (removing the alpha values) to prepare to send data to // libjpeg. This converts one row of data in rgba with the given width in // pixels the the given rgb destination buffer (which should have enough space @@ -172,6 +173,7 @@ void BGRAtoRGB(const unsigned char* bgra, int pixel_width, unsigned char* rgb) pixel_out[2] = pixel_in[0]; } } +#endif // !defined(JCS_EXTENSIONS) // This class destroys the given jpeg_compress object when it goes out of // scope. It simplifies the error handling in Encode (and even applies to the @@ -393,6 +395,7 @@ void SkipInputData(j_decompress_ptr cinfo, long num_bytes) { void TermSource(j_decompress_ptr cinfo) { } +#if !defined(JCS_EXTENSIONS) // Converts one row of rgb data to rgba data by adding a fully-opaque alpha // value. void AddAlpha(const unsigned char* rgb, int pixel_width, unsigned char* rgba) { @@ -419,6 +422,7 @@ void RGBtoBGRA(const unsigned char* bgra, int pixel_width, unsigned char* rgb) pixel_out[3] = 0xff; } } +#endif // !defined(JCS_EXTENSIONS) // This class destroys the given jpeg_decompress object when it goes out of // scope. It simplifies the error handling in Decode (and even applies to the diff --git a/ui/gfx/render_text_unittest.cc b/ui/gfx/render_text_unittest.cc index fa3a6e9..447b02c 100644 --- a/ui/gfx/render_text_unittest.cc +++ b/ui/gfx/render_text_unittest.cc @@ -38,6 +38,7 @@ bool IndexInRange(const ui::Range& range, size_t index) { return index >= range.start() && index < range.end(); } +#if !defined(OS_MACOSX) // A test utility function to set the application default text direction. void SetRTL(bool rtl) { // Override the current locale/direction. @@ -48,6 +49,7 @@ void SetRTL(bool rtl) { #endif EXPECT_EQ(rtl, base::i18n::IsRTL()); } +#endif } // namespace diff --git a/webkit/fileapi/isolated_mount_point_provider.cc b/webkit/fileapi/isolated_mount_point_provider.cc index 8c5542c..084c93d 100644 --- a/webkit/fileapi/isolated_mount_point_provider.cc +++ b/webkit/fileapi/isolated_mount_point_provider.cc @@ -35,14 +35,6 @@ namespace fileapi { -namespace { - -IsolatedContext* isolated_context() { - return IsolatedContext::GetInstance(); -} - -} // namespace - IsolatedMountPointProvider::IsolatedMountPointProvider( const FilePath& profile_path) : profile_path_(profile_path), diff --git a/webkit/fileapi/local_file_system_operation_unittest.cc b/webkit/fileapi/local_file_system_operation_unittest.cc index 980e61b..6da4718 100644 --- a/webkit/fileapi/local_file_system_operation_unittest.cc +++ b/webkit/fileapi/local_file_system_operation_unittest.cc @@ -40,10 +40,6 @@ void AssertFileErrorEq(base::PlatformFileError expected, ASSERT_EQ(expected, actual); } -FilePath ASCIIToFilePath(const std::string& str) { - return FilePath().AppendASCII(str); -} - } // namespace (anonymous) // Test class for LocalFileSystemOperation. diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index 0c8d2da..95d55f0 100644 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -150,29 +150,6 @@ int next_page_id_ = 1; // Used to write a platform neutral file:/// URL by taking the // filename and its directory. (e.g., converts // "file:///tmp/foo/bar.txt" to just "bar.txt"). -std::string DescriptionSuitableForTestResult(const std::string& url) { - if (url.empty() || std::string::npos == url.find("file://")) - return url; - - size_t pos = url.rfind('/'); - if (pos == std::string::npos || pos == 0) - return "ERROR:" + url; - pos = url.rfind('/', pos - 1); - if (pos == std::string::npos) - return "ERROR:" + url; - - return url.substr(pos + 1); -} - -// Adds a file called "DRTFakeFile" to |data_object|. Use to fake dragging a -// file. -void AddDRTFakeFileToDataObject(WebDragData* drag_data) { - WebDragData::Item item; - item.storageType = WebDragData::Item::StorageTypeFilename; - item.filenameData = WebString::fromUTF8("DRTFakeFile"); - drag_data->addItem(item); -} - // Get a debugging string from a WebNavigationType. const char* WebNavigationTypeToString(WebNavigationType type) { switch (type) { @@ -199,46 +176,6 @@ std::string GetURLDescription(const GURL& url) { return url.possibly_invalid_spec(); } -std::string GetResponseDescription(const WebURLResponse& response) { - if (response.isNull()) - return "(null)"; - - const std::string url = GURL(response.url()).possibly_invalid_spec(); - return base::StringPrintf("<NSURLResponse %s, http status code %d>", - DescriptionSuitableForTestResult(url).c_str(), - response.httpStatusCode()); -} - -std::string GetErrorDescription(const WebURLError& error) { - std::string domain = UTF16ToASCII(error.domain); - int code = error.reason; - - if (domain == net::kErrorDomain) { - domain = "NSURLErrorDomain"; - switch (error.reason) { - case net::ERR_ABORTED: - code = -999; // NSURLErrorCancelled - break; - case net::ERR_UNSAFE_PORT: - // Our unsafe port checking happens at the network stack level, but we - // make this translation here to match the behavior of stock WebKit. - domain = "WebKitErrorDomain"; - code = 103; - break; - case net::ERR_ADDRESS_INVALID: - case net::ERR_ADDRESS_UNREACHABLE: - case net::ERR_NETWORK_ACCESS_DENIED: - code = -1004; // NSURLErrorCannotConnectToHost - break; - } - } else { - DLOG(WARNING) << "Unknown error domain"; - } - - return base::StringPrintf("<NSError domain %s, code %d, failing URL \"%s\">", - domain.c_str(), code, error.unreachableURL.spec().data()); -} - std::string GetNodeDescription(const WebNode& node, int exception) { if (exception) return "ERROR"; @@ -253,47 +190,6 @@ std::string GetNodeDescription(const WebNode& node, int exception) { return str; } -std::string GetRangeDescription(const WebRange& range) { - if (range.isNull()) - return "(null)"; - int exception = 0; - std::string str = "range from "; - int offset = range.startOffset(); - str.append(base::IntToString(offset)); - str.append(" of "); - WebNode container = range.startContainer(exception); - str.append(GetNodeDescription(container, exception)); - str.append(" to "); - offset = range.endOffset(); - str.append(base::IntToString(offset)); - str.append(" of "); - container = range.endContainer(exception); - str.append(GetNodeDescription(container, exception)); - return str; -} - -std::string GetEditingActionDescription(WebEditingAction action) { - switch (action) { - case WebKit::WebEditingActionTyped: - return "WebViewInsertActionTyped"; - case WebKit::WebEditingActionPasted: - return "WebViewInsertActionPasted"; - case WebKit::WebEditingActionDropped: - return "WebViewInsertActionDropped"; - } - return "(UNKNOWN ACTION)"; -} - -std::string GetTextAffinityDescription(WebTextAffinity affinity) { - switch (affinity) { - case WebKit::WebTextAffinityUpstream: - return "NSSelectionAffinityUpstream"; - case WebKit::WebTextAffinityDownstream: - return "NSSelectionAffinityDownstream"; - } - return "(UNKNOWN AFFINITY)"; -} - } // namespace // WebViewDelegate ----------------------------------------------------------- |