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

Unified Diff: chrome/browser/extensions/execute_code_in_tab_function.cc

Issue 8343008: base::Bind conversion for chrome/browser/extensions/file_reader. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 months 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 | « chrome/browser/chromeos/accessibility_util.cc ('k') | chrome/browser/extensions/file_reader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/execute_code_in_tab_function.cc
diff --git a/chrome/browser/extensions/execute_code_in_tab_function.cc b/chrome/browser/extensions/execute_code_in_tab_function.cc
index e8645d9ddb198cda0bb6bf63efda5511b9b8fe1e..baacd9795f2e4af84e8d13ce2fb51620ab24c61c 100644
--- a/chrome/browser/extensions/execute_code_in_tab_function.cc
+++ b/chrome/browser/extensions/execute_code_in_tab_function.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/extensions/execute_code_in_tab_function.h"
+#include "base/bind.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/extensions/extension_service.h"
@@ -118,9 +119,8 @@ bool ExecuteCodeInTabFunction::RunImpl() {
}
scoped_refptr<FileReader> file_reader(new FileReader(
- resource_, NewCallback(this, &ExecuteCodeInTabFunction::DidLoadFile)));
+ resource_, base::Bind(&ExecuteCodeInTabFunction::DidLoadFile, this)));
file_reader->Start();
- AddRef(); // Keep us alive until DidLoadAndLocalizeFile is called.
return true;
}
@@ -137,11 +137,11 @@ void ExecuteCodeInTabFunction::DidLoadFile(bool success,
data.find(ExtensionMessageBundle::kMessageBegin) != std::string::npos) {
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
- NewRunnableMethod(this, &ExecuteCodeInTabFunction::LocalizeCSS,
- data,
- extension->id(),
- extension->path(),
- extension->default_locale()));
+ base::Bind(&ExecuteCodeInTabFunction::LocalizeCSS, this,
+ data,
+ extension->id(),
+ extension->path(),
+ extension->default_locale()));
} else {
DidLoadAndLocalizeFile(success, data);
}
@@ -167,9 +167,8 @@ void ExecuteCodeInTabFunction::LocalizeCSS(
// anything to localize.
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
- NewRunnableMethod(this,
- &ExecuteCodeInTabFunction::DidLoadAndLocalizeFile,
- true, css_data));
+ base::Bind(&ExecuteCodeInTabFunction::DidLoadAndLocalizeFile, this,
+ true, css_data));
}
void ExecuteCodeInTabFunction::DidLoadAndLocalizeFile(bool success,
@@ -188,7 +187,6 @@ void ExecuteCodeInTabFunction::DidLoadAndLocalizeFile(bool success,
#endif // OS_WIN
SendResponse(false);
}
- Release(); // Balance the AddRef taken in RunImpl
}
bool ExecuteCodeInTabFunction::Execute(const std::string& code_string) {
« no previous file with comments | « chrome/browser/chromeos/accessibility_util.cc ('k') | chrome/browser/extensions/file_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698