diff options
author | deanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-19 15:58:55 +0000 |
---|---|---|
committer | deanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-19 15:58:55 +0000 |
commit | 23afa0fbdf77203d6ff57394ed0e2c1c3195b2bd (patch) | |
tree | 06e451dc4618209dff5ac0cc14d7cd4be0e58374 /chrome/browser | |
parent | c45b0b4811d594009e988ecf9eb5b6da55e7f5df (diff) | |
download | chromium_src-23afa0fbdf77203d6ff57394ed0e2c1c3195b2bd.zip chromium_src-23afa0fbdf77203d6ff57394ed0e2c1c3195b2bd.tar.gz chromium_src-23afa0fbdf77203d6ff57394ed0e2c1c3195b2bd.tar.bz2 |
Build a bunch more of chrome/ on Linux.
Patch from Pawel Hajdan Jr.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2408 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/SConscript | 32 | ||||
-rw-r--r-- | chrome/browser/browser_process.h | 2 | ||||
-rw-r--r-- | chrome/browser/cancelable_request.h | 11 | ||||
-rw-r--r-- | chrome/browser/cross_site_request_manager.h | 2 | ||||
-rw-r--r-- | chrome/browser/google_url_tracker.cc | 8 | ||||
-rw-r--r-- | chrome/browser/meta_table_helper.cc | 2 | ||||
-rw-r--r-- | chrome/browser/metrics_log.h | 10 | ||||
-rw-r--r-- | chrome/browser/metrics_response_unittest.cc | 4 | ||||
-rw-r--r-- | chrome/browser/metrics_service.h | 2 | ||||
-rw-r--r-- | chrome/browser/page_state.cc | 14 | ||||
-rw-r--r-- | chrome/browser/printing/page_number.h | 6 | ||||
-rw-r--r-- | chrome/browser/printing/page_range_unittest.cc | 4 | ||||
-rw-r--r-- | chrome/browser/printing/units_unittest.cc | 3 | ||||
-rw-r--r-- | chrome/browser/renderer_security_policy.cc | 2 | ||||
-rw-r--r-- | chrome/browser/renderer_security_policy.h | 2 | ||||
-rw-r--r-- | chrome/browser/session_startup_pref.cc | 5 |
16 files changed, 53 insertions, 56 deletions
diff --git a/chrome/browser/SConscript b/chrome/browser/SConscript index 14965ed..71d4fd3 100644 --- a/chrome/browser/SConscript +++ b/chrome/browser/SConscript @@ -60,13 +60,28 @@ input_files = [] if env['PLATFORM'] in ('posix', 'win32'): # TODO: Port to Mac. input_files.extend([ + 'browser_process.cc', + 'cancelable_request.cc', + 'chrome_thread.cc', + 'cross_site_request_manager.cc', + 'google_url_tracker.cc', + 'google_util.cc', + 'meta_table_helper.cc', + 'metrics_response.cc', + 'net/dns_host_info.cc', + 'page_state.cc', + 'printing/page_number.cc', 'printing/page_setup.cc', + 'printing/page_range.cc', 'printing/units.cc', - 'net/dns_host_info.cc', + 'renderer_security_policy.cc', 'safe_browsing/bloom_filter.cc', 'safe_browsing/chunk_range.cc', 'safe_browsing/protocol_parser.cc', 'safe_browsing/safe_browsing_util.cc', + 'session_startup_pref.cc', + 'url_fetcher_protect.cc', + 'user_metrics.cc', ]) if env['PLATFORM'] == 'win32': @@ -105,7 +120,6 @@ if env['PLATFORM'] == 'win32': 'browser_list.cc', 'browser_main.cc', 'browser_prefs.cc', - 'browser_process.cc', 'browser_process_impl.cc', 'browser_shutdown.cc', 'browser_url_handler.cc', @@ -113,14 +127,11 @@ if env['PLATFORM'] == 'win32': 'browsing_data_remover.cc', 'browsing_instance.cc', 'cache_manager_host.cc', - 'cancelable_request.cc', 'cert_store.cc', 'character_encoding.cc', 'chrome_plugin_browsing_context.cc', 'chrome_plugin_host.cc', - 'chrome_thread.cc', 'controller.cc', - 'cross_site_request_manager.cc', 'dom_ui/chrome_url_data_manager.cc', 'dom_ui/dom_ui_host.cc', 'dom_ui/html_dialog_contents.cc', @@ -148,8 +159,6 @@ if env['PLATFORM'] == 'win32': 'frame_util.cc', 'frame_view.cc', 'gears_integration.cc', - 'google_url_tracker.cc', - 'google_util.cc', 'hang_monitor/hung_plugin_action.cc', 'hang_monitor/hung_window_detector.cc', 'history/archived_database.cc', @@ -187,9 +196,7 @@ if env['PLATFORM'] == 'win32': 'jsmessage_box_handler.cc', 'login_prompt.cc', 'memory_details.cc', - 'meta_table_helper.cc', 'metrics_log.cc', - 'metrics_response.cc', 'metrics_service.cc', 'modal_html_dialog_delegate.cc', 'mork_reader.cc', @@ -202,16 +209,13 @@ if env['PLATFORM'] == 'win32': 'network_status_view.cc', 'google_update.cc', 'page_info_window.cc', - 'page_state.cc', 'password_form_manager.cc', 'password_manager.cc', 'plugin_installer.cc', 'plugin_process_host.cc', 'plugin_service.cc', 'point_buffer.cc', - 'printing/page_number.cc', 'printing/page_overlays.cc', - 'printing/page_range.cc', 'printing/print_job.cc', 'printing/print_job_manager.cc', 'printing/print_job_worker.cc', @@ -232,7 +236,6 @@ if env['PLATFORM'] == 'win32': 'render_widget_helper.cc', 'render_widget_host.cc', 'render_widget_host_hwnd.cc', - 'renderer_security_policy.cc', 'repost_Form_warning_dialog.cc', 'resource_dispatcher_host.cc', 'resource_message_filter.cc', @@ -251,7 +254,6 @@ if env['PLATFORM'] == 'win32': 'session_crashed_view.cc', 'session_restore.cc', 'session_service.cc', - 'session_startup_pref.cc', 'shell_integration.cc', 'simple_vista_frame.cc', 'simple_xp_frame.cc', @@ -287,10 +289,8 @@ if env['PLATFORM'] == 'win32': 'title_chomper.cc', 'toolbar_model.cc', 'url_fetcher.cc', - 'url_fetcher_protect.cc', 'url_fixer_upper.cc', 'user_data_dir_dialog.cc', - 'user_metrics.cc', 'view_source_contents.cc', 'visitedlink_master.cc', 'vista_frame.cc', diff --git a/chrome/browser/browser_process.h b/chrome/browser/browser_process.h index 908af1a..16301e6 100644 --- a/chrome/browser/browser_process.h +++ b/chrome/browser/browser_process.h @@ -124,8 +124,10 @@ class BrowserProcess { // TODO(beng): remove once XPFrame/VistaFrame are gone. virtual bool IsUsingNewFrames() = 0; +#if defined(OS_WIN) // Returns an event that is signaled when the browser shutdown. virtual HANDLE shutdown_event() = 0; +#endif private: DISALLOW_EVIL_CONSTRUCTORS(BrowserProcess); diff --git a/chrome/browser/cancelable_request.h b/chrome/browser/cancelable_request.h index df77476..8513bcb 100644 --- a/chrome/browser/cancelable_request.h +++ b/chrome/browser/cancelable_request.h @@ -237,7 +237,7 @@ class CancelableRequestConsumerT : public CancelableRequestConsumerBase { // Cancels all requests outstanding. void CancelAllRequests() { PendingRequestList copied_requests(pending_requests_); - for (PendingRequestList::iterator i = copied_requests.begin(); + for (typename PendingRequestList::iterator i = copied_requests.begin(); i != copied_requests.end(); ++i) i->first.provider->CancelRequest(i->first.handle); copied_requests.clear(); @@ -249,7 +249,7 @@ class CancelableRequestConsumerT : public CancelableRequestConsumerBase { // Gets the client data for all pending requests. void GetAllClientData(std::vector<T>* data) { DCHECK(data); - for (PendingRequestList::iterator i = pending_requests_.begin(); + for (typename PendingRequestList::iterator i = pending_requests_.begin(); i != pending_requests_.end(); ++i) data->push_back(i->second); } @@ -282,7 +282,7 @@ class CancelableRequestConsumerT : public CancelableRequestConsumerBase { virtual void OnRequestRemoved(CancelableRequestProvider* provider, CancelableRequestProvider::Handle handle) { - PendingRequestList::iterator i = + typename PendingRequestList::iterator i = pending_requests_.find(PendingRequest(provider, handle)); if (i == pending_requests_.end()) { NOTREACHED() << "Got a complete notification for a nonexistant request"; @@ -517,8 +517,9 @@ class CancelableRequest : public CancelableRequestBase { template<typename CB, typename Type> class CancelableRequest1 : public CancelableRequest<CB> { public: - explicit CancelableRequest1(CallbackType* callback) - : CancelableRequest(callback) { + explicit CancelableRequest1( + typename CancelableRequest<CB>::CallbackType* callback) + : CancelableRequest<CB>(callback) { } virtual ~CancelableRequest1() { diff --git a/chrome/browser/cross_site_request_manager.h b/chrome/browser/cross_site_request_manager.h index 09f3a7a..d7bf0b4 100644 --- a/chrome/browser/cross_site_request_manager.h +++ b/chrome/browser/cross_site_request_manager.h @@ -34,7 +34,7 @@ class CrossSiteRequestManager { bool has_pending); private: - friend DefaultSingletonTraits<CrossSiteRequestManager>; + friend struct DefaultSingletonTraits<CrossSiteRequestManager>; typedef std::set<std::pair<int, int> > RenderViewSet; // Obtain an instance of CrossSiteRequestManager via diff --git a/chrome/browser/google_url_tracker.cc b/chrome/browser/google_url_tracker.cc index 6bab5ec..6dfdbd6 100644 --- a/chrome/browser/google_url_tracker.cc +++ b/chrome/browser/google_url_tracker.cc @@ -4,6 +4,7 @@ #include "chrome/browser/google_url_tracker.h" +#include "base/compiler_specific.h" #include "base/string_util.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profile.h" @@ -15,10 +16,9 @@ const char GoogleURLTracker::kDefaultGoogleHomepage[] = "http://www.google.com/"; GoogleURLTracker::GoogleURLTracker() - : google_url_(g_browser_process->local_state()->GetString( - prefs::kLastKnownGoogleURL)), -#pragma warning(suppress: 4355) // Okay to pass "this" here. - fetcher_factory_(this), + : google_url_(WideToUTF8(g_browser_process->local_state()->GetString( + prefs::kLastKnownGoogleURL))), + ALLOW_THIS_IN_INITIALIZER_LIST(fetcher_factory_(this)), in_startup_sleep_(true), already_fetched_(false), need_to_fetch_(false), diff --git a/chrome/browser/meta_table_helper.cc b/chrome/browser/meta_table_helper.cc index 2e607d5..0e17963 100644 --- a/chrome/browser/meta_table_helper.cc +++ b/chrome/browser/meta_table_helper.cc @@ -4,8 +4,6 @@ #include "chrome/browser/meta_table_helper.h" -#include <windows.h> - #include "base/logging.h" #include "base/string_util.h" #include "chrome/common/sqlite_utils.h" diff --git a/chrome/browser/metrics_log.h b/chrome/browser/metrics_log.h index 1c02371..657c8d7 100644 --- a/chrome/browser/metrics_log.h +++ b/chrome/browser/metrics_log.h @@ -53,11 +53,11 @@ class MetricsLog { // url - which URL was loaded // origin - what kind of action initiated the load // load_time - how long it took to load the page - void MetricsLog::RecordLoadEvent(int window_id, - const GURL& url, - PageTransition::Type origin, - int session_index, - TimeDelta load_time); + void RecordLoadEvent(int window_id, + const GURL& url, + PageTransition::Type origin, + int session_index, + TimeDelta load_time); // Records the current operating environment. Takes the list of installed // plugins as a parameter because that can't be obtained synchronously diff --git a/chrome/browser/metrics_response_unittest.cc b/chrome/browser/metrics_response_unittest.cc index 4e6dae6..e7c5825 100644 --- a/chrome/browser/metrics_response_unittest.cc +++ b/chrome/browser/metrics_response_unittest.cc @@ -76,7 +76,7 @@ static const struct ResponseCase { }; TEST(MetricsResponseTest, ParseResponse) { - for (int i = 0; i < arraysize(response_cases); ++i) { + for (size_t i = 0; i < arraysize(response_cases); ++i) { ResponseCase rcase = response_cases[i]; MetricsResponse response(rcase.response_xml); EXPECT_TRUE(response.valid()); @@ -101,7 +101,7 @@ TEST(MetricsResponseTest, ParseResponse) { static const char* bogus_responses[] = {"", "<respo"}; TEST(MetricsResponseTest, ParseBogusResponse) { - for (int i = 0; i < arraysize(bogus_responses); ++i) { + for (size_t i = 0; i < arraysize(bogus_responses); ++i) { MetricsResponse response(bogus_responses[i]); EXPECT_FALSE(response.valid()); } diff --git a/chrome/browser/metrics_service.h b/chrome/browser/metrics_service.h index bda5d1b..a4d8caf 100644 --- a/chrome/browser/metrics_service.h +++ b/chrome/browser/metrics_service.h @@ -156,7 +156,7 @@ class MetricsService : public NotificationObserver, // Save the pending_log_text_ persistently in a pref for transmission when we // next run. Note that IF this text is "too large," we just dicard it. - void MetricsService::PushPendingLogTextToUnsentOngoingLogs(); + void PushPendingLogTextToUnsentOngoingLogs(); // Start timer for next log transmission. void StartLogTransmissionTimer(); diff --git a/chrome/browser/page_state.cc b/chrome/browser/page_state.cc index 2b0c366..e0c350f 100644 --- a/chrome/browser/page_state.cc +++ b/chrome/browser/page_state.cc @@ -77,31 +77,25 @@ bool PageState::GetProperty(const std::wstring& key, std::wstring* value) const } void PageState::SetInt64Property(const std::wstring& key, int64 value) { - wchar_t buff[64]; - _i64tow_s(value, buff, arraysize(buff), 10); - SetProperty(key, buff); + SetProperty(key, Int64ToWString(value)); } bool PageState::GetInt64Property(const std::wstring& key, int64* value) const { std::wstring v; if (GetProperty(key, &v)) { - *value = _wtoi64(v.c_str()); - return true; + return StringToInt64(v, value); } return false; } void PageState::SetIntProperty(const std::wstring& key, int value) { - wchar_t buff[64]; - _itow_s(value, buff, arraysize(buff), 10); - SetProperty(key, buff); + SetProperty(key, IntToWString(value)); } bool PageState::GetIntProperty(const std::wstring& key, int* value) const { std::wstring v; if (GetProperty(key, &v)) { - *value = _wtoi(v.c_str()); - return true; + return StringToInt(v, value); } return false; } diff --git a/chrome/browser/printing/page_number.h b/chrome/browser/printing/page_number.h index 6042869..2782824 100644 --- a/chrome/browser/printing/page_number.h +++ b/chrome/browser/printing/page_number.h @@ -5,9 +5,7 @@ #ifndef CHROME_BROWSER_PRINTING_PAGE_NUMBER_H__ #define CHROME_BROWSER_PRINTING_PAGE_NUMBER_H__ -#ifdef _DEBUG #include <ostream> -#endif #include "chrome/browser/printing/page_range.h" @@ -65,8 +63,8 @@ class PageNumber { // Debug output support. template<class E, class T> -inline std::basic_ostream<E,T>& operator<<(std::basic_ostream<E,T>& ss, - const PageNumber& page) { +inline typename std::basic_ostream<E,T>& operator<<( + typename std::basic_ostream<E,T>& ss, const PageNumber& page) { return ss << page.ToInt(); } diff --git a/chrome/browser/printing/page_range_unittest.cc b/chrome/browser/printing/page_range_unittest.cc index ca404d8..d7a8d3f 100644 --- a/chrome/browser/printing/page_range_unittest.cc +++ b/chrome/browser/printing/page_range_unittest.cc @@ -18,7 +18,7 @@ TEST(PageRangeTest, RangeMerge) { range.to = 5; ranges.push_back(range); std::vector<int> pages(printing::PageRange::GetPages(ranges)); - ASSERT_EQ(8, pages.size()); + ASSERT_EQ(8U, pages.size()); EXPECT_EQ(1, pages[0]); EXPECT_EQ(2, pages[1]); EXPECT_EQ(3, pages[2]); @@ -32,6 +32,6 @@ TEST(PageRangeTest, RangeMerge) { TEST(PageRangeTest, Empty) { printing::PageRanges ranges; std::vector<int> pages(printing::PageRange::GetPages(ranges)); - EXPECT_EQ(0, pages.size()); + EXPECT_EQ(0U, pages.size()); } diff --git a/chrome/browser/printing/units_unittest.cc b/chrome/browser/printing/units_unittest.cc index 1adc931..ff85cb6 100644 --- a/chrome/browser/printing/units_unittest.cc +++ b/chrome/browser/printing/units_unittest.cc @@ -33,7 +33,8 @@ TEST(UnitsTest, Convertions) { EXPECT_EQ(0, ConvertUnit(2, 1000000000, 1)); EXPECT_EQ(2000000000, ConvertUnit(2, 1, 1000000000)); - EXPECT_EQ(4000000000, ConvertUnit(2, 1, 2000000000)); + EXPECT_EQ(4000000000U, + static_cast<unsigned int>(ConvertUnit(2, 1, 2000000000))); EXPECT_EQ(100, ConvertUnitDouble(100, 100, 100)); EXPECT_EQ(-100, ConvertUnitDouble(-100, 100, 100)); diff --git a/chrome/browser/renderer_security_policy.cc b/chrome/browser/renderer_security_policy.cc index 2bfb7ea..f72848a 100644 --- a/chrome/browser/renderer_security_policy.cc +++ b/chrome/browser/renderer_security_policy.cc @@ -72,7 +72,7 @@ class RendererSecurityPolicy::SecurityState { bool has_dom_ui_bindings_; - DISALLOW_EVIL_CONSTRUCTORS(RendererSecurityPolicy::SecurityState); + DISALLOW_COPY_AND_ASSIGN(SecurityState); }; RendererSecurityPolicy::RendererSecurityPolicy() { diff --git a/chrome/browser/renderer_security_policy.h b/chrome/browser/renderer_security_policy.h index 35492e4..86d1e73 100644 --- a/chrome/browser/renderer_security_policy.h +++ b/chrome/browser/renderer_security_policy.h @@ -94,7 +94,7 @@ class RendererSecurityPolicy { // Obtain an instance of RendererSecurityPolicy via GetInstance(). RendererSecurityPolicy(); - friend DefaultSingletonTraits<RendererSecurityPolicy>; + friend struct DefaultSingletonTraits<RendererSecurityPolicy>; // You must acquire this lock before reading or writing any members of this // class. You must not block while holding this lock. diff --git a/chrome/browser/session_startup_pref.cc b/chrome/browser/session_startup_pref.cc index a261983..d99043d 100644 --- a/chrome/browser/session_startup_pref.cc +++ b/chrome/browser/session_startup_pref.cc @@ -37,6 +37,9 @@ void SessionStartupPref::SetStartupPref(PrefService* prefs, case URLS: type = 4; break; + + default: + break; } prefs->SetInteger(prefs::kRestoreOnStartup, type); @@ -86,7 +89,7 @@ SessionStartupPref SessionStartupPref::GetStartupPref(PrefService* prefs) { if (url_pref_list->Get(i, &value)) { std::wstring url_text; if (value->GetAsString(&url_text)) - pref.urls.push_back(GURL(url_text)); + pref.urls.push_back(GURL(WideToUTF8(url_text))); } } |