summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-03 09:00:08 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-03 09:00:08 +0000
commit9226938bf4ac6c1022240a62420f772449ac0520 (patch)
tree19c6fa13ba848e25e79a2636061b30e628630ed8
parent84d5741f988472efe7d1b206bc7b9d144e09d250 (diff)
downloadchromium_src-9226938bf4ac6c1022240a62420f772449ac0520.zip
chromium_src-9226938bf4ac6c1022240a62420f772449ac0520.tar.gz
chromium_src-9226938bf4ac6c1022240a62420f772449ac0520.tar.bz2
Cleanup: IWYU for BrowserThread.
BUG=none TEST=none Review URL: http://codereview.chromium.org/9558012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124852 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/browsing_data_remover.h1
-rw-r--r--chrome/browser/chromeos/login/login_performer.cc37
-rw-r--r--chrome/browser/extensions/extension_process_manager.cc16
-rw-r--r--chrome/browser/extensions/key_identifier_conversion_views.cc5
-rw-r--r--chrome/browser/prefs/pref_member.h5
-rw-r--r--chrome/browser/profiles/refcounted_profile_keyed_service_factory.cc1
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_blocking_page.h4
-rw-r--r--chrome/browser/sync/glue/non_frontend_data_type_controller.h2
-rw-r--r--chrome/browser/ui/cocoa/dock_icon.mm1
-rw-r--r--chrome/browser/ui/gtk/select_file_dialog_impl_kde.cc1
-rw-r--r--chrome/browser/web_applications/web_app_linux.cc1
-rw-r--r--chrome/browser/web_applications/web_app_win.cc1
-rw-r--r--content/browser/browser_thread_impl.cc8
-rw-r--r--content/browser/browser_thread_impl.h1
-rw-r--r--content/browser/download/drag_download_util.cc9
-rw-r--r--content/browser/in_process_webkit/indexed_db_quota_client.cc3
-rw-r--r--content/browser/power_save_blocker_win.cc3
-rw-r--r--content/public/browser/browser_thread.h7
18 files changed, 65 insertions, 41 deletions
diff --git a/chrome/browser/browsing_data_remover.h b/chrome/browser/browsing_data_remover.h
index f07fbf2..b54ef03 100644
--- a/chrome/browser/browsing_data_remover.h
+++ b/chrome/browser/browsing_data_remover.h
@@ -8,6 +8,7 @@
#include <set>
+#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
#include "base/message_loop_helpers.h"
#include "base/observer_list.h"
diff --git a/chrome/browser/chromeos/login/login_performer.cc b/chrome/browser/chromeos/login/login_performer.cc
index 2e4b7f8..ec814e9 100644
--- a/chrome/browser/chromeos/login/login_performer.cc
+++ b/chrome/browser/chromeos/login/login_performer.cc
@@ -11,6 +11,7 @@
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/metrics/histogram.h"
+#include "base/threading/thread_restrictions.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/boot_times_loader.h"
@@ -418,24 +419,24 @@ void LoginPerformer::ResolveInitialNetworkAuthFailure() {
void LoginPerformer::ResolveLockLoginFailure() {
if (last_login_failure_.reason() == LoginFailure::LOGIN_TIMED_OUT) {
- LOG(WARNING) << "Online login timed out - unlocking screen. "
- << "Granting user access based on offline auth only.";
- RequestScreenUnlock();
- return;
- } else if (last_login_failure_.reason() ==
- LoginFailure::NETWORK_AUTH_FAILED) {
- ResolveLockNetworkAuthFailure();
- return;
- } else if (last_login_failure_.reason() ==
- LoginFailure::COULD_NOT_MOUNT_CRYPTOHOME ||
- last_login_failure_.reason() ==
- LoginFailure::DATA_REMOVAL_FAILED) {
- LOG(ERROR) << "Cryptohome error, forcing sign out.";
- } else {
- // COULD_NOT_MOUNT_TMPFS, UNLOCK_FAILED should not happen here.
- NOTREACHED();
- }
- ScreenLocker::default_screen_locker()->Signout();
+ LOG(WARNING) << "Online login timed out - unlocking screen. "
+ << "Granting user access based on offline auth only.";
+ RequestScreenUnlock();
+ return;
+ } else if (last_login_failure_.reason() ==
+ LoginFailure::NETWORK_AUTH_FAILED) {
+ ResolveLockNetworkAuthFailure();
+ return;
+ } else if (last_login_failure_.reason() ==
+ LoginFailure::COULD_NOT_MOUNT_CRYPTOHOME ||
+ last_login_failure_.reason() ==
+ LoginFailure::DATA_REMOVAL_FAILED) {
+ LOG(ERROR) << "Cryptohome error, forcing sign out.";
+ } else {
+ // COULD_NOT_MOUNT_TMPFS, UNLOCK_FAILED should not happen here.
+ NOTREACHED();
+ }
+ ScreenLocker::default_screen_locker()->Signout();
}
void LoginPerformer::ResolveLockNetworkAuthFailure() {
diff --git a/chrome/browser/extensions/extension_process_manager.cc b/chrome/browser/extensions/extension_process_manager.cc
index f249cf4..73651f1 100644
--- a/chrome/browser/extensions/extension_process_manager.cc
+++ b/chrome/browser/extensions/extension_process_manager.cc
@@ -4,18 +4,15 @@
#include "base/bind.h"
#include "base/command_line.h"
-#include "chrome/browser/extensions/extension_process_manager.h"
-
+#include "base/lazy_instance.h"
#include "chrome/browser/extensions/extension_event_router.h"
-#include "chrome/browser/ui/browser_window.h"
-#if defined(OS_MACOSX)
-#include "chrome/browser/extensions/extension_host_mac.h"
-#endif
+#include "chrome/browser/extensions/extension_process_manager.h"
#include "chrome/browser/extensions/extension_host.h"
#include "chrome/browser/extensions/extension_info_map.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_window.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_view_type.h"
@@ -30,6 +27,10 @@
#include "content/public/browser/web_contents.h"
#include "content/public/common/renderer_preferences.h"
+#if defined(OS_MACOSX)
+#include "chrome/browser/extensions/extension_host_mac.h"
+#endif
+
using content::BrowserThread;
using content::OpenURLParams;
using content::Referrer;
@@ -263,7 +264,6 @@ ExtensionHost* ExtensionProcessManager::GetBackgroundHostForExtension(
return host;
}
return NULL;
-
}
std::set<RenderViewHost*>
@@ -332,7 +332,7 @@ int ExtensionProcessManager::DecrementLazyKeepaliveCount(
return 0;
int& count = ::GetLazyKeepaliveCount(GetProfile(), extension);
- DCHECK(count > 0);
+ DCHECK_GT(count, 0);
if (--count == 0)
OnLazyBackgroundPageIdle(extension->id());
diff --git a/chrome/browser/extensions/key_identifier_conversion_views.cc b/chrome/browser/extensions/key_identifier_conversion_views.cc
index c471f38..36dfd89 100644
--- a/chrome/browser/extensions/key_identifier_conversion_views.cc
+++ b/chrome/browser/extensions/key_identifier_conversion_views.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -6,8 +6,11 @@
#include <string.h>
+#include <utility>
+
#include "base/basictypes.h"
#include "base/hash_tables.h"
+#include "base/logging.h"
#include "content/public/browser/browser_thread.h"
#include "ui/base/keycodes/keyboard_codes.h"
#include "ui/views/events/event.h"
diff --git a/chrome/browser/prefs/pref_member.h b/chrome/browser/prefs/pref_member.h
index 38c785a..d97438b 100644
--- a/chrome/browser/prefs/pref_member.h
+++ b/chrome/browser/prefs/pref_member.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
//
@@ -29,6 +29,7 @@
#include "base/basictypes.h"
#include "base/file_path.h"
+#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/values.h"
#include "content/public/browser/browser_thread.h"
@@ -115,8 +116,8 @@ class PrefMemberBase : public content::NotificationObserver {
virtual Internal* internal() const = 0;
- // Ordered the members to compact the class instance.
private:
+ // Ordered the members to compact the class instance.
std::string pref_name_;
content::NotificationObserver* observer_;
PrefService* prefs_;
diff --git a/chrome/browser/profiles/refcounted_profile_keyed_service_factory.cc b/chrome/browser/profiles/refcounted_profile_keyed_service_factory.cc
index 56a273a..8bf694c 100644
--- a/chrome/browser/profiles/refcounted_profile_keyed_service_factory.cc
+++ b/chrome/browser/profiles/refcounted_profile_keyed_service_factory.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/profiles/refcounted_profile_keyed_service_factory.h"
+#include "base/logging.h"
#include "chrome/browser/profiles/profile_keyed_service.h"
#include "chrome/browser/profiles/refcounted_profile_keyed_service.h"
#include "content/public/browser/browser_thread.h"
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.h b/chrome/browser/safe_browsing/safe_browsing_blocking_page.h
index 2cd68e9..fe574a8 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.h
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
//
@@ -30,8 +30,10 @@
#pragma once
#include <map>
+#include <string>
#include <vector>
+#include "base/gtest_prod_util.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "content/public/browser/interstitial_page_delegate.h"
#include "googleurl/src/gurl.h"
diff --git a/chrome/browser/sync/glue/non_frontend_data_type_controller.h b/chrome/browser/sync/glue/non_frontend_data_type_controller.h
index 7a357e7..28acfd1 100644
--- a/chrome/browser/sync/glue/non_frontend_data_type_controller.h
+++ b/chrome/browser/sync/glue/non_frontend_data_type_controller.h
@@ -12,6 +12,7 @@
#include "base/callback_forward.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
+#include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event.h"
#include "chrome/browser/sync/glue/data_type_controller.h"
#include "chrome/browser/sync/glue/data_type_error_handler.h"
@@ -59,6 +60,7 @@ class NonFrontendDataTypeController : public DataTypeController {
virtual void OnSingleDatatypeUnrecoverableError(
const tracked_objects::Location& from_here,
const std::string& message) OVERRIDE;
+
protected:
// For testing only.
NonFrontendDataTypeController();
diff --git a/chrome/browser/ui/cocoa/dock_icon.mm b/chrome/browser/ui/cocoa/dock_icon.mm
index 9fe0316..7e86cdf 100644
--- a/chrome/browser/ui/cocoa/dock_icon.mm
+++ b/chrome/browser/ui/cocoa/dock_icon.mm
@@ -4,6 +4,7 @@
#import "chrome/browser/ui/cocoa/dock_icon.h"
+#include "base/logging.h"
#include "base/mac/bundle_locations.h"
#include "base/memory/scoped_nsobject.h"
#include "content/public/browser/browser_thread.h"
diff --git a/chrome/browser/ui/gtk/select_file_dialog_impl_kde.cc b/chrome/browser/ui/gtk/select_file_dialog_impl_kde.cc
index 098b878..548c5f9 100644
--- a/chrome/browser/ui/gtk/select_file_dialog_impl_kde.cc
+++ b/chrome/browser/ui/gtk/select_file_dialog_impl_kde.cc
@@ -13,6 +13,7 @@
#include "base/process_util.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
+#include "base/threading/thread_restrictions.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/ui/gtk/select_file_dialog_impl.h"
#include "content/public/browser/browser_thread.h"
diff --git a/chrome/browser/web_applications/web_app_linux.cc b/chrome/browser/web_applications/web_app_linux.cc
index 62a7678..f9a21d1 100644
--- a/chrome/browser/web_applications/web_app_linux.cc
+++ b/chrome/browser/web_applications/web_app_linux.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/web_applications/web_app.h"
#include "base/environment.h"
+#include "base/logging.h"
#include "content/public/browser/browser_thread.h"
namespace web_app {
diff --git a/chrome/browser/web_applications/web_app_win.cc b/chrome/browser/web_applications/web_app_win.cc
index e8a04e4..6e076b9 100644
--- a/chrome/browser/web_applications/web_app_win.cc
+++ b/chrome/browser/web_applications/web_app_win.cc
@@ -8,6 +8,7 @@
#include "base/command_line.h"
#include "base/file_util.h"
+#include "base/logging.h"
#include "base/md5.h"
#include "base/path_service.h"
#include "base/stringprintf.h"
diff --git a/content/browser/browser_thread_impl.cc b/content/browser/browser_thread_impl.cc
index 19905a5..590ab15 100644
--- a/content/browser/browser_thread_impl.cc
+++ b/content/browser/browser_thread_impl.cc
@@ -4,6 +4,8 @@
#include "content/browser/browser_thread_impl.h"
+#include <string>
+
#include "base/atomicops.h"
#include "base/bind.h"
#include "base/compiler_specific.h"
@@ -12,6 +14,7 @@
#include "base/message_loop_proxy.h"
#include "base/threading/sequenced_worker_pool.h"
#include "base/threading/thread_restrictions.h"
+#include "content/public/browser/browser_thread_delegate.h"
namespace content {
@@ -32,10 +35,9 @@ static const char* g_browser_thread_names[BrowserThread::ID_COUNT] = {
struct BrowserThreadGlobals {
BrowserThreadGlobals()
: blocking_pool(new base::SequencedWorkerPool(3, "BrowserBlocking")) {
- memset(threads, 0,
- BrowserThread::ID_COUNT * sizeof(BrowserThreadImpl*));
+ memset(threads, 0, BrowserThread::ID_COUNT * sizeof(threads[0]));
memset(thread_delegates, 0,
- BrowserThread::ID_COUNT * sizeof(BrowserThreadDelegate*));
+ BrowserThread::ID_COUNT * sizeof(thread_delegates[0]));
}
// This lock protects |threads|. Do not read or modify that array
diff --git a/content/browser/browser_thread_impl.h b/content/browser/browser_thread_impl.h
index 5650179..95a1650 100644
--- a/content/browser/browser_thread_impl.h
+++ b/content/browser/browser_thread_impl.h
@@ -6,7 +6,6 @@
#define CONTENT_BROWSER_BROWSER_THREAD_IMPL_H_
#pragma once
-#include "base/synchronization/lock.h"
#include "base/threading/thread.h"
#include "content/common/content_export.h"
#include "content/public/browser/browser_thread.h"
diff --git a/content/browser/download/drag_download_util.cc b/content/browser/download/drag_download_util.cc
index aefaed296..b68ca16 100644
--- a/content/browser/download/drag_download_util.cc
+++ b/content/browser/download/drag_download_util.cc
@@ -4,12 +4,15 @@
#include "content/browser/download/drag_download_util.h"
+#include <string>
+
#include "base/bind.h"
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
+#include "base/threading/thread_restrictions.h"
#include "base/utf_string_conversions.h"
#include "content/public/browser/browser_thread.h"
#include "googleurl/src/gurl.h"
@@ -66,11 +69,11 @@ FileStream* CreateFileStreamForDrop(FilePath* file_path, net::NetLog* net_log) {
if (seq == 0) {
new_file_path = *file_path;
} else {
- #if defined(OS_WIN)
+#if defined(OS_WIN)
string16 suffix = ASCIIToUTF16("-") + base::IntToString16(seq);
- #else
+#else
std::string suffix = std::string("-") + base::IntToString(seq);
- #endif
+#endif
new_file_path = file_path->InsertBeforeExtension(suffix);
}
diff --git a/content/browser/in_process_webkit/indexed_db_quota_client.cc b/content/browser/in_process_webkit/indexed_db_quota_client.cc
index f4a3bce..cdda687 100644
--- a/content/browser/in_process_webkit/indexed_db_quota_client.cc
+++ b/content/browser/in_process_webkit/indexed_db_quota_client.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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,6 +7,7 @@
#include <vector>
#include "base/file_util.h"
+#include "base/logging.h"
#include "base/message_loop_proxy.h"
#include "content/browser/in_process_webkit/indexed_db_context_impl.h"
#include "content/public/browser/browser_thread.h"
diff --git a/content/browser/power_save_blocker_win.cc b/content/browser/power_save_blocker_win.cc
index 98df4de..708cc68 100644
--- a/content/browser/power_save_blocker_win.cc
+++ b/content/browser/power_save_blocker_win.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -6,6 +6,7 @@
#include <windows.h>
+#include "base/logging.h"
#include "content/public/browser/browser_thread.h"
using content::BrowserThread;
diff --git a/content/public/browser/browser_thread.h b/content/public/browser/browser_thread.h
index 61b377d..9187592 100644
--- a/content/public/browser/browser_thread.h
+++ b/content/public/browser/browser_thread.h
@@ -6,12 +6,14 @@
#define CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_
#pragma once
+#include <string>
+
#include "base/basictypes.h"
#include "base/callback.h"
+#include "base/location.h"
#include "base/message_loop_proxy.h"
-#include "base/tracked_objects.h"
+#include "base/time.h"
#include "content/common/content_export.h"
-#include "content/public/browser/browser_thread_delegate.h"
#if defined(UNIT_TEST)
#include "base/logging.h"
@@ -26,6 +28,7 @@ class Thread;
namespace content {
+class BrowserThreadDelegate;
class BrowserThreadImpl;
///////////////////////////////////////////////////////////////////////////////