Skip to content

Commit

Permalink
Revert everything related to the relanding.
Browse files Browse the repository at this point in the history
Review URL: http://codereview.chromium.org/2982009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52367 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
erg@chromium.org committed Jul 14, 2010
1 parent f56e694 commit 8efa680
Show file tree
Hide file tree
Showing 70 changed files with 76 additions and 111 deletions.
1 change: 0 additions & 1 deletion app/animation_container_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "app/animation_container.h"
#include "app/linear_animation.h"
#include "app/test_animation_delegate.h"
#include "base/scoped_ptr.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

Expand Down
1 change: 0 additions & 1 deletion app/slide_animation_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "app/slide_animation.h"
#include "app/test_animation_delegate.h"
#include "base/scoped_ptr.h"
#include "testing/gtest/include/gtest/gtest.h"

class SlideAnimationTest: public testing::Test {
Expand Down
79 changes: 39 additions & 40 deletions base/message_loop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <algorithm>

#include "base/compiler_specific.h"
#include "base/histogram.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/message_pump_default.h"
Expand All @@ -28,53 +27,22 @@
using base::Time;
using base::TimeDelta;

namespace {

// A lazily created thread local storage for quick access to a thread's message
// loop, if one exists. This should be safe and free of static constructors.
base::LazyInstance<base::ThreadLocalPointer<MessageLoop> > lazy_tls_ptr(
static base::LazyInstance<base::ThreadLocalPointer<MessageLoop> > lazy_tls_ptr(
base::LINKER_INITIALIZED);

//------------------------------------------------------------------------------

// Logical events for Histogram profiling. Run with -message-loop-histogrammer
// to get an accounting of messages and actions taken on each thread.
const int kTaskRunEvent = 0x1;
const int kTimerEvent = 0x2;
static const int kTaskRunEvent = 0x1;
static const int kTimerEvent = 0x2;

// Provide range of message IDs for use in histogramming and debug display.
const int kLeastNonZeroMessageId = 1;
const int kMaxMessageId = 1099;
const int kNumberOfDistinctMessagesDisplayed = 1100;

// Provide a macro that takes an expression (such as a constant, or macro
// constant) and creates a pair to initalize an array of pairs. In this case,
// our pair consists of the expressions value, and the "stringized" version
// of the expression (i.e., the exrpression put in quotes). For example, if
// we have:
// #define FOO 2
// #define BAR 5
// then the following:
// VALUE_TO_NUMBER_AND_NAME(FOO + BAR)
// will expand to:
// {7, "FOO + BAR"}
// We use the resulting array as an argument to our histogram, which reads the
// number as a bucket identifier, and proceeds to use the corresponding name
// in the pair (i.e., the quoted string) when printing out a histogram.
#define VALUE_TO_NUMBER_AND_NAME(name) {name, #name},

const LinearHistogram::DescriptionPair event_descriptions_[] = {
// Provide some pretty print capability in our histogram for our internal
// messages.

// A few events we handle (kindred to messages), and used to profile actions.
VALUE_TO_NUMBER_AND_NAME(kTaskRunEvent)
VALUE_TO_NUMBER_AND_NAME(kTimerEvent)

{-1, NULL} // The list must be null terminated, per API to histogram.
};

bool enable_histogrammer_ = false;

} // namespace
static const int kLeastNonZeroMessageId = 1;
static const int kMaxMessageId = 1099;
static const int kNumberOfDistinctMessagesDisplayed = 1100;

//------------------------------------------------------------------------------

Expand Down Expand Up @@ -598,6 +566,9 @@ bool MessageLoop::PendingTask::operator<(const PendingTask& other) const {
// Method and data for histogramming events and actions taken by each instance
// on each thread.

// static
bool MessageLoop::enable_histogrammer_ = false;

// static
void MessageLoop::EnableHistogrammer(bool enable) {
enable_histogrammer_ = enable;
Expand All @@ -620,6 +591,34 @@ void MessageLoop::HistogramEvent(int event) {
message_histogram_->Add(event);
}

// Provide a macro that takes an expression (such as a constant, or macro
// constant) and creates a pair to initalize an array of pairs. In this case,
// our pair consists of the expressions value, and the "stringized" version
// of the expression (i.e., the exrpression put in quotes). For example, if
// we have:
// #define FOO 2
// #define BAR 5
// then the following:
// VALUE_TO_NUMBER_AND_NAME(FOO + BAR)
// will expand to:
// {7, "FOO + BAR"}
// We use the resulting array as an argument to our histogram, which reads the
// number as a bucket identifier, and proceeds to use the corresponding name
// in the pair (i.e., the quoted string) when printing out a histogram.
#define VALUE_TO_NUMBER_AND_NAME(name) {name, #name},

// static
const LinearHistogram::DescriptionPair MessageLoop::event_descriptions_[] = {
// Provide some pretty print capability in our histogram for our internal
// messages.

// A few events we handle (kindred to messages), and used to profile actions.
VALUE_TO_NUMBER_AND_NAME(kTaskRunEvent)
VALUE_TO_NUMBER_AND_NAME(kTimerEvent)

{-1, NULL} // The list must be null terminated, per API to histogram.
};

//------------------------------------------------------------------------------
// MessageLoopForUI

Expand Down
8 changes: 5 additions & 3 deletions base/message_loop.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
#include <string>

#include "base/basictypes.h"
#include "base/lock.h"
#include "base/histogram.h"
#include "base/message_pump.h"
#include "base/observer_list.h"
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
#include "base/task.h"

#if defined(OS_WIN)
Expand All @@ -26,8 +27,6 @@
#endif
#endif

class Histogram;

// A MessageLoop is used to process events for a particular thread. There is
// at most one MessageLoop instance per thread.
//
Expand Down Expand Up @@ -428,6 +427,9 @@ class MessageLoop : public base::MessagePump::Delegate {
// If message_histogram_ is NULL, this is a no-op.
void HistogramEvent(int event);

static const LinearHistogram::DescriptionPair event_descriptions_[];
static bool enable_histogrammer_;

Type type_;

// A list of tasks that need to be processed by this instance. Note that
Expand Down
1 change: 0 additions & 1 deletion base/message_loop_proxy_impl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "base/message_loop.h"
#include "base/message_loop_proxy_impl.h"
#include "base/scoped_ptr.h"
#include "base/thread.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
Expand Down
3 changes: 1 addition & 2 deletions base/observer_list_threadsafe.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
#ifndef BASE_OBSERVER_LIST_THREADSAFE_H_
#define BASE_OBSERVER_LIST_THREADSAFE_H_

#include <algorithm>
#include <map>
#include <vector>
#include <algorithm>

#include "base/basictypes.h"
#include "base/callback.h"
Expand Down
1 change: 0 additions & 1 deletion base/weak_ptr_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "base/message_loop.h"
#include "base/thread.h"
#include "base/scoped_ptr.h"
#include "base/weak_ptr.h"

namespace base {
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/autocomplete/autocomplete_edit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <string>

#include "base/basictypes.h"
#include "base/histogram.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/app/chrome_dll_resource.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/autocomplete/autocomplete_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// found in the LICENSE file.

#include "base/message_loop.h"
#include "base/scoped_ptr.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/autocomplete/autocomplete.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/autocomplete/search_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <string>
#include <vector>

#include "base/scoped_ptr.h"
#include "chrome/browser/autocomplete/autocomplete.h"
#include "chrome/browser/cancelable_request.h"
#include "chrome/browser/history/history_types.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/browser_init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "app/resource_bundle.h"
#include "base/env_var.h"
#include "base/event_recorder.h"
#include "base/histogram.h"
#include "base/path_service.h"
#include "base/scoped_ptr.h"
#include "chrome/browser/automation/automation_provider.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/cancelable_request.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
#include "base/task.h"

class CancelableRequestBase;
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/chrome_thread_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "base/message_loop.h"
#include "base/message_loop_proxy.h"
#include "base/scoped_ptr.h"
#include "chrome/browser/chrome_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/chromeos/boot_times_loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "base/command_line.h"
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/histogram.h"
#include "base/message_loop.h"
#include "base/process_util.h"
#include "base/string_util.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/cocoa/download_item_controller.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "app/l10n_util_mac.h"
#include "app/resource_bundle.h"
#include "app/text_elider.h"
#include "base/histogram.h"
#include "base/mac_util.h"
#include "base/sys_string_conversions.h"
#include "base/utf_string_conversions.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/cocoa/external_protocol_dialog.mm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#import "chrome/browser/cocoa/external_protocol_dialog.h"

#include "app/l10n_util_mac.h"
#include "base/histogram.h"
#include "base/message_loop.h"
#include "base/string_util.h"
#include "base/sys_string_conversions.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "base/basictypes.h"
#include "base/message_loop.h"
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
#include "base/string_util.h"
#include "base/thread.h"
#include "chrome/browser/debugger/devtools_remote.h"
Expand Down
18 changes: 18 additions & 0 deletions chrome/browser/download/download_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <string>

#include "base/basictypes.h"
#include "base/task.h"
#include "gfx/native_widget_types.h"

#if defined(TOOLKIT_VIEWS)
Expand All @@ -29,6 +30,23 @@ class SkBitmap;

namespace download_util {

// DownloadProgressTask --------------------------------------------------------

// A class for managing the timed progress animations for a download view. The
// view must implement an UpdateDownloadProgress() method.
template<class DownloadView>
class DownloadProgressTask : public Task {
public:
explicit DownloadProgressTask(DownloadView* view) : view_(view) {}
virtual ~DownloadProgressTask() {}
virtual void Run() {
view_->UpdateDownloadProgress();
}
private:
DownloadView* view_;
DISALLOW_COPY_AND_ASSIGN(DownloadProgressTask);
};

// Download opening ------------------------------------------------------------

// Whether it is OK to open this download.
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/extensions/crx_installer.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "base/file_path.h"
#include "base/ref_counted.h"
#include "base/task.h"
#include "chrome/browser/extensions/extension_install_ui.h"
#include "chrome/browser/extensions/extensions_service.h"
#include "chrome/browser/extensions/sandboxed_extension_unpacker.h"
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/extensions/extension_prefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <vector>

#include "base/linked_ptr.h"
#include "base/task.h"
#include "base/time.h"
#include "chrome/browser/pref_service.h"
#include "chrome/common/extensions/extension.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/extensions/extension_updater.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "base/logging.h"
#include "base/file_util.h"
#include "base/file_version_info.h"
#include "base/histogram.h"
#include "base/rand_util.h"
#include "base/sha2.h"
#include "base/stl_util-inl.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/gears_integration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "base/base64.h"
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/scoped_ptr.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/chrome_plugin_host.h"
#include "chrome/common/chrome_plugin_util.h"
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/geolocation/access_token_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "base/ref_counted.h"
#include "base/string16.h"
#include "base/task.h"
#include "chrome/browser/cancelable_request.h"
#include "googleurl/src/gurl.h"

Expand Down
1 change: 0 additions & 1 deletion chrome/browser/google_url_tracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <string>

#include "base/gtest_prod_util.h"
#include "base/scoped_ptr.h"
#include "chrome/common/net/url_fetcher.h"
#include "chrome/common/notification_registrar.h"
#include "googleurl/src/gurl.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/gtk/download_item_gtk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "app/text_elider.h"
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/histogram.h"
#include "base/string_util.h"
#include "base/time.h"
#include "chrome/browser/browser.h"
Expand Down
2 changes: 2 additions & 0 deletions chrome/browser/idle.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_IDLE_H_
#define CHROME_BROWSER_IDLE_H_

#include "base/task.h"

enum IdleState {
IDLE_STATE_ACTIVE = 0,
IDLE_STATE_IDLE = 1, // No activity within threshold.
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/io_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
#include "base/task.h"
#include "chrome/browser/browser_process_sub_thread.h"
#include "chrome/browser/net/chrome_network_delegate.h"
#include "chrome/common/net/predictor_common.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/memory_details.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include "app/l10n_util.h"
#include "base/file_version_info.h"
#include "base/histogram.h"
#include "base/process_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_child_process_host.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/net/chrome_net_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#define CHROME_BROWSER_NET_CHROME_NET_LOG_H_

#include "base/observer_list.h"
#include "base/scoped_ptr.h"
#include "net/base/net_log.h"

class PassiveLogCollector;
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/omnibox_search_hint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/command_line.h"
#include "base/histogram.h"
#include "base/task.h"
#include "chrome/browser/autocomplete/autocomplete_edit.h"
#include "chrome/browser/autocomplete/autocomplete_edit_view.h"
Expand Down
Loading

0 comments on commit 8efa680

Please sign in to comment.