Disambiguate origins of tasks posted by the WebDataService.

When calling PostTask, rather than always providing the source information corresponding to ScheduleTask, use the location of the caller of ScheduleTask. This helps in disambiguating tasks in, for example, the task profiler.


BUG=105921
TEST=

Review URL: http://codereview.chromium.org/8745017

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113032 0039d316-1c4b-4281-b951-d872f2087c98
parent 9ae95a7c
This diff is collapsed.
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "base/callback_forward.h" #include "base/callback_forward.h"
#include "base/file_path.h" #include "base/file_path.h"
#include "base/location.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/synchronization/lock.h" #include "base/synchronization/lock.h"
#include "chrome/browser/search_engines/template_url_id.h" #include "chrome/browser/search_engines/template_url_id.h"
...@@ -592,7 +593,8 @@ class WebDataService ...@@ -592,7 +593,8 @@ class WebDataService
void Commit(); void Commit();
// Schedule a task on our worker thread. // Schedule a task on our worker thread.
void ScheduleTask(const base::Closure& task); void ScheduleTask(const tracked_objects::Location& from_here,
const base::Closure& task);
// Schedule a commit if one is not already pending. // Schedule a commit if one is not already pending.
void ScheduleCommit(); void ScheduleCommit();
......
...@@ -16,7 +16,8 @@ void WebDataService::AddIE7Login(const IE7PasswordInfo& info) { ...@@ -16,7 +16,8 @@ void WebDataService::AddIE7Login(const IE7PasswordInfo& info) {
new GenericRequest<IE7PasswordInfo>(this, GetNextRequestHandle(), NULL, new GenericRequest<IE7PasswordInfo>(this, GetNextRequestHandle(), NULL,
info); info);
RegisterRequest(request); RegisterRequest(request);
ScheduleTask(Bind(&WebDataService::AddIE7LoginImpl, this, request)); ScheduleTask(FROM_HERE,
Bind(&WebDataService::AddIE7LoginImpl, this, request));
} }
void WebDataService::RemoveIE7Login(const IE7PasswordInfo& info) { void WebDataService::RemoveIE7Login(const IE7PasswordInfo& info) {
...@@ -24,7 +25,8 @@ void WebDataService::RemoveIE7Login(const IE7PasswordInfo& info) { ...@@ -24,7 +25,8 @@ void WebDataService::RemoveIE7Login(const IE7PasswordInfo& info) {
new GenericRequest<IE7PasswordInfo>(this, GetNextRequestHandle(), NULL, new GenericRequest<IE7PasswordInfo>(this, GetNextRequestHandle(), NULL,
info); info);
RegisterRequest(request); RegisterRequest(request);
ScheduleTask(Bind(&WebDataService::RemoveIE7LoginImpl, this, request)); ScheduleTask(FROM_HERE,
Bind(&WebDataService::RemoveIE7LoginImpl, this, request));
} }
WebDataService::Handle WebDataService::GetIE7Login( WebDataService::Handle WebDataService::GetIE7Login(
...@@ -34,7 +36,8 @@ WebDataService::Handle WebDataService::GetIE7Login( ...@@ -34,7 +36,8 @@ WebDataService::Handle WebDataService::GetIE7Login(
new GenericRequest<IE7PasswordInfo>(this, GetNextRequestHandle(), new GenericRequest<IE7PasswordInfo>(this, GetNextRequestHandle(),
consumer, info); consumer, info);
RegisterRequest(request); RegisterRequest(request);
ScheduleTask(Bind(&WebDataService::GetIE7LoginImpl, this, request)); ScheduleTask(FROM_HERE,
Bind(&WebDataService::GetIE7LoginImpl, this, request));
return request->GetHandle(); return request->GetHandle();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment