Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Unified Diff: content/common/gpu/gpu_channel.cc

Issue 8572047: base::Bind() conversion for content/common/gpu and content/gpu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: scoped_ptr<base::WPF> -> base::WPF Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/gpu_channel.h ('k') | content/common/gpu/gpu_channel_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gpu_channel.cc
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc
index 9bb1ee520717c9142568589446d607491c061830..2f1406534d90132c58990657676c5e8e9dc354ce 100644
--- a/content/common/gpu/gpu_channel.cc
+++ b/content/common/gpu/gpu_channel.cc
@@ -8,6 +8,7 @@
#include "content/common/gpu/gpu_channel.h"
+#include "base/bind.h"
#include "base/command_line.h"
#include "base/debug/trace_event.h"
#include "base/process_util.h"
@@ -39,7 +40,7 @@ GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager,
handle_messages_scheduled_(false),
processed_get_state_fast_(false),
num_contexts_preferring_discrete_gpu_(0),
- task_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
+ weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
DCHECK(gpu_channel_manager);
DCHECK(renderer_id);
const CommandLine* command_line = CommandLine::ForCurrentProcess();
@@ -157,8 +158,7 @@ void GpuChannel::OnScheduled() {
// task to prevent reentrancy.
MessageLoop::current()->PostTask(
FROM_HERE,
- task_factory_.NewRunnableMethod(
- &GpuChannel::HandleMessage));
+ base::Bind(&GpuChannel::HandleMessage, weak_factory_.GetWeakPtr()));
handle_messages_scheduled_ = true;
}
@@ -168,8 +168,7 @@ void GpuChannel::LoseAllContexts() {
void GpuChannel::DestroySoon() {
MessageLoop::current()->PostTask(
- FROM_HERE, NewRunnableMethod(this,
- &GpuChannel::OnDestroy));
+ FROM_HERE, base::Bind(&GpuChannel::OnDestroy, this));
}
void GpuChannel::OnDestroy() {
« no previous file with comments | « content/common/gpu/gpu_channel.h ('k') | content/common/gpu/gpu_channel_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698