shill: allow users of EventDispatcher to provide location with task

Since the location is provided inside EventDispatcher::PostTask and
EventDispatcher::PostDelayedTask, we often lose information about
where the task is actually coming from in minidumps and crash reports.
If we move the creation of the location object to the callsites of
EventDispatcher we should be able to get better information about
this.

BUG=None
TEST=unit tests

Change-Id: I405ad5de4e71005cbaf9d6962a1d72e1d37060f7
Reviewed-on: https://chromium-review.googlesource.com/411281
Commit-Ready: Eric Caruso <ejcaruso@chromium.org>
Tested-by: Eric Caruso <ejcaruso@chromium.org>
Reviewed-by: Kirtika Ruchandani <kirtika@chromium.org>
diff --git a/HACKING b/HACKING
index c8289c0..1416440 100644
--- a/HACKING
+++ b/HACKING
@@ -93,7 +93,8 @@
   the name of the function deferring the work. E.g.
 
   void Modem::Init() {
-    dispatcher_->PostTask(task_factory_.NewRunnableMethod(&Modem::InitTask));
+    dispatcher_->PostTask(FROM_HERE,
+                          task_factory_.NewRunnableMethod(&Modem::InitTask));
   }
 
   RATIONALE: The naming convention makes the relationship between the signal
diff --git a/active_link_monitor.cc b/active_link_monitor.cc
index 534f101..bda7f95 100644
--- a/active_link_monitor.cc
+++ b/active_link_monitor.cc
@@ -150,7 +150,7 @@
   // Post a task to send ARP request instead of calling it synchronously, to
   // maintain consistent expectation in the case of send failures, which will
   // always invoke failure callback.
-  dispatcher_->PostTask(send_request_callback_.callback());
+  dispatcher_->PostTask(FROM_HERE, send_request_callback_.callback());
   return true;
 }
 
@@ -339,7 +339,7 @@
 
   time_->GetTimeMonotonic(&sent_request_at_);
 
-  dispatcher_->PostDelayedTask(send_request_callback_.callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE, send_request_callback_.callback(),
                                test_period_milliseconds_);
 }
 
diff --git a/active_link_monitor_unittest.cc b/active_link_monitor_unittest.cc
index 211d948..2f8faca 100644
--- a/active_link_monitor_unittest.cc
+++ b/active_link_monitor_unittest.cc
@@ -251,12 +251,12 @@
         IsArpRequest(local_ip_, gateway_ip_, local_mac_, destination_mac)))
         .WillOnce(Return(true));
     EXPECT_CALL(dispatcher_,
-                PostDelayedTask(_, transmit_period_milliseconds));
+                PostDelayedTask(_, _, transmit_period_milliseconds));
   }
   void SendNextRequest() {
     EXPECT_CALL(*client_, TransmitRequest(_)).WillOnce(Return(true));
     EXPECT_CALL(dispatcher_,
-                PostDelayedTask(_, GetCurrentTestPeriodMilliseconds()));
+                PostDelayedTask(_, _, GetCurrentTestPeriodMilliseconds()));
     TriggerRequestTimer();
   }
   void ExpectNoTransmit() {
@@ -266,7 +266,7 @@
     EXPECT_CALL(device_info_, GetMACAddress(0, _))
         .WillOnce(DoAll(SetArgumentPointee<1>(local_mac_), Return(true)));
     EXPECT_CALL(*client_, StartReplyListener()).WillOnce(Return(true));
-    EXPECT_CALL(dispatcher_, PostTask(_)).Times(1);
+    EXPECT_CALL(dispatcher_, PostTask(_, _)).Times(1);
     EXPECT_TRUE(monitor_.Start(
         ActiveLinkMonitor::kDefaultTestPeriodMilliseconds));
     EXPECT_FALSE(GetSendRequestCallback().IsCancelled());
diff --git a/binder/binder_control.cc b/binder/binder_control.cc
index 21b046a..b332eb9 100644
--- a/binder/binder_control.cc
+++ b/binder/binder_control.cc
@@ -93,7 +93,7 @@
   // function expects |registration_done_callback| to be called asynchronously,
   // post the callback to the message loop ourselves.
   manager->RegisterAsync(base::Callback<void(bool)>());
-  dispatcher_->PostTask(registration_done_callback);
+  dispatcher_->PostTask(FROM_HERE, registration_done_callback);
 }
 
 DeviceAdaptorInterface* BinderControl::CreateDeviceAdaptor(Device* device) {
diff --git a/cellular/active_passive_out_of_credits_detector.cc b/cellular/active_passive_out_of_credits_detector.cc
index de7292d..89dd0c3 100644
--- a/cellular/active_passive_out_of_credits_detector.cc
+++ b/cellular/active_passive_out_of_credits_detector.cc
@@ -262,6 +262,7 @@
       // out-of-credits detection.
       out_of_credits_detection_in_progress_ = true;
       dispatcher()->PostTask(
+          FROM_HERE,
           Bind(&ActivePassiveOutOfCreditsDetector::OutOfCreditsReconnect,
                weak_ptr_factory_.GetWeakPtr()));
     } else {
diff --git a/cellular/cellular.cc b/cellular/cellular.cc
index 90e4cac..a9a4d57 100644
--- a/cellular/cellular.cc
+++ b/cellular/cellular.cc
@@ -1368,6 +1368,7 @@
                                           weak_ptr_factory_.GetWeakPtr(),
                                           false));
     dispatcher()->PostDelayedTask(
+        FROM_HERE,
         scanning_timeout_callback_.callback(),
         scanning_timeout_milliseconds_);
   }
diff --git a/cellular/cellular_capability_classic.cc b/cellular/cellular_capability_classic.cc
index 6bfed82..28391cf 100644
--- a/cellular/cellular_capability_classic.cc
+++ b/cellular/cellular_capability_classic.cc
@@ -147,7 +147,7 @@
   SLOG(this, 2) << __func__ << ": " << tasks->size() << " remaining tasks";
   Closure task = (*tasks)[0];
   tasks->erase(tasks->begin());
-  cellular()->dispatcher()->PostTask(task);
+  cellular()->dispatcher()->PostTask(FROM_HERE, task);
 }
 
 void CellularCapabilityClassic::StepCompletedCallback(
diff --git a/cellular/cellular_capability_gsm.cc b/cellular/cellular_capability_gsm.cc
index 6e6d0b8..098636b 100644
--- a/cellular/cellular_capability_gsm.cc
+++ b/cellular/cellular_capability_gsm.cc
@@ -773,6 +773,7 @@
           Bind(&CellularCapabilityGSM::GetIMSI,
                weak_ptr_factory_.GetWeakPtr(), callback);
       cellular()->dispatcher()->PostDelayedTask(
+          FROM_HERE,
           retry_get_imsi_cb,
           get_imsi_retry_delay_milliseconds_);
     } else {
diff --git a/cellular/cellular_capability_universal.cc b/cellular/cellular_capability_universal.cc
index 47881a3..42be146 100644
--- a/cellular/cellular_capability_universal.cc
+++ b/cellular/cellular_capability_universal.cc
@@ -323,7 +323,7 @@
                 weak_ptr_factory_.GetWeakPtr(),
                 callback);
   }
-  cellular()->dispatcher()->PostTask(task);
+  cellular()->dispatcher()->PostTask(FROM_HERE, task);
   deferred_enable_modem_callback_.Reset();
 }
 
@@ -1547,6 +1547,7 @@
              operator_code,
              operator_name));
     cellular()->dispatcher()->PostDelayedTask(
+        FROM_HERE,
         registration_dropped_update_callback_.callback(),
         registration_dropped_update_timeout_milliseconds_);
   } else {
diff --git a/cellular/cellular_capability_universal_cdma.cc b/cellular/cellular_capability_universal_cdma.cc
index 2becef8..176bcbc 100644
--- a/cellular/cellular_capability_universal_cdma.cc
+++ b/cellular/cellular_capability_universal_cdma.cc
@@ -175,6 +175,7 @@
     case PendingActivationStore::kStateFailureRetry:
       SLOG(this, 3) << "OTA activation failed. Scheduling a retry.";
       cellular()->dispatcher()->PostTask(
+          FROM_HERE,
           Bind(&CellularCapabilityUniversalCDMA::ActivateAutomatic,
                weak_cdma_ptr_factory_.GetWeakPtr()));
       break;
diff --git a/cellular/cellular_capability_universal_cdma_unittest.cc b/cellular/cellular_capability_universal_cdma_unittest.cc
index c2cb984..7aa5107 100644
--- a/cellular/cellular_capability_universal_cdma_unittest.cc
+++ b/cellular/cellular_capability_universal_cdma_unittest.cc
@@ -580,7 +580,7 @@
   EXPECT_CALL(*modem_info_.mock_pending_activation_store(),
               GetActivationState(_, _))
       .Times(0);
-  EXPECT_CALL(*modem_info_.mock_dispatcher(), PostTask(_)).Times(0);
+  EXPECT_CALL(*modem_info_.mock_dispatcher(), PostTask(_, _)).Times(0);
   capability_->UpdatePendingActivationState();
   Mock::VerifyAndClearExpectations(modem_info_.mock_pending_activation_store());
   Mock::VerifyAndClearExpectations(modem_info_.mock_dispatcher());
@@ -592,7 +592,7 @@
               GetActivationState(_, _))
       .Times(2)
       .WillRepeatedly(Return(PendingActivationStore::kStateUnknown));
-  EXPECT_CALL(*modem_info_.mock_dispatcher(), PostTask(_)).Times(0);
+  EXPECT_CALL(*modem_info_.mock_dispatcher(), PostTask(_, _)).Times(0);
   capability_->UpdatePendingActivationState();
   Mock::VerifyAndClearExpectations(modem_info_.mock_pending_activation_store());
   Mock::VerifyAndClearExpectations(modem_info_.mock_dispatcher());
@@ -604,7 +604,7 @@
               GetActivationState(_, _))
       .Times(2)
       .WillRepeatedly(Return(PendingActivationStore::kStatePending));
-  EXPECT_CALL(*modem_info_.mock_dispatcher(), PostTask(_)).Times(0);
+  EXPECT_CALL(*modem_info_.mock_dispatcher(), PostTask(_, _)).Times(0);
   capability_->UpdatePendingActivationState();
   Mock::VerifyAndClearExpectations(modem_info_.mock_pending_activation_store());
   Mock::VerifyAndClearExpectations(modem_info_.mock_dispatcher());
@@ -615,7 +615,7 @@
               GetActivationState(_, _))
       .Times(2)
       .WillRepeatedly(Return(PendingActivationStore::kStateFailureRetry));
-  EXPECT_CALL(*modem_info_.mock_dispatcher(), PostTask(_)).Times(1);
+  EXPECT_CALL(*modem_info_.mock_dispatcher(), PostTask(_, _)).Times(1);
   capability_->UpdatePendingActivationState();
   Mock::VerifyAndClearExpectations(modem_info_.mock_pending_activation_store());
   Mock::VerifyAndClearExpectations(modem_info_.mock_dispatcher());
@@ -629,7 +629,7 @@
       .WillOnce(Return(PendingActivationStore::kStateActivated))
       .WillOnce(Return(PendingActivationStore::kStateUnknown))
       .WillOnce(Return(PendingActivationStore::kStateUnknown));
-  EXPECT_CALL(*modem_info_.mock_dispatcher(), PostTask(_)).Times(0);
+  EXPECT_CALL(*modem_info_.mock_dispatcher(), PostTask(_, _)).Times(0);
   capability_->UpdatePendingActivationState();
   capability_->UpdatePendingActivationState();
   Mock::VerifyAndClearExpectations(modem_info_.mock_pending_activation_store());
diff --git a/cellular/mobile_operator_info_impl.cc b/cellular/mobile_operator_info_impl.cc
index 5d8b1a9..6468131 100644
--- a/cellular/mobile_operator_info_impl.cc
+++ b/cellular/mobile_operator_info_impl.cc
@@ -952,7 +952,7 @@
   notify_operator_changed_task_.Reset(
       Bind(&MobileOperatorInfoImpl::NotifyOperatorChanged,
            weak_ptr_factory_.GetWeakPtr()));
-  dispatcher_->PostTask(notify_operator_changed_task_.callback());
+  dispatcher_->PostTask(FROM_HERE, notify_operator_changed_task_.callback());
 }
 
 void MobileOperatorInfoImpl::NotifyOperatorChanged() {
diff --git a/connection_diagnostics.cc b/connection_diagnostics.cc
index a9d12c1..4c7c0cd 100644
--- a/connection_diagnostics.cc
+++ b/connection_diagnostics.cc
@@ -221,6 +221,7 @@
 
   running_ = true;
   dispatcher_->PostTask(
+      FROM_HERE,
       Bind(&ConnectionDiagnostics::StartAfterPortalDetectionInternal,
            weak_ptr_factory_.GetWeakPtr(), result));
   return true;
@@ -317,7 +318,8 @@
                  ConnectivityTrial::kStatusTimeout) {
         // DNS timeout occurred in portal detection. Ping DNS servers to make
         // sure they are reachable.
-        dispatcher_->PostTask(Bind(&ConnectionDiagnostics::PingDNSServers,
+        dispatcher_->PostTask(FROM_HERE,
+                              Bind(&ConnectionDiagnostics::PingDNSServers,
                                    weak_ptr_factory_.GetWeakPtr()));
       } else {
         ReportResultAndStop(kIssueDNSServerMisconfig);
@@ -337,6 +339,7 @@
         ReportResultAndStop(kIssueInternalError);
       } else {
         dispatcher_->PostTask(
+            FROM_HERE,
             Bind(&ConnectionDiagnostics::ResolveTargetServerIPAddress,
                  weak_ptr_factory_.GetWeakPtr(), connection_->dns_servers()));
       }
@@ -459,7 +462,8 @@
   route_query_timeout_callback_.Reset(
       Bind(&ConnectionDiagnostics::OnRouteQueryTimeout,
            weak_ptr_factory_.GetWeakPtr()));
-  dispatcher_->PostDelayedTask(route_query_timeout_callback_.callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE,
+                               route_query_timeout_callback_.callback(),
                                kRouteQueryTimeoutSeconds * 1000);
   AddEventWithMessage(
       kTypeFindRoute, kPhaseStart, kResultSuccess,
@@ -498,7 +502,8 @@
   AddEventWithMessage(kTypeArpTableLookup, kPhaseEnd, kResultFailure,
                       StringPrintf("Could not find ARP table entry for %s",
                                    address.ToString().c_str()));
-  dispatcher_->PostTask(Bind(&ConnectionDiagnostics::CheckIpCollision,
+  dispatcher_->PostTask(FROM_HERE,
+                        Bind(&ConnectionDiagnostics::CheckIpCollision,
                              weak_ptr_factory_.GetWeakPtr()));
 }
 
@@ -525,7 +530,8 @@
   neighbor_request_timeout_callback_.Reset(
       Bind(&ConnectionDiagnostics::OnNeighborTableRequestTimeout,
            weak_ptr_factory_.GetWeakPtr(), address));
-  dispatcher_->PostDelayedTask(route_query_timeout_callback_.callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE,
+                               route_query_timeout_callback_.callback(),
                                kNeighborTableRequestTimeoutSeconds * 1000);
   AddEventWithMessage(kTypeNeighborTableLookup, kPhaseStart, kResultSuccess,
                       StringPrintf("Finding neighbor table entry for %s",
@@ -575,7 +581,8 @@
   arp_reply_timeout_callback_.Reset(
       Bind(&ConnectionDiagnostics::OnArpRequestTimeout,
            weak_ptr_factory_.GetWeakPtr()));
-  dispatcher_->PostDelayedTask(arp_reply_timeout_callback_.callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE,
+                               arp_reply_timeout_callback_.callback(),
                                kArpReplyTimeoutSeconds * 1000);
   AddEvent(kTypeIPCollisionCheck, kPhaseStart, kResultSuccess);
 }
@@ -646,7 +653,8 @@
         StringPrintf(
             "No DNS servers responded to pings. Pinging first DNS server at %s",
             first_dns_server_ip_addr.ToString().c_str()));
-    dispatcher_->PostTask(Bind(&ConnectionDiagnostics::FindRouteToHost,
+    dispatcher_->PostTask(FROM_HERE,
+                          Bind(&ConnectionDiagnostics::FindRouteToHost,
                                weak_ptr_factory_.GetWeakPtr(),
                                first_dns_server_ip_addr));
     return;
@@ -662,6 +670,7 @@
 
   if (num_dns_attempts_ < kMaxDNSRetries) {
     dispatcher_->PostTask(
+        FROM_HERE,
         Bind(&ConnectionDiagnostics::ResolveTargetServerIPAddress,
              weak_ptr_factory_.GetWeakPtr(), pingable_dns_servers_));
   } else {
@@ -678,13 +687,15 @@
     AddEventWithMessage(
         kTypeResolveTargetServerIP, kPhaseEnd, kResultSuccess,
         StringPrintf("Target address is %s", address.ToString().c_str()));
-    dispatcher_->PostTask(Bind(&ConnectionDiagnostics::PingHost,
+    dispatcher_->PostTask(FROM_HERE,
+                          Bind(&ConnectionDiagnostics::PingHost,
                                weak_ptr_factory_.GetWeakPtr(), address));
   } else if (error.type() == Error::kOperationTimeout) {
     AddEventWithMessage(
         kTypeResolveTargetServerIP, kPhaseEnd, kResultTimeout,
         StringPrintf("DNS resolution timed out: %s", error.message().c_str()));
-    dispatcher_->PostTask(Bind(&ConnectionDiagnostics::PingDNSServers,
+    dispatcher_->PostTask(FROM_HERE,
+                          Bind(&ConnectionDiagnostics::PingDNSServers,
                                weak_ptr_factory_.GetWeakPtr()));
   } else {
     AddEventWithMessage(
@@ -725,17 +736,20 @@
                             : kIssueHTTPBrokenPortal);
   } else if (result_type == kResultFailure &&
              ping_event_type == kTypePingTargetServer) {
-    dispatcher_->PostTask(Bind(&ConnectionDiagnostics::FindRouteToHost,
+    dispatcher_->PostTask(FROM_HERE,
+                          Bind(&ConnectionDiagnostics::FindRouteToHost,
                                weak_ptr_factory_.GetWeakPtr(), address_pinged));
   } else if (result_type == kResultFailure &&
              ping_event_type == kTypePingGateway &&
              address_pinged.family() == IPAddress::kFamilyIPv4) {
-    dispatcher_->PostTask(Bind(&ConnectionDiagnostics::FindArpTableEntry,
+    dispatcher_->PostTask(FROM_HERE,
+                          Bind(&ConnectionDiagnostics::FindArpTableEntry,
                                weak_ptr_factory_.GetWeakPtr(), address_pinged));
   } else {
     // We failed to ping an IPv6 gateway. Check for neighbor table entry for
     // this gateway.
-    dispatcher_->PostTask(Bind(&ConnectionDiagnostics::FindNeighborTableEntry,
+    dispatcher_->PostTask(FROM_HERE,
+                          Bind(&ConnectionDiagnostics::FindNeighborTableEntry,
                                weak_ptr_factory_.GetWeakPtr(), address_pinged));
   }
 }
@@ -847,17 +861,20 @@
   if (!entry.gateway.IsDefault()) {
     // We have a route to a remote destination, so ping the route gateway to
     // check if we have a means of reaching this host.
-    dispatcher_->PostTask(Bind(&ConnectionDiagnostics::PingHost,
+    dispatcher_->PostTask(FROM_HERE,
+                          Bind(&ConnectionDiagnostics::PingHost,
                                weak_ptr_factory_.GetWeakPtr(), entry.gateway));
   } else if (entry.dst.family() == IPAddress::kFamilyIPv4) {
     // We have a route to a local IPv4 destination, so check for an ARP table
     // entry.
-    dispatcher_->PostTask(Bind(&ConnectionDiagnostics::FindArpTableEntry,
+    dispatcher_->PostTask(FROM_HERE,
+                          Bind(&ConnectionDiagnostics::FindArpTableEntry,
                                weak_ptr_factory_.GetWeakPtr(), entry.dst));
   } else {
     // We have a route to a local IPv6 destination, so check for a neighbor
     // table entry.
-    dispatcher_->PostTask(Bind(&ConnectionDiagnostics::FindNeighborTableEntry,
+    dispatcher_->PostTask(FROM_HERE,
+                          Bind(&ConnectionDiagnostics::FindNeighborTableEntry,
                                weak_ptr_factory_.GetWeakPtr(), entry.dst));
   }
 }
diff --git a/connection_diagnostics_unittest.cc b/connection_diagnostics_unittest.cc
index b228094..7236b19 100644
--- a/connection_diagnostics_unittest.cc
+++ b/connection_diagnostics_unittest.cc
@@ -356,7 +356,7 @@
     // Post task to find DNS server route only after all (i.e. 2) pings are
     // done.
     connection_diagnostics_.OnPingDNSServerComplete(0, kEmptyResult);
-    EXPECT_CALL(dispatcher_, PostTask(_));
+    EXPECT_CALL(dispatcher_, PostTask(_, _));
     connection_diagnostics_.OnPingDNSServerComplete(1, kEmptyResult);
   }
 
@@ -443,7 +443,7 @@
     // Next action is either to find a route to the target web server, find an
     // ARP entry for the IPv4 gateway, or find a neighbor table entry for the
     // IPv6 gateway.
-    EXPECT_CALL(dispatcher_, PostTask(_));
+    EXPECT_CALL(dispatcher_, PostTask(_, _));
     connection_diagnostics_.OnPingHostComplete(ping_event_type, address,
                                                kEmptyResult);
   }
@@ -460,7 +460,7 @@
     EXPECT_CALL(
         dispatcher_,
         PostDelayedTask(
-            _, ConnectionDiagnostics::kRouteQueryTimeoutSeconds * 1000));
+            _, _, ConnectionDiagnostics::kRouteQueryTimeoutSeconds * 1000));
     connection_diagnostics_.FindRouteToHost(address);
     EXPECT_FALSE(
         connection_diagnostics_.route_query_timeout_callback_.IsCancelled());
@@ -484,7 +484,7 @@
     // Next action is either to ping the gateway, find an ARP table entry for
     // the local IPv4 web server, or find a neighbor table entry for the local
     // IPv6 web server.
-    EXPECT_CALL(dispatcher_, PostTask(_));
+    EXPECT_CALL(dispatcher_, PostTask(_, _));
     RoutingTableEntry entry(
         address_queried, IPAddress(address_queried.family()), gateway, 0,
         RT_SCOPE_UNIVERSE, true, connection_->table_id(), -1);
@@ -521,7 +521,7 @@
     EXPECT_CALL(
         dispatcher_,
         PostDelayedTask(
-            _,
+            _, _,
             ConnectionDiagnostics::kNeighborTableRequestTimeoutSeconds * 1000));
     connection_diagnostics_.FindNeighborTableEntry(address);
   }
@@ -572,8 +572,8 @@
                                              sizeof(kMACZeroAddress)))))
         .WillOnce(Return(true));
     EXPECT_CALL(dispatcher_,
-                PostDelayedTask(
-                    _, ConnectionDiagnostics::kArpReplyTimeoutSeconds * 1000));
+                PostDelayedTask(_, _,
+                    ConnectionDiagnostics::kArpReplyTimeoutSeconds * 1000));
     connection_diagnostics_.CheckIpCollision();
   }
 
@@ -633,7 +633,7 @@
     } else {
       // Otherwise, we end in DNS phase with a timeout, or a HTTP phase failure.
       // Either of these cases warrant further diagnostic actions.
-      EXPECT_CALL(dispatcher_, PostTask(_));
+      EXPECT_CALL(dispatcher_, PostTask(_, _));
     }
     connection_diagnostics_.StartAfterPortalDetectionInternal(
         PortalDetector::Result(
@@ -700,10 +700,10 @@
     Error error;
     if (result == ConnectionDiagnostics::kResultSuccess) {
       error.Populate(Error::kSuccess);
-      EXPECT_CALL(dispatcher_, PostTask(_));
+      EXPECT_CALL(dispatcher_, PostTask(_, _));
     } else if (result == ConnectionDiagnostics::kResultTimeout) {
       error.Populate(Error::kOperationTimeout);
-      EXPECT_CALL(dispatcher_, PostTask(_));
+      EXPECT_CALL(dispatcher_, PostTask(_, _));
     } else {
       error.Populate(Error::kOperationFailed);
       EXPECT_CALL(metrics_,
@@ -731,11 +731,11 @@
     // Post retry task or report done only after all (i.e. 2) pings are done.
     connection_diagnostics_.OnPingDNSServerComplete(0, kNonEmptyResult);
     if (retries_left) {
-      EXPECT_CALL(dispatcher_, PostTask(_));
+      EXPECT_CALL(dispatcher_, PostTask(_, _));
       EXPECT_CALL(metrics_, NotifyConnectionDiagnosticsIssue(_)).Times(0);
       EXPECT_CALL(callback_target(), ResultCallback(_, _)).Times(0);
     } else {
-      EXPECT_CALL(dispatcher_, PostTask(_)).Times(0);
+      EXPECT_CALL(dispatcher_, PostTask(_, _)).Times(0);
       EXPECT_CALL(metrics_,
                   NotifyConnectionDiagnosticsIssue(
                       ConnectionDiagnostics::kIssueDNSServerNoResponse));
@@ -769,7 +769,7 @@
                   ResultCallback(issue, IsEventList(expected_events_)));
     } else {
       // Checking for IP collision.
-      EXPECT_CALL(dispatcher_, PostTask(_));
+      EXPECT_CALL(dispatcher_, PostTask(_, _));
     }
     connection_diagnostics_.FindArpTableEntry(address);
   }
diff --git a/connection_health_checker.cc b/connection_health_checker.cc
index bc7b5c5..2e4cb12 100644
--- a/connection_health_checker.cc
+++ b/connection_health_checker.cc
@@ -257,17 +257,17 @@
   // Finish conditions:
   if (num_connection_failures_ == kMaxFailedConnectionAttempts) {
     health_check_result_ = kResultConnectionFailure;
-    dispatcher_->PostTask(report_result_);
+    dispatcher_->PostTask(FROM_HERE, report_result_);
     return;
   }
   if (num_congested_queue_detected_ == kMinCongestedQueueAttempts) {
     health_check_result_ = kResultCongestedTxQueue;
-    dispatcher_->PostTask(report_result_);
+    dispatcher_->PostTask(FROM_HERE, report_result_);
     return;
   }
   if (num_successful_sends_ == kMinSuccessfulSendAttempts) {
     health_check_result_ = kResultSuccess;
-    dispatcher_->PostTask(report_result_);
+    dispatcher_->PostTask(FROM_HERE, report_result_);
     return;
   }
 
@@ -329,7 +329,7 @@
 
   verify_sent_data_callback_.Reset(
       Bind(&ConnectionHealthChecker::VerifySentData, Unretained(this)));
-  dispatcher_->PostDelayedTask(verify_sent_data_callback_.callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE, verify_sent_data_callback_.callback(),
                                tcp_state_update_wait_milliseconds_);
 }
 
@@ -360,7 +360,8 @@
       ++num_tx_queue_polling_attempts_;
       verify_sent_data_callback_.Reset(
           Bind(&ConnectionHealthChecker::VerifySentData, Unretained(this)));
-      dispatcher_->PostDelayedTask(verify_sent_data_callback_.callback(),
+      dispatcher_->PostDelayedTask(FROM_HERE,
+                                   verify_sent_data_callback_.callback(),
                                    tcp_state_update_wait_milliseconds_);
       return;
     }
diff --git a/connectivity_trial.cc b/connectivity_trial.cc
index fc58d28..d68daec 100644
--- a/connectivity_trial.cc
+++ b/connectivity_trial.cc
@@ -120,7 +120,8 @@
                              << "ms.";
   trial_.Reset(Bind(&ConnectivityTrial::StartTrialTask,
                     weak_ptr_factory_.GetWeakPtr()));
-  dispatcher_->PostDelayedTask(trial_.callback(), start_delay_milliseconds);
+  dispatcher_->PostDelayedTask(
+      FROM_HERE, trial_.callback(), start_delay_milliseconds);
 }
 
 void ConnectivityTrial::StartTrialTask() {
@@ -134,7 +135,7 @@
 
   trial_timeout_.Reset(Bind(&ConnectivityTrial::TimeoutTrialTask,
                             weak_ptr_factory_.GetWeakPtr()));
-  dispatcher_->PostDelayedTask(trial_timeout_.callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE, trial_timeout_.callback(),
                                trial_timeout_seconds_ * 1000);
 }
 
diff --git a/connectivity_trial_unittest.cc b/connectivity_trial_unittest.cc
index cf2e70f..e970bbc 100644
--- a/connectivity_trial_unittest.cc
+++ b/connectivity_trial_unittest.cc
@@ -142,7 +142,7 @@
     AssignHTTPRequest();
     EXPECT_CALL(*http_request(), Start(_, _, _))
         .WillOnce(Return(HTTPRequest::kResultInProgress));
-    EXPECT_CALL(dispatcher(), PostDelayedTask(_, kTrialTimeout * 1000));
+    EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, kTrialTimeout * 1000));
     connectivity_trial()->StartTrialTask();
   }
 
@@ -176,7 +176,7 @@
     EXPECT_CALL(*http_request(), Stop());
 
     // Expect the ConnectivityTrial to schedule the next attempt.
-    EXPECT_CALL(dispatcher(), PostDelayedTask(_, delay));
+    EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, delay));
   }
 
   void AdvanceTime(int milliseconds) {
@@ -185,14 +185,14 @@
   }
 
   void StartTrial() {
-    EXPECT_CALL(dispatcher(), PostDelayedTask(_, 0));
+    EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, 0));
     EXPECT_TRUE(StartTrial(kURL));
 
     // Expect that the request will be started -- return failure.
     EXPECT_CALL(*http_request(), Start(_, _, _))
         .WillOnce(Return(HTTPRequest::kResultInProgress));
     EXPECT_CALL(dispatcher(), PostDelayedTask(
-        _, kTrialTimeout * 1000));
+        _, _, kTrialTimeout * 1000));
 
     connectivity_trial()->StartTrialTask();
   }
@@ -232,7 +232,7 @@
 
 TEST_F(ConnectivityTrialTest, InvalidURL) {
   EXPECT_FALSE(connectivity_trial()->IsActive());
-  EXPECT_CALL(dispatcher(), PostDelayedTask(_, 0)).Times(0);
+  EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, 0)).Times(0);
   EXPECT_FALSE(StartTrial(kBadURL));
   ExpectReset();
 
@@ -245,7 +245,7 @@
   EXPECT_FALSE(connectivity_trial()->IsActive());
 
   // Once the trial is started, IsActive should return true.
-  EXPECT_CALL(dispatcher(), PostDelayedTask(_, 0));
+  EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, 0));
   EXPECT_TRUE(StartTrial(kURL));
   StartTrialTask();
   EXPECT_TRUE(connectivity_trial()->IsActive());
@@ -259,7 +259,7 @@
 }
 
 TEST_F(ConnectivityTrialTest, StartAttemptFailed) {
-  EXPECT_CALL(dispatcher(), PostDelayedTask(_, 0));
+  EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, 0));
   EXPECT_TRUE(StartTrial(kURL));
 
   // Expect that the request will be started -- return failure.
@@ -273,31 +273,31 @@
                       ConnectivityTrial::kStatusFailure))))
       .Times(1);
 
-  EXPECT_CALL(dispatcher(), PostDelayedTask(_, 0)).Times(0);
+  EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, 0)).Times(0);
   EXPECT_CALL(*http_request(), Stop());
 
   connectivity_trial()->StartTrialTask();
 }
 
 TEST_F(ConnectivityTrialTest, StartRepeated) {
-  EXPECT_CALL(dispatcher(), PostDelayedTask(_, 0)).Times(1);
+  EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, 0)).Times(1);
   EXPECT_TRUE(StartTrial(kURL));
 
   // A second call should cancel the existing trial and set up the new one.
   EXPECT_CALL(*http_request(), Stop());
-  EXPECT_CALL(dispatcher(), PostDelayedTask(_, 10)).Times(1);
+  EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, 10)).Times(1);
   EXPECT_TRUE(StartTrialWithDelay(kURL, 10));
 }
 
 TEST_F(ConnectivityTrialTest, StartTrialAfterDelay) {
   const int kDelaySeconds = 123;
   // The trial should be delayed by kDelaySeconds.
-  EXPECT_CALL(dispatcher(), PostDelayedTask(_, kDelaySeconds));
+  EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, kDelaySeconds));
   EXPECT_TRUE(StartTrialWithDelay(kURL, kDelaySeconds));
 }
 
 TEST_F(ConnectivityTrialTest, TrialRetry) {
-  EXPECT_CALL(dispatcher(), PostDelayedTask(_, 0));
+  EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, 0));
   EXPECT_TRUE(StartTrial(kURL));
 
   // Expect that the request will be started -- return failure.
@@ -308,12 +308,12 @@
 
   const int kRetryDelay = 7;
   EXPECT_CALL(*http_request(), Stop());
-  EXPECT_CALL(dispatcher(), PostDelayedTask(_, kRetryDelay)).Times(1);
+  EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, kRetryDelay)).Times(1);
   EXPECT_TRUE(connectivity_trial()->Retry(kRetryDelay));
 }
 
 TEST_F(ConnectivityTrialTest, TrialRetryFail) {
-  EXPECT_CALL(dispatcher(), PostDelayedTask(_, 0));
+  EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, 0));
   EXPECT_TRUE(StartTrial(kURL));
 
   EXPECT_CALL(*http_request(), Stop());
@@ -329,7 +329,7 @@
   int sec_between_attempts = 3;
 
   // Expect ConnectivityTrial to immediately post a task for the each attempt.
-  EXPECT_CALL(dispatcher(), PostDelayedTask(_, 0));
+  EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, 0));
   EXPECT_TRUE(StartTrial(kURL));
 
   // Expect that the request will be started and return the in progress status.
@@ -338,7 +338,7 @@
           Return(HTTPRequest::kResultInProgress));
 
   // Each HTTP request that gets started will have a request timeout.
-  EXPECT_CALL(dispatcher(), PostDelayedTask(_, kTrialTimeout * 1000))
+  EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, kTrialTimeout * 1000))
       .Times(num_failures);
 
   // Expect failures for all attempts but the last.
@@ -357,7 +357,7 @@
     connectivity_trial()->StartTrialTask();
     AdvanceTime(sec_between_attempts * 1000);
     EXPECT_CALL(*http_request(), Stop()).Times(2);
-    EXPECT_CALL(dispatcher(), PostDelayedTask(_, 0)).Times(1);
+    EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, 0)).Times(1);
     connectivity_trial()->RequestReadCallback(response_data);
     EXPECT_TRUE(connectivity_trial()->Retry(0));
   }
@@ -365,7 +365,7 @@
 
 
 TEST_F(ConnectivityTrialTest, ReadBadHeader) {
-  EXPECT_CALL(dispatcher(), PostDelayedTask(_, 0));
+  EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, 0));
   EXPECT_TRUE(StartTrial(kURL));
 
   StartTrialTask();
@@ -377,7 +377,7 @@
 }
 
 TEST_F(ConnectivityTrialTest, RequestTimeout) {
-  EXPECT_CALL(dispatcher(), PostDelayedTask(_, 0));
+  EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, 0));
   EXPECT_TRUE(StartTrial(kURL));
 
   StartTrialTask();
@@ -393,7 +393,7 @@
 }
 
 TEST_F(ConnectivityTrialTest, ReadPartialHeaderTimeout) {
-  EXPECT_CALL(dispatcher(), PostDelayedTask(_, 0));
+  EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, 0));
   EXPECT_TRUE(StartTrial(kURL));
 
   StartTrialTask();
@@ -417,7 +417,7 @@
   const string response_expected(ConnectivityTrial::kResponseExpected);
   const size_t partial_size = response_expected.length() / 2;
 
-  EXPECT_CALL(dispatcher(), PostDelayedTask(_, 0));
+  EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, 0));
   EXPECT_TRUE(StartTrial(kURL));
 
   StartTrialTask();
@@ -434,7 +434,7 @@
 TEST_F(ConnectivityTrialTest, ReadMatchingHeader) {
   const string kResponse("HTTP/9.8 204");
 
-  EXPECT_CALL(dispatcher(), PostDelayedTask(_, 0));
+  EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, 0));
   EXPECT_TRUE(StartTrial(kURL));
 
   StartTrialTask();
diff --git a/crypto_util_proxy.cc b/crypto_util_proxy.cc
index e8aeeac..26f64bd 100644
--- a/crypto_util_proxy.cc
+++ b/crypto_util_proxy.cc
@@ -192,7 +192,7 @@
   result_handler_ = result_handler;
   shim_job_timeout_callback_.Reset(Bind(&CryptoUtilProxy::HandleShimTimeout,
                                         AsWeakPtr()));
-  dispatcher_->PostDelayedTask(shim_job_timeout_callback_.callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE, shim_job_timeout_callback_.callback(),
                                 kShimJobTimeoutMilliseconds);
   do {
     if (file_io_->SetFdNonBlocking(shim_stdin_) ||
diff --git a/crypto_util_proxy_unittest.cc b/crypto_util_proxy_unittest.cc
index d942f98..953b2dd 100644
--- a/crypto_util_proxy_unittest.cc
+++ b/crypto_util_proxy_unittest.cc
@@ -145,7 +145,7 @@
         .WillOnce(Invoke(this,
                          &CryptoUtilProxyTest::HandleStartInMinijailWithPipes));
     // We should always schedule a shim timeout callback.
-    EXPECT_CALL(dispatcher_, PostDelayedTask(_, _));
+    EXPECT_CALL(dispatcher_, PostDelayedTask(_, _, _));
     // We don't allow file I/O to block.
     EXPECT_CALL(file_io_,
                 SetFdNonBlocking(kTestStdinFd))
diff --git a/daemon_task.cc b/daemon_task.cc
index 12f9dfc..2b4718c 100644
--- a/daemon_task.cc
+++ b/daemon_task.cc
@@ -148,7 +148,7 @@
   //                     -> DeviceInfo::Stop
   //                       -> Cellular::~Cellular
   //           -> Manager::RemoveTerminationAction
-  dispatcher_->PostTask(
+  dispatcher_->PostTask(FROM_HERE,
       Bind(&DaemonTask::StopAndReturnToMain, Unretained(this)));
 }
 
diff --git a/daemon_task_unittest.cc b/daemon_task_unittest.cc
index d7fe41c..1bc9e7a 100644
--- a/daemon_task_unittest.cc
+++ b/daemon_task_unittest.cc
@@ -70,7 +70,7 @@
 
   bool Quit(const base::Closure& completion_callback) override {
     quit_result_ = DaemonTask::Quit(completion_callback);
-    dispatcher_->PostTask(base::MessageLoop::QuitWhenIdleClosure());
+    dispatcher_->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
     return quit_result_;
   }
 
@@ -192,6 +192,7 @@
 
   // Run Daemon::Quit() after the daemon starts running.
   dispatcher_->PostTask(
+      FROM_HERE,
       Bind(IgnoreResult(&DaemonTask::Quit), Unretained(&daemon_),
            Bind(&DaemonTaskTest::BreakTerminationLoop, Unretained(this))));
 
diff --git a/dbus/chromeos_dbus_objectmanager_proxy.cc b/dbus/chromeos_dbus_objectmanager_proxy.cc
index b233a54..d42081e 100644
--- a/dbus/chromeos_dbus_objectmanager_proxy.cc
+++ b/dbus/chromeos_dbus_objectmanager_proxy.cc
@@ -95,9 +95,9 @@
   // The callback might invoke calls to the ObjectProxy, so defer the callback
   // to event loop.
   if (available && !service_appeared_callback_.is_null()) {
-    dispatcher_->PostTask(service_appeared_callback_);
+    dispatcher_->PostTask(FROM_HERE, service_appeared_callback_);
   } else if (!available && !service_vanished_callback_.is_null()) {
-    dispatcher_->PostTask(service_vanished_callback_);
+    dispatcher_->PostTask(FROM_HERE, service_vanished_callback_);
   }
   service_available_ = available;
 }
diff --git a/dbus/chromeos_dhcpcd_listener.cc b/dbus/chromeos_dhcpcd_listener.cc
index b101a4d..a3494e1 100644
--- a/dbus/chromeos_dhcpcd_listener.cc
+++ b/dbus/chromeos_dhcpcd_listener.cc
@@ -123,7 +123,7 @@
                                                      &pid,
                                                      &reason,
                                                      &configurations)) {
-      dispatcher_->PostTask(
+      dispatcher_->PostTask(FROM_HERE,
           base::Bind(&ChromeosDHCPCDListener::EventSignal,
                      weak_factory_.GetWeakPtr(),
                      sender, pid, reason, configurations));
@@ -136,7 +136,7 @@
                                                      nullptr,
                                                      &pid,
                                                      &status)) {
-      dispatcher_->PostTask(
+      dispatcher_->PostTask(FROM_HERE,
           base::Bind(&ChromeosDHCPCDListener::StatusChangedSignal,
                      weak_factory_.GetWeakPtr(),
                      sender, pid, status));
diff --git a/dbus/chromeos_modem_manager_proxy.cc b/dbus/chromeos_modem_manager_proxy.cc
index 6b08d58..245ae8d 100644
--- a/dbus/chromeos_modem_manager_proxy.cc
+++ b/dbus/chromeos_modem_manager_proxy.cc
@@ -107,9 +107,9 @@
   // The callback might invoke calls to the ObjectProxy, so defer the callback
   // to event loop.
   if (available && !service_appeared_callback_.is_null()) {
-    dispatcher_->PostTask(service_appeared_callback_);
+    dispatcher_->PostTask(FROM_HERE, service_appeared_callback_);
   } else if (!available && !service_vanished_callback_.is_null()) {
-    dispatcher_->PostTask(service_vanished_callback_);
+    dispatcher_->PostTask(FROM_HERE, service_vanished_callback_);
   }
   service_available_ = available;
 }
diff --git a/dbus/chromeos_power_manager_proxy.cc b/dbus/chromeos_power_manager_proxy.cc
index 2792278..3c67eaf 100644
--- a/dbus/chromeos_power_manager_proxy.cc
+++ b/dbus/chromeos_power_manager_proxy.cc
@@ -320,7 +320,7 @@
   // The callback might invoke calls to the ObjectProxy, so defer the callback
   // to event loop.
   if (!service_appeared_callback_.is_null()) {
-    dispatcher_->PostTask(service_appeared_callback_);
+    dispatcher_->PostTask(FROM_HERE, service_appeared_callback_);
   }
 
   service_available_ = true;
@@ -334,14 +334,14 @@
     // The callback might invoke calls to the ObjectProxy, so defer the
     // callback to event loop.
     if (!service_vanished_callback_.is_null()) {
-        dispatcher_->PostTask(service_vanished_callback_);
+        dispatcher_->PostTask(FROM_HERE, service_vanished_callback_);
     }
     service_available_ = false;
   } else {
     // The callback might invoke calls to the ObjectProxy, so defer the
     // callback to event loop.
     if (!service_appeared_callback_.is_null()) {
-      dispatcher_->PostTask(service_appeared_callback_);
+      dispatcher_->PostTask(FROM_HERE, service_appeared_callback_);
     }
     service_available_ = true;
   }
diff --git a/dbus/chromeos_supplicant_process_proxy.cc b/dbus/chromeos_supplicant_process_proxy.cc
index 34fd819..2c5325c 100644
--- a/dbus/chromeos_supplicant_process_proxy.cc
+++ b/dbus/chromeos_supplicant_process_proxy.cc
@@ -234,9 +234,9 @@
   // The callback might invoke calls to the ObjectProxy, so defer the callback
   // to event loop.
   if (available && !service_appeared_callback_.is_null()) {
-    dispatcher_->PostTask(service_appeared_callback_);
+    dispatcher_->PostTask(FROM_HERE, service_appeared_callback_);
   } else if (!available && !service_vanished_callback_.is_null()) {
-    dispatcher_->PostTask(service_vanished_callback_);
+    dispatcher_->PostTask(FROM_HERE, service_vanished_callback_);
   }
   service_available_ = available;
 }
diff --git a/dbus/chromeos_wimax_manager_proxy.cc b/dbus/chromeos_wimax_manager_proxy.cc
index 430887b..3a134b9 100644
--- a/dbus/chromeos_wimax_manager_proxy.cc
+++ b/dbus/chromeos_wimax_manager_proxy.cc
@@ -126,9 +126,9 @@
   // The callback might invoke calls to the ObjectProxy, so defer the callback
   // to event loop.
   if (available && !service_appeared_callback_.is_null()) {
-    dispatcher_->PostTask(service_appeared_callback_);
+    dispatcher_->PostTask(FROM_HERE, service_appeared_callback_);
   } else if (!available && !service_vanished_callback_.is_null()) {
-    dispatcher_->PostTask(service_vanished_callback_);
+    dispatcher_->PostTask(FROM_HERE, service_vanished_callback_);
   }
   service_available_ = available;
 }
diff --git a/device.cc b/device.cc
index 4641dad..cd90dc8 100644
--- a/device.cc
+++ b/device.cc
@@ -682,7 +682,8 @@
   int64_t delay = static_cast<int64_t>(lifetime_seconds) * 1000;
   ipv6_dns_server_expired_callback_.Reset(
       base::Bind(&Device::IPv6DNSServerExpired, base::Unretained(this)));
-  dispatcher_->PostDelayedTask(ipv6_dns_server_expired_callback_.callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE,
+                               ipv6_dns_server_expired_callback_.callback(),
                                delay);
 }
 
@@ -811,7 +812,7 @@
                                           weak_ptr_factory_.GetWeakPtr()));
   ipconfig_->RegisterExpireCallback(Bind(&Device::OnIPConfigExpired,
                                          weak_ptr_factory_.GetWeakPtr()));
-  dispatcher_->PostTask(Bind(&Device::ConfigureStaticIPTask,
+  dispatcher_->PostTask(FROM_HERE, Bind(&Device::ConfigureStaticIPTask,
                              weak_ptr_factory_.GetWeakPtr()));
   if (!ipconfig_->RequestIP()) {
     return false;
@@ -850,7 +851,7 @@
   EnableIPv6();
   ipconfig_ = new IPConfig(control_interface_, link_name_);
   ipconfig_->set_properties(properties);
-  dispatcher_->PostTask(Bind(&Device::OnIPConfigUpdated,
+  dispatcher_->PostTask(FROM_HERE, Bind(&Device::OnIPConfigUpdated,
                              weak_ptr_factory_.GetWeakPtr(), ipconfig_, true));
 }
 
@@ -1117,7 +1118,7 @@
   ipconfig->RestoreSavedIPParameters(
       selected_service_->mutable_static_ip_parameters());
 
-  dispatcher_->PostTask(Bind(&Device::ConfigureStaticIPTask,
+  dispatcher_->PostTask(FROM_HERE, Bind(&Device::ConfigureStaticIPTask,
                              weak_ptr_factory_.GetWeakPtr()));
 }
 
@@ -1164,7 +1165,7 @@
     // failure is detected in the next 5 minutes.
     reliable_link_callback_.Reset(
         base::Bind(&Device::OnReliableLink, base::Unretained(this)));
-    dispatcher_->PostDelayedTask(
+    dispatcher_->PostDelayedTask(FROM_HERE,
         reliable_link_callback_.callback(),
         kLinkUnreliableThresholdSeconds * 1000);
   }
diff --git a/device_info.cc b/device_info.cc
index 7a2f13f..cfa7bd6 100644
--- a/device_info.cc
+++ b/device_info.cc
@@ -167,7 +167,8 @@
                              RTNLHandler::kRequestAddr);
   request_link_statistics_callback_.Reset(
       Bind(&DeviceInfo::RequestLinkStatistics, AsWeakPtr()));
-  dispatcher_->PostDelayedTask(request_link_statistics_callback_.callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE,
+                               request_link_statistics_callback_.callback(),
                                kRequestLinkStatisticsIntervalMilliseconds);
 }
 
@@ -1135,7 +1136,7 @@
   delayed_devices_.insert(interface_index);
   delayed_devices_callback_.Reset(
       Bind(&DeviceInfo::DelayedDeviceCreationTask, AsWeakPtr()));
-  dispatcher_->PostDelayedTask(delayed_devices_callback_.callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE, delayed_devices_callback_.callback(),
                                kDelayedDeviceCreationSeconds * 1000);
 }
 
@@ -1216,7 +1217,8 @@
 
 void DeviceInfo::RequestLinkStatistics() {
   rtnl_handler_->RequestDump(RTNLHandler::kRequestLink);
-  dispatcher_->PostDelayedTask(request_link_statistics_callback_.callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE,
+                               request_link_statistics_callback_.callback(),
                                kRequestLinkStatisticsIntervalMilliseconds);
 }
 
diff --git a/device_info_unittest.cc b/device_info_unittest.cc
index 9d731fc..3548c1e 100644
--- a/device_info_unittest.cc
+++ b/device_info_unittest.cc
@@ -90,7 +90,8 @@
       const IOHandler::ErrorCallback& /*error_callback*/) {
     return nullptr;
   }
-  MOCK_METHOD2(PostDelayedTask, void(const base::Closure& task,
+  MOCK_METHOD3(PostDelayedTask, void(const tracked_objects::Location& location,
+                                     const base::Closure& task,
                                      int64_t delay_ms));
 };
 
@@ -299,7 +300,7 @@
   EXPECT_CALL(rtnl_handler_, RequestDump(RTNLHandler::kRequestLink |
                                          RTNLHandler::kRequestAddr));
   EXPECT_CALL(dispatcher_, PostDelayedTask(
-      _, DeviceInfo::kRequestLinkStatisticsIntervalMilliseconds));
+      _, _, DeviceInfo::kRequestLinkStatisticsIntervalMilliseconds));
   device_info_.Start();
   EXPECT_TRUE(device_info_.link_listener_.get());
   EXPECT_TRUE(device_info_.address_listener_.get());
@@ -327,7 +328,7 @@
 TEST_F(DeviceInfoTest, RequestLinkStatistics) {
   EXPECT_CALL(rtnl_handler_, RequestDump(RTNLHandler::kRequestLink));
   EXPECT_CALL(dispatcher_, PostDelayedTask(
-      _, DeviceInfo::kRequestLinkStatisticsIntervalMilliseconds));
+      _, _, DeviceInfo::kRequestLinkStatisticsIntervalMilliseconds));
   device_info_.RequestLinkStatistics();
 }
 
@@ -659,7 +660,7 @@
   EXPECT_CALL(routing_table_, FlushRoutes(_)).Times(0);
   EXPECT_CALL(rtnl_handler_, RemoveInterfaceAddress(_, _)).Times(0);
   EXPECT_CALL(dispatcher_,
-              PostDelayedTask(_, GetDelayedDeviceCreationMilliseconds()));
+              PostDelayedTask(_, _, GetDelayedDeviceCreationMilliseconds()));
   EXPECT_TRUE(GetDelayedDevices().empty());
   EXPECT_FALSE(CreateDevice(
       kTestDeviceName, "address", kTestDeviceIndex, Technology::kCDCEthernet));
diff --git a/dhcp/dhcp_config.cc b/dhcp/dhcp_config.cc
index 85637cb..9aa406a 100644
--- a/dhcp/dhcp_config.cc
+++ b/dhcp/dhcp_config.cc
@@ -285,6 +285,7 @@
       Bind(&DHCPConfig::ProcessAcquisitionTimeout,
            weak_ptr_factory_.GetWeakPtr()));
   dispatcher_->PostDelayedTask(
+      FROM_HERE,
       lease_acquisition_timeout_callback_.callback(),
       lease_acquisition_timeout_seconds_ * 1000);
 }
@@ -312,6 +313,7 @@
       Bind(&DHCPConfig::ProcessExpirationTimeout,
            weak_ptr_factory_.GetWeakPtr()));
   dispatcher_->PostDelayedTask(
+      FROM_HERE,
       lease_expiration_callback_.callback(),
       lease_duration_seconds * 1000);
 }
diff --git a/dhcp/dhcp_provider.cc b/dhcp/dhcp_provider.cc
index 97098b3..758afac 100644
--- a/dhcp/dhcp_provider.cc
+++ b/dhcp/dhcp_provider.cc
@@ -146,9 +146,11 @@
   SLOG(this, 2) << __func__ << " pid: " << pid;
   configs_.erase(pid);
   recently_unbound_pids_.insert(pid);
-  dispatcher_->PostDelayedTask(base::Bind(&DHCPProvider::RetireUnboundPID,
+  dispatcher_->PostDelayedTask(FROM_HERE,
+                               base::Bind(&DHCPProvider::RetireUnboundPID,
                                           base::Unretained(this),
-                                          pid), kUnbindDelayMilliseconds);
+                                          pid),
+                               kUnbindDelayMilliseconds);
 }
 
 void DHCPProvider::RetireUnboundPID(int pid) {
diff --git a/dhcp/dhcp_provider_unittest.cc b/dhcp/dhcp_provider_unittest.cc
index b2ace3b..98f5791 100644
--- a/dhcp/dhcp_provider_unittest.cc
+++ b/dhcp/dhcp_provider_unittest.cc
@@ -108,7 +108,8 @@
   EXPECT_FALSE(provider_->IsRecentlyUnbound(kPid));
 
   base::Closure task;
-  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _));  // TODO(pstew): crbug/502320
+  // TODO(pstew): crbug.com/502320
+  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _, _));
   provider_->UnbindPID(kPid);
   EXPECT_EQ(nullptr, provider_->GetConfig(kPid));
   EXPECT_TRUE(provider_->IsRecentlyUnbound(kPid));
diff --git a/dns_client.cc b/dns_client.cc
index 4e39045..195e16e 100644
--- a/dns_client.cc
+++ b/dns_client.cc
@@ -235,7 +235,7 @@
   SLOG(this, 3) << "In " << __func__;
   running_ = false;
   timeout_closure_.Cancel();
-  dispatcher_->PostTask(Bind(&DNSClient::HandleCompletion,
+  dispatcher_->PostTask(FROM_HERE, Bind(&DNSClient::HandleCompletion,
                              weak_ptr_factory_.GetWeakPtr()));
 
   if (status == ARES_SUCCESS &&
@@ -369,7 +369,7 @@
     //    in the posted task.
     running_ = false;
     error_.Populate(Error::kOperationTimeout, kErrorTimedOut);
-    dispatcher_->PostTask(Bind(&DNSClient::HandleCompletion,
+    dispatcher_->PostTask(FROM_HERE, Bind(&DNSClient::HandleCompletion,
                                weak_ptr_factory_.GetWeakPtr()));
     return false;
   } else {
@@ -379,7 +379,7 @@
                                         &max, &ret_tv);
     timeout_closure_.Reset(
         Bind(&DNSClient::HandleTimeout, weak_ptr_factory_.GetWeakPtr()));
-    dispatcher_->PostDelayedTask(timeout_closure_.callback(),
+    dispatcher_->PostDelayedTask(FROM_HERE, timeout_closure_.callback(),
                                  tv->tv_sec * 1000 + tv->tv_usec / 1000);
   }
 
diff --git a/dns_client_unittest.cc b/dns_client_unittest.cc
index 4a236c4..16a6e4b 100644
--- a/dns_client_unittest.cc
+++ b/dns_client_unittest.cc
@@ -169,7 +169,7 @@
                 CreateReadyHandler(kAresFd, IOHandler::kModeInput, _))
         .WillOnce(ReturnNew<IOHandler>());
     SetActive();
-    EXPECT_CALL(dispatcher_, PostDelayedTask(_, kAresWaitMS));
+    EXPECT_CALL(dispatcher_, PostDelayedTask(_, _, kAresWaitMS));
     Error error;
     ASSERT_TRUE(dns_client_->Start(kGoodName, &error));
     EXPECT_TRUE(error.IsSuccess());
@@ -205,7 +205,7 @@
   }
 
   void ExpectPostCompletionTask() {
-    EXPECT_CALL(dispatcher_, PostTask(_));
+    EXPECT_CALL(dispatcher_, PostTask(_, _));
   }
 
   void ExpectReset() {
@@ -307,7 +307,7 @@
   // Insert an intermediate HandleTimeout callback.
   AdvanceTime(kAresWaitMS);
   EXPECT_CALL(ares_, ProcessFd(kAresChannel, ARES_SOCKET_BAD, ARES_SOCKET_BAD));
-  EXPECT_CALL(dispatcher_, PostDelayedTask(_, kAresWaitMS));
+  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _, kAresWaitMS));
   CallTimeout();
   AdvanceTime(kAresWaitMS);
   TestValidCompletion();
@@ -318,7 +318,7 @@
   // Insert an intermediate HandleDNSRead callback.
   AdvanceTime(kAresWaitMS);
   EXPECT_CALL(ares_, ProcessFd(kAresChannel, kAresFd, ARES_SOCKET_BAD));
-  EXPECT_CALL(dispatcher_, PostDelayedTask(_, kAresWaitMS));
+  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _, kAresWaitMS));
   CallDNSRead();
   AdvanceTime(kAresWaitMS);
   TestValidCompletion();
@@ -329,7 +329,7 @@
   // Insert an intermediate HandleDNSWrite callback.
   AdvanceTime(kAresWaitMS);
   EXPECT_CALL(ares_, ProcessFd(kAresChannel, ARES_SOCKET_BAD, kAresFd));
-  EXPECT_CALL(dispatcher_, PostDelayedTask(_, kAresWaitMS));
+  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _, kAresWaitMS));
   CallDNSWrite();
   AdvanceTime(kAresWaitMS);
   TestValidCompletion();
@@ -406,7 +406,7 @@
   EXPECT_CALL(dispatcher_,
               CreateReadyHandler(kAresFd, IOHandler::kModeInput, _))
       .WillOnce(Return(io_handler));
-  EXPECT_CALL(dispatcher_, PostDelayedTask(_, kAresWaitMS));
+  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _, kAresWaitMS));
   SetActive();
   Error error;
   ASSERT_TRUE(dns_client_->Start(kGoodName, &error));
@@ -414,7 +414,7 @@
   SetInActive();
   EXPECT_CALL(*io_handler, Die());
   EXPECT_CALL(ares_, ProcessFd(kAresChannel, kAresFd, ARES_SOCKET_BAD));
-  EXPECT_CALL(dispatcher_, PostDelayedTask(_, kAresWaitMS));
+  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _, kAresWaitMS));
   CallDNSRead();
   EXPECT_CALL(ares_, Destroy(kAresChannel));
 }
@@ -427,7 +427,7 @@
   EXPECT_CALL(dispatcher_,
               CreateReadyHandler(kAresFd, IOHandler::kModeInput, _))
       .WillOnce(Return(io_handler));
-  EXPECT_CALL(dispatcher_, PostDelayedTask(_, kAresWaitMS));
+  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _, kAresWaitMS));
   SetActive();
   Error error;
   ASSERT_TRUE(dns_client_->Start(kGoodName, &error));
diff --git a/dns_server_tester.cc b/dns_server_tester.cc
index 8150352..66780bc 100644
--- a/dns_server_tester.cc
+++ b/dns_server_tester.cc
@@ -77,7 +77,7 @@
 void DNSServerTester::StartAttempt(int delay_ms) {
   start_attempt_.Reset(Bind(&DNSServerTester::StartAttemptTask,
                             weak_ptr_factory_.GetWeakPtr()));
-  dispatcher_->PostDelayedTask(start_attempt_.callback(), delay_ms);
+  dispatcher_->PostDelayedTask(FROM_HERE, start_attempt_.callback(), delay_ms);
 }
 
 void DNSServerTester::StartAttemptTask() {
diff --git a/dns_server_tester_unittest.cc b/dns_server_tester_unittest.cc
index dac4ec7..754e0ef 100644
--- a/dns_server_tester_unittest.cc
+++ b/dns_server_tester_unittest.cc
@@ -120,11 +120,11 @@
 
 TEST_F(DNSServerTesterTest, StartAttempt) {
   // Start attempt with no delay.
-  EXPECT_CALL(dispatcher(), PostDelayedTask(_, 0));
+  EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, 0));
   dns_server_tester()->StartAttempt(0);
 
   // Start attempt with delay.
-  EXPECT_CALL(dispatcher(), PostDelayedTask(_, 100));
+  EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, 100));
   dns_server_tester()->StartAttempt(100);
 }
 
@@ -169,7 +169,7 @@
   // DNS test attempt failed with retry_until_success_ being set.
   dns_server_tester()->retry_until_success_ = true;
   EXPECT_CALL(callback_target(), ResultCallback(_)).Times(0);
-  EXPECT_CALL(dispatcher(), PostDelayedTask(_, _)).Times(1);
+  EXPECT_CALL(dispatcher(), PostDelayedTask(_, _, _)).Times(1);
   dns_server_tester()->CompleteAttempt(DNSServerTester::kStatusFailure);
 }
 
diff --git a/ethernet/ethernet.cc b/ethernet/ethernet.cc
index 588f62d..1e24b59 100644
--- a/ethernet/ethernet.cc
+++ b/ethernet/ethernet.cc
@@ -225,7 +225,8 @@
   try_eap_authentication_callback_.Reset(
       Bind(&Ethernet::TryEapAuthenticationTask,
            weak_ptr_factory_.GetWeakPtr()));
-  dispatcher()->PostTask(try_eap_authentication_callback_.callback());
+  dispatcher()->PostTask(FROM_HERE,
+                         try_eap_authentication_callback_.callback());
 }
 
 void Ethernet::BSSAdded(const string& path, const KeyValueStore& properties) {
@@ -240,14 +241,16 @@
   string subject;
   uint32_t depth;
   if (WPASupplicant::ExtractRemoteCertification(properties, &subject, &depth)) {
-    dispatcher()->PostTask(Bind(&Ethernet::CertificationTask,
+    dispatcher()->PostTask(FROM_HERE,
+                           Bind(&Ethernet::CertificationTask,
                                 weak_ptr_factory_.GetWeakPtr(),
                                 subject, depth));
   }
 }
 
 void Ethernet::EAPEvent(const string& status, const string& parameter) {
-  dispatcher()->PostTask(Bind(&Ethernet::EAPEventTask,
+  dispatcher()->PostTask(FROM_HERE,
+                         Bind(&Ethernet::EAPEventTask,
                               weak_ptr_factory_.GetWeakPtr(),
                               status,
                               parameter));
@@ -258,6 +261,7 @@
     return;
   }
   dispatcher()->PostTask(
+      FROM_HERE,
       Bind(&Ethernet::SupplicantStateChangedTask,
            weak_ptr_factory_.GetWeakPtr(),
            properties.GetString(WPASupplicant::kInterfacePropertyState)));
diff --git a/ethernet/ethernet_unittest.cc b/ethernet/ethernet_unittest.cc
index 38cacb1..3ae2ace 100644
--- a/ethernet/ethernet_unittest.cc
+++ b/ethernet/ethernet_unittest.cc
@@ -342,7 +342,7 @@
   EXPECT_EQ(nullptr, GetSelectedService().get());
   EXPECT_CALL(dhcp_provider_, CreateIPv4Config(_, _, _, _)).Times(0);
   EXPECT_CALL(*dhcp_config_.get(), RequestIP()).Times(0);
-  EXPECT_CALL(dispatcher_, PostTask(_)).Times(0);
+  EXPECT_CALL(dispatcher_, PostTask(_, _)).Times(0);
   EXPECT_CALL(*mock_service_, SetState(_)).Times(0);
   ethernet_->ConnectTo(mock_service_.get());
   EXPECT_EQ(nullptr, GetSelectedService().get());
@@ -356,7 +356,7 @@
   EXPECT_CALL(dhcp_provider_, CreateIPv4Config(_, _, _, _)).
       WillOnce(Return(dhcp_config_));
   EXPECT_CALL(*dhcp_config_.get(), RequestIP()).WillOnce(Return(false));
-  EXPECT_CALL(dispatcher_, PostTask(_));  // Posts ConfigureStaticIPTask.
+  EXPECT_CALL(dispatcher_, PostTask(_, _));  // Posts ConfigureStaticIPTask.
   EXPECT_CALL(*mock_service_, SetState(Service::kStateFailure));
   ethernet_->ConnectTo(mock_service_.get());
   EXPECT_EQ(mock_service_, GetSelectedService().get());
@@ -370,7 +370,7 @@
   EXPECT_CALL(dhcp_provider_, CreateIPv4Config(_, _, _, _)).
       WillOnce(Return(dhcp_config_));
   EXPECT_CALL(*dhcp_config_.get(), RequestIP()).WillOnce(Return(true));
-  EXPECT_CALL(dispatcher_, PostTask(_));  // Posts ConfigureStaticIPTask.
+  EXPECT_CALL(dispatcher_, PostTask(_, _));  // Posts ConfigureStaticIPTask.
   EXPECT_CALL(*mock_service_, SetState(Service::kStateConfiguring));
   ethernet_->ConnectTo(mock_service_.get());
   EXPECT_EQ(GetService().get(), GetSelectedService().get());
@@ -387,7 +387,7 @@
   EXPECT_CALL(*eap_listener_, Stop());
   EXPECT_CALL(ethernet_eap_provider_,
               SetCredentialChangeCallback(ethernet_.get(), _));
-  EXPECT_CALL(dispatcher_, PostTask(_));  // Posts TryEapAuthenticationTask.
+  EXPECT_CALL(dispatcher_, PostTask(_, _));  // Posts TryEapAuthenticationTask.
   TriggerOnEapDetected();
   EXPECT_TRUE(GetIsEapDetected());
 }
diff --git a/event_dispatcher.cc b/event_dispatcher.cc
index aed8c6a..cce27b1 100644
--- a/event_dispatcher.cc
+++ b/event_dispatcher.cc
@@ -26,6 +26,7 @@
 
 using base::Callback;
 using base::Closure;
+using tracked_objects::Location;
 
 namespace shill {
 
@@ -44,13 +45,14 @@
   base::RunLoop().RunUntilIdle();
 }
 
-void EventDispatcher::PostTask(const Closure& task) {
-  base::MessageLoop::current()->PostTask(FROM_HERE, task);
+void EventDispatcher::PostTask(const Location& location, const Closure& task) {
+  base::MessageLoop::current()->PostTask(location, task);
 }
 
-void EventDispatcher::PostDelayedTask(const Closure& task, int64_t delay_ms) {
+void EventDispatcher::PostDelayedTask(const Location& location,
+                                      const Closure& task, int64_t delay_ms) {
   base::MessageLoop::current()->PostDelayedTask(
-      FROM_HERE, task, base::TimeDelta::FromMilliseconds(delay_ms));
+      location, task, base::TimeDelta::FromMilliseconds(delay_ms));
 }
 
 // TODO(zqiu): Remove all reference to this function and use the
diff --git a/event_dispatcher.h b/event_dispatcher.h
index 85dc10d..b244d34 100644
--- a/event_dispatcher.h
+++ b/event_dispatcher.h
@@ -23,6 +23,7 @@
 #include <base/macros.h>
 #include <base/memory/ref_counted.h>
 #include <base/message_loop/message_loop.h>
+#include <base/tracked_objects.h>
 
 #include "shill/net/io_handler_factory_container.h"
 
@@ -48,8 +49,10 @@
 
   // These are thin wrappers around calls of the same name in
   // <base/message_loop_proxy.h>
-  virtual void PostTask(const base::Closure& task);
-  virtual void PostDelayedTask(const base::Closure& task, int64_t delay_ms);
+  virtual void PostTask(const tracked_objects::Location& location,
+                        const base::Closure& task);
+  virtual void PostDelayedTask(const tracked_objects::Location& location,
+                               const base::Closure& task, int64_t delay_ms);
 
   virtual IOHandler* CreateInputHandler(
       int fd,
diff --git a/external_task.cc b/external_task.cc
index 14768ab..8e71ee8 100644
--- a/external_task.cc
+++ b/external_task.cc
@@ -49,7 +49,7 @@
 
 void ExternalTask::DestroyLater(EventDispatcher* dispatcher) {
   // Passes ownership of |this| to Destroy.
-  dispatcher->PostTask(base::Bind(&Destroy, this));
+  dispatcher->PostTask(FROM_HERE, base::Bind(&Destroy, this));
 }
 
 bool ExternalTask::Start(const FilePath& program,
diff --git a/hook_table.cc b/hook_table.cc
index 0dfc512..0139c94 100644
--- a/hook_table.cc
+++ b/hook_table.cc
@@ -82,7 +82,8 @@
   }
   done_callback_ = done;
   timeout_callback_.Reset(Bind(&HookTable::ActionsTimedOut, Unretained(this)));
-  event_dispatcher_->PostDelayedTask(timeout_callback_.callback(), timeout_ms);
+  event_dispatcher_->PostDelayedTask(
+      FROM_HERE, timeout_callback_.callback(), timeout_ms);
 
   // Mark all actions as having started before we execute any actions.
   // Otherwise, if the first action completes inline, its call to
diff --git a/hook_table_unittest.cc b/hook_table_unittest.cc
index dc47938..964151f 100644
--- a/hook_table_unittest.cc
+++ b/hook_table_unittest.cc
@@ -135,7 +135,8 @@
   hook_table_.Run(kTimeout, done_callback);
 
   // Cause the event dispatcher to exit after kTimeout + 1 ms.
-  event_dispatcher_.PostDelayedTask(base::MessageLoop::QuitWhenIdleClosure(),
+  event_dispatcher_.PostDelayedTask(FROM_HERE,
+                                    base::MessageLoop::QuitWhenIdleClosure(),
                                     kTimeout + 1);
   event_dispatcher_.DispatchForever();
   EXPECT_TRUE(GetDoneCallback()->is_null());
@@ -182,7 +183,8 @@
   hook_table_.ActionComplete(kName1);
   hook_table_.ActionComplete(kName3);
   // Cause the event dispatcher to exit after kTimeout + 1 ms.
-  event_dispatcher_.PostDelayedTask(base::MessageLoop::QuitWhenIdleClosure(),
+  event_dispatcher_.PostDelayedTask(FROM_HERE,
+                                    base::MessageLoop::QuitWhenIdleClosure(),
                                     kTimeout + 1);
   event_dispatcher_.DispatchForever();
 }
diff --git a/http_request.cc b/http_request.cc
index 015146c..0d59752 100644
--- a/http_request.cc
+++ b/http_request.cc
@@ -264,7 +264,7 @@
   timeout_result_ = timeout_result;
   timeout_closure_.Reset(
       Bind(&HTTPRequest::TimeoutTask, weak_ptr_factory_.GetWeakPtr()));
-  dispatcher_->PostDelayedTask(timeout_closure_.callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE, timeout_closure_.callback(),
                                timeout_seconds * 1000);
 }
 
diff --git a/http_request_unittest.cc b/http_request_unittest.cc
index dc1f4c6..586eb74 100644
--- a/http_request_unittest.cc
+++ b/http_request_unittest.cc
@@ -194,7 +194,7 @@
     EXPECT_CALL(*connection_.get(), ReleaseRouting());
   }
   void ExpectSetTimeout(int timeout) {
-    EXPECT_CALL(dispatcher_, PostDelayedTask(_, timeout * 1000));
+    EXPECT_CALL(dispatcher_, PostDelayedTask(_, _, timeout * 1000));
   }
   void ExpectSetConnectTimeout() {
     ExpectSetTimeout(HTTPRequest::kConnectTimeoutSeconds);
diff --git a/icmp_session.cc b/icmp_session.cc
index ce7a8d2..b036e12 100644
--- a/icmp_session.cc
+++ b/icmp_session.cc
@@ -83,11 +83,11 @@
   result_callback_ = result_callback;
   timeout_callback_.Reset(Bind(&IcmpSession::ReportResultAndStopSession,
                                weak_ptr_factory_.GetWeakPtr()));
-  dispatcher_->PostDelayedTask(timeout_callback_.callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE, timeout_callback_.callback(),
                                kTimeoutSeconds * 1000);
   seq_num_to_sent_recv_time_.clear();
   received_echo_reply_seq_numbers_.clear();
-  dispatcher_->PostTask(Bind(&IcmpSession::TransmitEchoRequestTask,
+  dispatcher_->PostTask(FROM_HERE, Bind(&IcmpSession::TransmitEchoRequestTask,
                              weak_ptr_factory_.GetWeakPtr(), destination));
 
   return true;
@@ -153,7 +153,7 @@
   // requests are sent.
 
   if (seq_num_to_sent_recv_time_.size() != kTotalNumEchoRequests) {
-    dispatcher_->PostDelayedTask(
+    dispatcher_->PostDelayedTask(FROM_HERE,
         Bind(&IcmpSession::TransmitEchoRequestTask,
              weak_ptr_factory_.GetWeakPtr(), destination),
         kEchoRequestIntervalSeconds * 1000);
diff --git a/icmp_session_unittest.cc b/icmp_session_unittest.cc
index f5421ae..86f0887 100644
--- a/icmp_session_unittest.cc
+++ b/icmp_session_unittest.cc
@@ -93,8 +93,8 @@
     EXPECT_CALL(*icmp_, IsStarted());
     EXPECT_CALL(*icmp_, Start()).WillOnce(Return(true));
     EXPECT_CALL(dispatcher_, CreateInputHandler(icmp_->socket(), _, _));
-    EXPECT_CALL(dispatcher_, PostDelayedTask(_, GetTimeoutSeconds() * 1000));
-    EXPECT_CALL(dispatcher_, PostTask(_));
+    EXPECT_CALL(dispatcher_, PostDelayedTask(_, _, GetTimeoutSeconds() * 1000));
+    EXPECT_CALL(dispatcher_, PostTask(_, _));
     EXPECT_TRUE(Start(destination));
     EXPECT_TRUE(GetSeqNumToSentRecvTime()->empty());
     EXPECT_TRUE(GetReceivedEchoReplySeqNumbers()->empty());
@@ -199,8 +199,8 @@
   // Since an ICMP session is already started, we should fail to start it again.
   EXPECT_CALL(*icmp_, Start()).Times(0);
   EXPECT_CALL(dispatcher_, CreateInputHandler(_, _, _)).Times(0);
-  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _)).Times(0);
-  EXPECT_CALL(dispatcher_, PostTask(_)).Times(0);
+  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _, _)).Times(0);
+  EXPECT_CALL(dispatcher_, PostTask(_, _)).Times(0);
   EXPECT_FALSE(Start(ipv4_destination));
 }
 
@@ -242,7 +242,7 @@
   now = testing_clock_.NowTicks();
   SetCurrentSequenceNumber(kIcmpEchoReply1_SeqNum);
   EXPECT_CALL(dispatcher_,
-              PostDelayedTask(_, GetEchoRequestIntervalSeconds() * 1000));
+              PostDelayedTask(_, _, GetEchoRequestIntervalSeconds() * 1000));
   TransmitEchoRequestTask(ipv4_destination, true);
   EXPECT_TRUE(GetReceivedEchoReplySeqNumbers()->empty());
   EXPECT_EQ(1, GetSeqNumToSentRecvTime()->size());
@@ -268,7 +268,7 @@
   testing_clock_.Advance(kSentTime2 - now);
   now = testing_clock_.NowTicks();
   EXPECT_CALL(dispatcher_,
-              PostDelayedTask(_, GetEchoRequestIntervalSeconds() * 1000));
+              PostDelayedTask(_, _, GetEchoRequestIntervalSeconds() * 1000));
   TransmitEchoRequestTask(ipv4_destination, true);
   EXPECT_EQ(1, GetReceivedEchoReplySeqNumbers()->size());
   EXPECT_EQ(2, GetSeqNumToSentRecvTime()->size());
@@ -279,7 +279,7 @@
   // Sending final request.
   testing_clock_.Advance(kSentTime3 - now);
   now = testing_clock_.NowTicks();
-  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _)).Times(0);
+  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _, _)).Times(0);
   EXPECT_CALL(*icmp_, Stop()).Times(0);
   TransmitEchoRequestTask(ipv4_destination, true);
   EXPECT_EQ(1, GetReceivedEchoReplySeqNumbers()->size());
@@ -365,7 +365,7 @@
   now = testing_clock_.NowTicks();
   SetCurrentSequenceNumber(kIcmpEchoReply1_SeqNum);
   EXPECT_CALL(dispatcher_,
-              PostDelayedTask(_, GetEchoRequestIntervalSeconds() * 1000));
+              PostDelayedTask(_, _, GetEchoRequestIntervalSeconds() * 1000));
   TransmitEchoRequestTask(ipv4_destination, true);
   EXPECT_TRUE(GetReceivedEchoReplySeqNumbers()->empty());
   EXPECT_EQ(1, GetSeqNumToSentRecvTime()->size());
@@ -377,7 +377,7 @@
   testing_clock_.Advance(kSentTime2 - now);
   now = testing_clock_.NowTicks();
   EXPECT_CALL(dispatcher_,
-              PostDelayedTask(_, GetEchoRequestIntervalSeconds() * 1000));
+              PostDelayedTask(_, _, GetEchoRequestIntervalSeconds() * 1000));
   TransmitEchoRequestTask(ipv4_destination, false);
   EXPECT_TRUE(GetReceivedEchoReplySeqNumbers()->empty());
   EXPECT_EQ(1, GetSeqNumToSentRecvTime()->size());
@@ -404,7 +404,7 @@
   testing_clock_.Advance(kResendTime1 - now);
   now = testing_clock_.NowTicks();
   EXPECT_CALL(dispatcher_,
-              PostDelayedTask(_, GetEchoRequestIntervalSeconds() * 1000));
+              PostDelayedTask(_, _, GetEchoRequestIntervalSeconds() * 1000));
   TransmitEchoRequestTask(ipv4_destination, true);
   EXPECT_EQ(1, GetReceivedEchoReplySeqNumbers()->size());
   EXPECT_EQ(2, GetSeqNumToSentRecvTime()->size());
diff --git a/manager.cc b/manager.cc
index 3318dc5..9d1963d 100644
--- a/manager.cc
+++ b/manager.cc
@@ -303,7 +303,7 @@
   }
 
   // Start task for checking connection status.
-  dispatcher_->PostDelayedTask(device_status_check_task_.callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE, device_status_check_task_.callback(),
                                kDeviceStatusCheckIntervalMilliseconds);
 }
 
@@ -1891,7 +1891,7 @@
   // Defer this work to the event loop.
   if (sort_services_task_.IsCancelled()) {
     sort_services_task_.Reset(Bind(&Manager::SortServicesTask, AsWeakPtr()));
-    dispatcher_->PostTask(sort_services_task_.callback());
+    dispatcher_->PostTask(FROM_HERE, sort_services_task_.callback());
   }
 }
 
@@ -1969,7 +1969,7 @@
   ConnectionStatusCheck();
   DevicePresenceStatusCheck();
 
-  dispatcher_->PostDelayedTask(device_status_check_task_.callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE, device_status_check_task_.callback(),
                                kDeviceStatusCheckIntervalMilliseconds);
 }
 
@@ -2083,7 +2083,7 @@
 }
 
 void Manager::ConnectToBestServices(Error* /*error*/) {
-  dispatcher_->PostTask(Bind(&Manager::ConnectToBestServicesTask, AsWeakPtr()));
+  dispatcher_->PostTask(FROM_HERE, Bind(&Manager::ConnectToBestServicesTask, AsWeakPtr()));
 }
 
 void Manager::ConnectToBestServicesTask() {
diff --git a/mock_event_dispatcher.h b/mock_event_dispatcher.h
index 396ff49..9e81b58 100644
--- a/mock_event_dispatcher.h
+++ b/mock_event_dispatcher.h
@@ -31,8 +31,10 @@
 
   MOCK_METHOD0(DispatchForever, void());
   MOCK_METHOD0(DispatchPendingEvents, void());
-  MOCK_METHOD1(PostTask, void(const base::Closure& task));
-  MOCK_METHOD2(PostDelayedTask, void(const base::Closure& task,
+  MOCK_METHOD2(PostTask, void(const tracked_objects::Location& location,
+                              const base::Closure& task));
+  MOCK_METHOD3(PostDelayedTask, void(const tracked_objects::Location& location,
+                                     const base::Closure& task,
                                      int64_t delay_ms));
   MOCK_METHOD3(CreateInputHandler, IOHandler*(
       int fd,
diff --git a/passive_link_monitor.cc b/passive_link_monitor.cc
index ae69531..9cbe7f8 100644
--- a/passive_link_monitor.cc
+++ b/passive_link_monitor.cc
@@ -72,7 +72,8 @@
   // Start the monitor cycle.
   monitor_cycle_timeout_callback_.Reset(
       Bind(&PassiveLinkMonitor::CycleTimeoutHandler, Unretained(this)));
-  dispatcher_->PostDelayedTask(monitor_cycle_timeout_callback_.callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE,
+                               monitor_cycle_timeout_callback_.callback(),
                                kCyclePeriodMilliseconds);
   num_cycles_to_monitor_ = num_cycles;
   return true;
@@ -133,7 +134,8 @@
     if (num_cycles_passed_ < num_cycles_to_monitor_) {
       // Continue on with the next cycle.
       StartArpClient();
-      dispatcher_->PostDelayedTask(monitor_cycle_timeout_callback_.callback(),
+      dispatcher_->PostDelayedTask(FROM_HERE,
+                                   monitor_cycle_timeout_callback_.callback(),
                                    kCyclePeriodMilliseconds);
       return;
     }
@@ -146,7 +148,7 @@
   // cleanup.
   monitor_completed_callback_.Reset(
       Bind(&PassiveLinkMonitor::MonitorCompleted, Unretained(this), status));
-  dispatcher_->PostTask(monitor_completed_callback_.callback());
+  dispatcher_->PostTask(FROM_HERE, monitor_completed_callback_.callback());
 }
 
 void PassiveLinkMonitor::MonitorCompleted(bool status) {
diff --git a/passive_link_monitor_unittest.cc b/passive_link_monitor_unittest.cc
index 62cbb6b..89c79fd 100644
--- a/passive_link_monitor_unittest.cc
+++ b/passive_link_monitor_unittest.cc
@@ -152,7 +152,7 @@
   EXPECT_CALL(*client_, StartRequestListener()).WillOnce(Return(true));
   EXPECT_CALL(dispatcher_, CreateReadyHandler(_, IOHandler::kModeInput, _))
       .Times(1);
-  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _)).Times(1);
+  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _, _)).Times(1);
   EXPECT_TRUE(link_monitor_.Start(PassiveLinkMonitor::kDefaultMonitorCycles));
 }
 
@@ -227,8 +227,8 @@
   // Monitor failed for the current cycle, post a task to perform cleanup and
   // invoke result callback.
   EXPECT_CALL(*client_, StartRequestListener()).Times(0);
-  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _)).Times(0);
-  EXPECT_CALL(dispatcher_, PostTask(_)).Times(1);
+  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _, _)).Times(0);
+  EXPECT_CALL(dispatcher_, PostTask(_, _)).Times(1);
   InvokeCycleTimeoutHandler();
 }
 
@@ -240,8 +240,8 @@
 
   // Monitor succeed for the current cycle, post a task to trigger a new cycle.
   EXPECT_CALL(*client_, StartRequestListener()).WillOnce(Return(true));
-  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _)).Times(1);
-  EXPECT_CALL(dispatcher_, PostTask(_)).Times(0);
+  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _, _)).Times(1);
+  EXPECT_CALL(dispatcher_, PostTask(_, _)).Times(0);
   InvokeCycleTimeoutHandler();
   // ARP request received count should be resetted.
   VerifyCurrentCycleStats(0, kCurrentCycle + 1);
@@ -255,8 +255,8 @@
 
   // Monitor completed all the cycles, post a task to perform cleanup and
   // invoke result callback.
-  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _)).Times(0);
-  EXPECT_CALL(dispatcher_, PostTask(_)).Times(1);
+  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _, _)).Times(0);
+  EXPECT_CALL(dispatcher_, PostTask(_, _)).Times(1);
   InvokeCycleTimeoutHandler();
   VerifyCurrentCycleStats(0, PassiveLinkMonitor::kDefaultMonitorCycles);
 }
diff --git a/process_manager.cc b/process_manager.cc
index e86c189..6d9649f 100644
--- a/process_manager.cc
+++ b/process_manager.cc
@@ -237,7 +237,7 @@
 
 bool ProcessManager::KillProcessWithTimeout(pid_t pid, bool kill_signal) {
   SLOG(this, 2) << __func__ << "(pid: " << pid << ")";
-  
+
   bool killed = false;
   if (KillProcess(pid, kill_signal ? SIGKILL : SIGTERM, &killed)) {
     if (killed) {
@@ -363,7 +363,7 @@
                      weak_factory_.GetWeakPtr(),
                      pid,
                      kill_signal)));
-  dispatcher_->PostDelayedTask(termination_callback->callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE, termination_callback->callback(),
                                kTerminationTimeoutSeconds * 1000);
   pending_termination_processes_.emplace(pid, std::move(termination_callback));
   return true;
diff --git a/result_aggregator.cc b/result_aggregator.cc
index 150d28f..475757c 100644
--- a/result_aggregator.cc
+++ b/result_aggregator.cc
@@ -35,7 +35,8 @@
       timed_out_(false) {
   CHECK(!callback.is_null());
   if (dispatcher && timeout_milliseconds >= 0) {
-    dispatcher->PostDelayedTask(timeout_callback_.callback(),
+    dispatcher->PostDelayedTask(FROM_HERE,
+                                timeout_callback_.callback(),
                                 timeout_milliseconds);
   }
 }
diff --git a/result_aggregator_unittest.cc b/result_aggregator_unittest.cc
index fa903fe..4ca42dc 100644
--- a/result_aggregator_unittest.cc
+++ b/result_aggregator_unittest.cc
@@ -132,7 +132,7 @@
 
 TEST_F(ResultAggregatorTestWithMockDispatcher,
        TimeoutCallbackPostedOnConstruction) {
-  EXPECT_CALL(dispatcher_, PostDelayedTask(_, kTimeoutMilliseconds));
+  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _, kTimeoutMilliseconds));
   auto result_aggregator = make_scoped_refptr(new ResultAggregator(
       Bind(&ResultAggregatorTest::ReportResult, Unretained(this)), &dispatcher_,
       kTimeoutMilliseconds));
diff --git a/service.cc b/service.cc
index 37d2224..33dc615 100644
--- a/service.cc
+++ b/service.cc
@@ -460,7 +460,8 @@
               << auto_connect_cooldown_milliseconds_ << " milliseconds.";
     reenable_auto_connect_task_.Reset(Bind(&Service::ReEnableAutoConnectTask,
                                            weak_ptr_factory_.GetWeakPtr()));
-    dispatcher_->PostDelayedTask(reenable_auto_connect_task_.callback(),
+    dispatcher_->PostDelayedTask(FROM_HERE,
+                                 reenable_auto_connect_task_.callback(),
                                  auto_connect_cooldown_milliseconds_);
   }
   auto_connect_cooldown_milliseconds_ =
diff --git a/service_unittest.cc b/service_unittest.cc
index 8a44301..bf65ed3 100644
--- a/service_unittest.cc
+++ b/service_unittest.cc
@@ -1080,13 +1080,13 @@
   EXPECT_TRUE(service_->IsAutoConnectable(&reason));
 
   // The very first AutoConnect() doesn't trigger any throttling.
-  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _)).Times(0);
+  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _, _)).Times(0);
   service_->AutoConnect();
   Mock::VerifyAndClearExpectations(&dispatcher_);
   EXPECT_TRUE(service_->IsAutoConnectable(&reason));
 
   // The second call does trigger some throttling.
-  EXPECT_CALL(dispatcher_, PostDelayedTask(_,
+  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _,
       Service::kMinAutoConnectCooldownTimeMilliseconds));
   service_->AutoConnect();
   Mock::VerifyAndClearExpectations(&dispatcher_);
@@ -1095,7 +1095,7 @@
 
   // Calling AutoConnect() again before the cooldown terminates does not change
   // the timeout.
-  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _)).Times(0);
+  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _, _)).Times(0);
   service_->AutoConnect();
   Mock::VerifyAndClearExpectations(&dispatcher_);
   EXPECT_FALSE(service_->IsAutoConnectable(&reason));
@@ -1112,7 +1112,7 @@
             Service::kMinAutoConnectCooldownTimeMilliseconds);
   while (next_cooldown_time <=
          service_->GetMaxAutoConnectCooldownTimeMilliseconds()) {
-    EXPECT_CALL(dispatcher_, PostDelayedTask(_, next_cooldown_time));
+    EXPECT_CALL(dispatcher_, PostDelayedTask(_, _, next_cooldown_time));
     service_->AutoConnect();
     Mock::VerifyAndClearExpectations(&dispatcher_);
     EXPECT_FALSE(service_->IsAutoConnectable(&reason));
@@ -1123,7 +1123,7 @@
 
   // Once we hit our cap, future timeouts are the same.
   for (int32_t i = 0; i < 2; i++) {
-    EXPECT_CALL(dispatcher_, PostDelayedTask(_,
+    EXPECT_CALL(dispatcher_, PostDelayedTask(_, _,
         service_->GetMaxAutoConnectCooldownTimeMilliseconds()));
     service_->AutoConnect();
     Mock::VerifyAndClearExpectations(&dispatcher_);
@@ -1141,7 +1141,7 @@
   EXPECT_EQ(service_->auto_connect_cooldown_milliseconds_, 0);
 
   // But future AutoConnects behave as before
-  EXPECT_CALL(dispatcher_, PostDelayedTask(_,
+  EXPECT_CALL(dispatcher_, PostDelayedTask(_, _,
       Service::kMinAutoConnectCooldownTimeMilliseconds)).Times(1);
   service_->AutoConnect();
   service_->AutoConnect();
diff --git a/traffic_monitor.cc b/traffic_monitor.cc
index 18f7f04..af1af2a 100644
--- a/traffic_monitor.cc
+++ b/traffic_monitor.cc
@@ -63,7 +63,7 @@
 
   sample_traffic_callback_.Reset(base::Bind(&TrafficMonitor::SampleTraffic,
                                             base::Unretained(this)));
-  dispatcher_->PostDelayedTask(sample_traffic_callback_.callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE, sample_traffic_callback_.callback(),
                                kSamplingIntervalMilliseconds);
 }
 
@@ -212,7 +212,7 @@
 
   // Schedule the sample callback first, so it is possible for the network
   // problem callback to stop the traffic monitor.
-  dispatcher_->PostDelayedTask(sample_traffic_callback_.callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE, sample_traffic_callback_.callback(),
                                kSamplingIntervalMilliseconds);
 
   if (IsCongestedTxQueues() &&
diff --git a/vpn/l2tp_ipsec_driver_unittest.cc b/vpn/l2tp_ipsec_driver_unittest.cc
index 5bac7d1..fbbc906 100644
--- a/vpn/l2tp_ipsec_driver_unittest.cc
+++ b/vpn/l2tp_ipsec_driver_unittest.cc
@@ -721,7 +721,7 @@
   Mock::VerifyAndClearExpectations(local_external_task);
 
   EXPECT_CALL(*local_external_task, OnDelete());
-  dispatcher_.PostTask(base::MessageLoop::QuitWhenIdleClosure());
+  dispatcher_.PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
   dispatcher_.DispatchForever();
 }
 
diff --git a/vpn/openvpn_driver_unittest.cc b/vpn/openvpn_driver_unittest.cc
index 24d5c28..346af84 100644
--- a/vpn/openvpn_driver_unittest.cc
+++ b/vpn/openvpn_driver_unittest.cc
@@ -1285,7 +1285,7 @@
 TEST_F(OpenVPNDriverTest, OnReconnectingUnknown) {
   EXPECT_FALSE(IsConnectTimeoutStarted());
   EXPECT_CALL(dispatcher_,
-              PostDelayedTask(_, GetDefaultConnectTimeoutSeconds() * 1000));
+              PostDelayedTask(_, _, GetDefaultConnectTimeoutSeconds() * 1000));
   SetDevice(device_);
   SetService(service_);
   EXPECT_CALL(*device_, SetServiceState(Service::kStateConfiguring));
@@ -1296,9 +1296,11 @@
 
 TEST_F(OpenVPNDriverTest, OnReconnectingTLSError) {
   EXPECT_CALL(dispatcher_,
-              PostDelayedTask(_, GetReconnectOfflineTimeoutSeconds() * 1000));
+              PostDelayedTask(_, _,
+                              GetReconnectOfflineTimeoutSeconds() * 1000));
   EXPECT_CALL(dispatcher_,
-              PostDelayedTask(_, GetReconnectTLSErrorTimeoutSeconds() * 1000));
+              PostDelayedTask(_, _,
+                              GetReconnectTLSErrorTimeoutSeconds() * 1000));
 
   driver_->OnReconnecting(OpenVPNDriver::kReconnectReasonOffline);
   EXPECT_TRUE(IsConnectTimeoutStarted());
diff --git a/vpn/vpn_driver.cc b/vpn/vpn_driver.cc
index dfbc574..8b6b379 100644
--- a/vpn/vpn_driver.cc
+++ b/vpn/vpn_driver.cc
@@ -279,7 +279,7 @@
   connect_timeout_seconds_ = timeout_seconds;
   connect_timeout_callback_.Reset(
       Bind(&VPNDriver::OnConnectTimeout, weak_ptr_factory_.GetWeakPtr()));
-  dispatcher_->PostDelayedTask(
+  dispatcher_->PostDelayedTask(FROM_HERE,
       connect_timeout_callback_.callback(), timeout_seconds * 1000);
 }
 
diff --git a/wifi/mac80211_monitor.cc b/wifi/mac80211_monitor.cc
index 04fc17c..87d65d9 100644
--- a/wifi/mac80211_monitor.cc
+++ b/wifi/mac80211_monitor.cc
@@ -106,7 +106,7 @@
         Bind(&Mac80211Monitor::WakeQueuesIfNeeded,
              weak_ptr_factory_.GetWeakPtr()));
   }
-  dispatcher_->PostDelayedTask(check_queues_callback_.callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE, check_queues_callback_.callback(),
                                 kQueueStatePollIntervalSeconds * 1000);
 }
 
diff --git a/wifi/mac80211_monitor_unittest.cc b/wifi/mac80211_monitor_unittest.cc
index 9352937..70d343a 100644
--- a/wifi/mac80211_monitor_unittest.cc
+++ b/wifi/mac80211_monitor_unittest.cc
@@ -79,7 +79,7 @@
   void AllowWakeQueuesIfNeededCommonCalls() {
     // Allow any number of these calls, as these aspects of
     // WakeQueuesIfNeeded interaction are tested elsewhere.
-    EXPECT_CALL(event_dispatcher(), PostDelayedTask(_, _))
+    EXPECT_CALL(event_dispatcher(), PostDelayedTask(_, _, _))
         .Times(AnyNumber());
     EXPECT_CALL(metrics(), SendEnumToUMA(_, _, _))
         .Times(AnyNumber());
@@ -151,7 +151,7 @@
     EXPECT_CALL(
         event_dispatcher_,
         PostDelayedTask(
-            _, Mac80211Monitor::kQueueStatePollIntervalSeconds * 1000));
+            _, _, Mac80211Monitor::kQueueStatePollIntervalSeconds * 1000));
     mac80211_monitor_.Start(phy_name);
     if (fake_sysfs_tree_.IsValid()) {
       PlumbFakeSysfs();  // Re-plumb, since un-plumbed by Start().
@@ -239,7 +239,7 @@
   FakeUpSysfs();
   StartMonitor("dont-care-phy");
   UpdateConnectedState(false);
-  EXPECT_CALL(event_dispatcher(), PostDelayedTask(_, _));
+  EXPECT_CALL(event_dispatcher(), PostDelayedTask(_, _, _));
   ScopedMockLog log;
   EXPECT_CALL(log, Log(_, _, HasSubstr(": incomplete read on "))).Times(0);
 
@@ -253,7 +253,7 @@
   FakeUpSysfs();
   StartMonitor("dont-care-phy");
   UpdateConnectedState(false);
-  EXPECT_CALL(event_dispatcher(), PostDelayedTask(_, _));
+  EXPECT_CALL(event_dispatcher(), PostDelayedTask(_, _, _));
   WakeQueuesIfNeeded();
 }
 
@@ -275,7 +275,7 @@
   FakeUpSysfs();
   StartMonitor("dont-care-phy");
   UpdateConnectedState(true);
-  EXPECT_CALL(event_dispatcher(), PostDelayedTask(_, _));
+  EXPECT_CALL(event_dispatcher(), PostDelayedTask(_, _, _));
   WakeQueuesIfNeeded();
 }
 
diff --git a/wifi/tdls_manager.cc b/wifi/tdls_manager.cc
index 67651f4..b294c7a 100644
--- a/wifi/tdls_manager.cc
+++ b/wifi/tdls_manager.cc
@@ -155,7 +155,8 @@
   }
   peer_discovery_cleanup_callback_.Reset(
       Bind(&TDLSManager::PeerDiscoveryCleanup, base::Unretained(this)));
-  dispatcher_->PostDelayedTask(peer_discovery_cleanup_callback_.callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE,
+                               peer_discovery_cleanup_callback_.callback(),
                                kPeerDiscoveryCleanupTimeoutSeconds * 1000);
 }
 
diff --git a/wifi/tdls_manager_unittest.cc b/wifi/tdls_manager_unittest.cc
index 9596257..18c4928 100644
--- a/wifi/tdls_manager_unittest.cc
+++ b/wifi/tdls_manager_unittest.cc
@@ -91,7 +91,7 @@
   EXPECT_CALL(supplicant_interface_proxy_, TDLSDiscover(StrEq(kPeer)))
       .WillOnce(Return(true));
   // Post delayed task for discover peer cleanup timer.
-  EXPECT_CALL(event_dispatcher_, PostDelayedTask(_, _)).Times(1);
+  EXPECT_CALL(event_dispatcher_, PostDelayedTask(_, _, _)).Times(1);
   EXPECT_EQ("",
             tdls_manager_.PerformOperation(
                 kPeer, kTDLSDiscoverOperation, &error));
@@ -105,7 +105,7 @@
   error.Reset();
   EXPECT_CALL(supplicant_interface_proxy_, TDLSDiscover(StrEq(kPeer)))
       .WillOnce(Return(false));
-  EXPECT_CALL(event_dispatcher_, PostDelayedTask(_, _)).Times(0);
+  EXPECT_CALL(event_dispatcher_, PostDelayedTask(_, _, _)).Times(0);
   EXPECT_EQ("",
             tdls_manager_.PerformOperation(
                 kPeer, kTDLSDiscoverOperation, &error));
@@ -235,7 +235,7 @@
   EXPECT_CALL(supplicant_interface_proxy_, TDLSDiscover(StrEq(kPeer)))
       .WillOnce(Return(true));
   // Post delayed task for discover peer cleanup timer.
-  EXPECT_CALL(event_dispatcher_, PostDelayedTask(_, _)).Times(1);
+  EXPECT_CALL(event_dispatcher_, PostDelayedTask(_, _, _)).Times(1);
   EXPECT_EQ("",
             tdls_manager_.PerformOperation(
                 kPeer, kTDLSDiscoverOperation, &error));
diff --git a/wifi/wake_on_wifi.cc b/wifi/wake_on_wifi.cc
index 26ec6f3..83bf10a 100644
--- a/wifi/wake_on_wifi.cc
+++ b/wifi/wake_on_wifi.cc
@@ -140,7 +140,7 @@
 
 void WakeOnWiFi::StartMetricsTimer() {
 #if !defined(DISABLE_WAKE_ON_WIFI)
-  dispatcher_->PostDelayedTask(report_metrics_callback_.callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE, report_metrics_callback_.callback(),
                                kMetricsReportingFrequencySeconds * 1000);
 #endif  // DISABLE_WAKE_ON_WIFI
 }
@@ -988,7 +988,7 @@
   verify_wake_on_packet_settings_callback_.Reset(
       Bind(&WakeOnWiFi::RequestWakeOnPacketSettings,
            weak_ptr_factory_.GetWeakPtr()));
-  dispatcher_->PostDelayedTask(
+  dispatcher_->PostDelayedTask(FROM_HERE,
       verify_wake_on_packet_settings_callback_.callback(),
       kVerifyWakeOnWiFiSettingsDelayMilliseconds);
 }
@@ -1020,7 +1020,7 @@
   verify_wake_on_packet_settings_callback_.Reset(
       Bind(&WakeOnWiFi::RequestWakeOnPacketSettings,
            weak_ptr_factory_.GetWeakPtr()));
-  dispatcher_->PostDelayedTask(
+  dispatcher_->PostDelayedTask(FROM_HERE,
       verify_wake_on_packet_settings_callback_.callback(),
       kVerifyWakeOnWiFiSettingsDelayMilliseconds);
 }
@@ -1257,12 +1257,12 @@
       time_to_next_lease_renewal < kImmediateDHCPLeaseRenewalThresholdSeconds) {
     // Renew DHCP lease immediately if we have one that is expiring soon.
     renew_dhcp_lease_callback.Run();
-    dispatcher_->PostTask(Bind(&WakeOnWiFi::BeforeSuspendActions,
+    dispatcher_->PostTask(FROM_HERE, Bind(&WakeOnWiFi::BeforeSuspendActions,
                                weak_ptr_factory_.GetWeakPtr(), is_connected,
                                false, time_to_next_lease_renewal,
                                remove_supplicant_networks_callback));
   } else {
-    dispatcher_->PostTask(Bind(&WakeOnWiFi::BeforeSuspendActions,
+    dispatcher_->PostTask(FROM_HERE, Bind(&WakeOnWiFi::BeforeSuspendActions,
                                weak_ptr_factory_.GetWeakPtr(), is_connected,
                                have_dhcp_lease, time_to_next_lease_renewal,
                                remove_supplicant_networks_callback));
@@ -1349,7 +1349,7 @@
       // Go back to suspend immediately since packet would have been delivered
       // to userspace upon waking in dark resume. Do not reset the lease renewal
       // timer since we are not getting a new lease.
-      dispatcher_->PostTask(Bind(
+      dispatcher_->PostTask(FROM_HERE, Bind(
           &WakeOnWiFi::BeforeSuspendActions, weak_ptr_factory_.GetWeakPtr(),
           is_connected, false, 0, remove_supplicant_networks_callback));
       break;
@@ -1385,7 +1385,8 @@
   dark_resume_actions_timeout_callback_.Reset(
       Bind(&WakeOnWiFi::BeforeSuspendActions, weak_ptr_factory_.GetWeakPtr(),
            false, false, 0, remove_supplicant_networks_callback));
-  dispatcher_->PostDelayedTask(dark_resume_actions_timeout_callback_.callback(),
+  dispatcher_->PostDelayedTask(FROM_HERE,
+                               dark_resume_actions_timeout_callback_.callback(),
                                DarkResumeActionsTimeoutMilliseconds);
 #endif  // DISABLE_WAKE_ON_WIFI
 }
diff --git a/wifi/wake_on_wifi_unittest.cc b/wifi/wake_on_wifi_unittest.cc
index 574804c..56e9587 100644
--- a/wifi/wake_on_wifi_unittest.cc
+++ b/wifi/wake_on_wifi_unittest.cc
@@ -2285,7 +2285,7 @@
   is_connected = true;
   have_dhcp_lease = true;
   EXPECT_CALL(*this, RenewDHCPLeaseCallback()).Times(1);
-  EXPECT_CALL(mock_dispatcher_, PostTask(_)).Times(1);
+  EXPECT_CALL(mock_dispatcher_, PostTask(_, _)).Times(1);
   OnBeforeSuspend(is_connected, whitelist, have_dhcp_lease,
                   kTimeToNextLeaseRenewalShort);
 
@@ -2293,7 +2293,7 @@
   is_connected = false;
   have_dhcp_lease = true;
   EXPECT_CALL(*this, RenewDHCPLeaseCallback()).Times(0);
-  EXPECT_CALL(mock_dispatcher_, PostTask(_)).Times(1);
+  EXPECT_CALL(mock_dispatcher_, PostTask(_, _)).Times(1);
   OnBeforeSuspend(is_connected, whitelist, have_dhcp_lease,
                   kTimeToNextLeaseRenewalShort);
 
@@ -2302,7 +2302,7 @@
   is_connected = true;
   have_dhcp_lease = true;
   EXPECT_CALL(*this, RenewDHCPLeaseCallback()).Times(0);
-  EXPECT_CALL(mock_dispatcher_, PostTask(_)).Times(1);
+  EXPECT_CALL(mock_dispatcher_, PostTask(_, _)).Times(1);
   OnBeforeSuspend(is_connected, whitelist, have_dhcp_lease,
                   kTimeToNextLeaseRenewalLong);
 
@@ -2311,7 +2311,7 @@
   is_connected = true;
   have_dhcp_lease = false;
   EXPECT_CALL(*this, RenewDHCPLeaseCallback()).Times(0);
-  EXPECT_CALL(mock_dispatcher_, PostTask(_)).Times(1);
+  EXPECT_CALL(mock_dispatcher_, PostTask(_, _)).Times(1);
   OnBeforeSuspend(is_connected, whitelist, have_dhcp_lease,
                   kTimeToNextLeaseRenewalLong);
 }
@@ -3308,12 +3308,12 @@
   vector<ByteString> whitelist;
   AddSSIDToWhitelist(kSSIDBytes1, sizeof(kSSIDBytes1), &whitelist);
   EXPECT_CALL(*this, DoneCallback(ErrorTypeIs(Error::kSuccess))).Times(1);
-  EXPECT_CALL(mock_dispatcher_, PostDelayedTask(_, _)).Times(0);
+  EXPECT_CALL(mock_dispatcher_, PostDelayedTask(_, _, _)).Times(0);
   EXPECT_CALL(metrics_, NotifyWakeOnWiFiOnDarkResume(_)).Times(0);
   OnDarkResume(is_connected, whitelist);
 
   EXPECT_CALL(*this, DoneCallback(ErrorTypeIs(Error::kSuccess))).Times(1);
-  EXPECT_CALL(mock_dispatcher_, PostDelayedTask(_, _)).Times(0);
+  EXPECT_CALL(mock_dispatcher_, PostDelayedTask(_, _, _)).Times(0);
   EXPECT_CALL(metrics_, NotifyWakeOnWiFiOnDarkResume(_)).Times(0);
   OnDarkResume(is_connected, whitelist);
 }
diff --git a/wifi/wifi.cc b/wifi/wifi.cc
index ef3c8af..4d94f24 100644
--- a/wifi/wifi.cc
+++ b/wifi/wifi.cc
@@ -334,6 +334,7 @@
   // signal handler context (via Manager::RequestScan). So defer work
   // to event loop.
   dispatcher()->PostTask(
+      FROM_HERE,
       Bind(&WiFi::ScanTask, weak_ptr_factory_.GetWeakPtr()));
 }
 
@@ -342,6 +343,7 @@
   // signal handler context (via Manager::SetSchedScan). So defer work
   // to event loop.
   dispatcher()->PostTask(
+      FROM_HERE,
       Bind(&WiFi::SetSchedScanTask, weak_ptr_factory_.GetWeakPtr(), enable));
 }
 
@@ -352,7 +354,8 @@
     pending_scan_results_.reset(new PendingScanResults(
         Bind(&WiFi::PendingScanResultsHandler,
              weak_ptr_factory_.GetWeakPtr())));
-    dispatcher()->PostTask(pending_scan_results_->callback.callback());
+    dispatcher()->PostTask(FROM_HERE,
+                           pending_scan_results_->callback.callback());
   }
   pending_scan_results_->results.emplace_back(path, properties, is_removal);
 }
@@ -370,12 +373,14 @@
 }
 
 void WiFi::Certification(const KeyValueStore& properties) {
-  dispatcher()->PostTask(Bind(&WiFi::CertificationTask,
+  dispatcher()->PostTask(FROM_HERE,
+                         Bind(&WiFi::CertificationTask,
                               weak_ptr_factory_.GetWeakPtr(), properties));
 }
 
 void WiFi::EAPEvent(const string& status, const string& parameter) {
-  dispatcher()->PostTask(Bind(&WiFi::EAPEventTask,
+  dispatcher()->PostTask(FROM_HERE,
+                         Bind(&WiFi::EAPEventTask,
                               weak_ptr_factory_.GetWeakPtr(),
                               status,
                               parameter));
@@ -385,7 +390,8 @@
   SLOG(this, 2) << __func__;
   // Called from D-Bus signal handler, but may need to send a D-Bus
   // message. So defer work to event loop.
-  dispatcher()->PostTask(Bind(&WiFi::PropertiesChangedTask,
+  dispatcher()->PostTask(FROM_HERE,
+                         Bind(&WiFi::PropertiesChangedTask,
                               weak_ptr_factory_.GetWeakPtr(), properties));
 }
 
@@ -403,11 +409,13 @@
   if (success) {
     scan_failed_callback_.Cancel();
     dispatcher()->PostTask(
+        FROM_HERE,
         Bind(&WiFi::ScanDoneTask, weak_ptr_factory_.GetWeakPtr()));
   } else {
     scan_failed_callback_.Reset(
         Bind(&WiFi::ScanFailedTask, weak_ptr_factory_.GetWeakPtr()));
-    dispatcher()->PostDelayedTask(scan_failed_callback_.callback(),
+    dispatcher()->PostDelayedTask(FROM_HERE,
+                                  scan_failed_callback_.callback(),
                                   kPostScanFailedDelayMilliseconds);
   }
 }
@@ -1411,7 +1419,8 @@
   // Post |UpdateScanStateAfterScanDone| so it runs after any pending scan
   // results have been processed.  This allows connections on new BSSes to be
   // started before we decide whether the scan was fruitful.
-  dispatcher()->PostTask(Bind(&WiFi::UpdateScanStateAfterScanDone,
+  dispatcher()->PostTask(FROM_HERE,
+                         Bind(&WiFi::UpdateScanStateAfterScanDone,
                               weak_ptr_factory_.GetWeakPtr()));
   if ((provider_->NumAutoConnectableServices() < 1) && IsIdle()) {
     // Ensure we are also idle in case we are in the midst of connecting to
@@ -1864,7 +1873,8 @@
   LOG(INFO) << __func__ << ": "
             << (IsConnectedToCurrentService() ? "connected" : "not connected");
   Device::OnAfterResume();  // May refresh ipconfig_
-  dispatcher()->PostDelayedTask(Bind(&WiFi::ReportConnectedToServiceAfterWake,
+  dispatcher()->PostDelayedTask(FROM_HERE,
+                                Bind(&WiFi::ReportConnectedToServiceAfterWake,
                                      weak_ptr_factory_.GetWeakPtr()),
                                 kPostWakeConnectivityReportDelayMilliseconds);
   wake_on_wifi_->OnAfterResume();
@@ -2046,7 +2056,8 @@
   // have reasonable trust that no APs we are looking for are present.
   size_t wait_time_milliseconds = fast_scans_remaining_ > 0 ?
       kFastScanIntervalSeconds * 1000 : scan_interval_seconds_ * 1000;
-  dispatcher()->PostDelayedTask(scan_timer_callback_.callback(),
+  dispatcher()->PostDelayedTask(FROM_HERE,
+                                scan_timer_callback_.callback(),
                                 wait_time_milliseconds);
   SLOG(this, 5) << "Next scan scheduled for " << wait_time_milliseconds << "ms";
 }
@@ -2086,7 +2097,8 @@
 void WiFi::StartPendingTimer() {
   pending_timeout_callback_.Reset(
       Bind(&WiFi::PendingTimeoutHandler, weak_ptr_factory_.GetWeakPtr()));
-  dispatcher()->PostDelayedTask(pending_timeout_callback_.callback(),
+  dispatcher()->PostDelayedTask(FROM_HERE,
+                                pending_timeout_callback_.callback(),
                                 kPendingTimeoutSeconds * 1000);
 }
 
@@ -2162,7 +2174,8 @@
   LOG(INFO) << "WiFi Device " << link_name() << ": " << __func__;
   reconnect_timeout_callback_.Reset(
       Bind(&WiFi::ReconnectTimeoutHandler, weak_ptr_factory_.GetWeakPtr()));
-  dispatcher()->PostDelayedTask(reconnect_timeout_callback_.callback(),
+  dispatcher()->PostDelayedTask(FROM_HERE,
+                                reconnect_timeout_callback_.callback(),
                                 kReconnectTimeoutSeconds * 1000);
 }
 
@@ -2672,7 +2685,8 @@
 
   request_station_info_callback_.Reset(
       Bind(&WiFi::RequestStationInfo, weak_ptr_factory_.GetWeakPtr()));
-  dispatcher()->PostDelayedTask(request_station_info_callback_.callback(),
+  dispatcher()->PostDelayedTask(FROM_HERE,
+                                request_station_info_callback_.callback(),
                                 kRequestStationInfoPeriodSeconds * 1000);
 }
 
diff --git a/wifi/wifi_unittest.cc b/wifi/wifi_unittest.cc
index 342456e..e099e32 100644
--- a/wifi/wifi_unittest.cc
+++ b/wifi/wifi_unittest.cc
@@ -3110,7 +3110,7 @@
 
   // Each time we call FireScanTimer() below, WiFi will post a task to actually
   // run Scan() on the wpa_supplicant proxy.
-  EXPECT_CALL(mock_dispatcher_, PostTask(_))
+  EXPECT_CALL(mock_dispatcher_, PostTask(_, _))
       .Times(kScanTimes);
   {
     InSequence seq;
@@ -3119,12 +3119,12 @@
     // the ones in the expectation below, we get WiFi::kNumFastScanAttempts at
     // the fast scan interval.
     EXPECT_CALL(mock_dispatcher_, PostDelayedTask(
-        _, WiFi::kFastScanIntervalSeconds * 1000))
+        _, _, WiFi::kFastScanIntervalSeconds * 1000))
         .Times(WiFi::kNumFastScanAttempts - 1);
 
     // After this, the WiFi device should use the normal scan interval.
     EXPECT_CALL(mock_dispatcher_, PostDelayedTask(
-        _, GetScanInterval() * 1000))
+        _, _, GetScanInterval() * 1000))
         .Times(kScanTimes - WiFi::kNumFastScanAttempts + 1);
 
     for (int i = 0; i < kScanTimes; i++) {
@@ -3135,56 +3135,56 @@
 
 TEST_F(WiFiTimerTest, FastRescan) {
   // This is to cover calls to PostDelayedTask by WakeOnWiFi::StartMetricsTimer.
-  EXPECT_CALL(mock_dispatcher_, PostDelayedTask(_, _)).Times(AnyNumber());
+  EXPECT_CALL(mock_dispatcher_, PostDelayedTask(_, _, _)).Times(AnyNumber());
   // This PostTask is a result of the call to Scan(nullptr), and is meant to
   // post a task to call Scan() on the wpa_supplicant proxy immediately.
-  EXPECT_CALL(mock_dispatcher_, PostTask(_));
+  EXPECT_CALL(mock_dispatcher_, PostTask(_, _));
   EXPECT_CALL(mock_dispatcher_, PostDelayedTask(
-      _, WiFi::kFastScanIntervalSeconds * 1000));
+      _, _, WiFi::kFastScanIntervalSeconds * 1000));
   StartWiFi();
 
   ExpectInitialScanSequence();
 
   // If we end up disconnecting, the sequence should repeat.
   EXPECT_CALL(mock_dispatcher_, PostDelayedTask(
-      _, WiFi::kFastScanIntervalSeconds * 1000));
+      _, _, WiFi::kFastScanIntervalSeconds * 1000));
   RestartFastScanAttempts();
 
   ExpectInitialScanSequence();
 }
 
 TEST_F(WiFiTimerTest, ReconnectTimer) {
-  EXPECT_CALL(mock_dispatcher_, PostTask(_)).Times(AnyNumber());
-  EXPECT_CALL(mock_dispatcher_, PostDelayedTask(_, _)).Times(AnyNumber());
+  EXPECT_CALL(mock_dispatcher_, PostTask(_, _)).Times(AnyNumber());
+  EXPECT_CALL(mock_dispatcher_, PostDelayedTask(_, _, _)).Times(AnyNumber());
   StartWiFi();
   SetupConnectedService("", nullptr, nullptr);
   Mock::VerifyAndClearExpectations(&mock_dispatcher_);
 
   EXPECT_CALL(mock_dispatcher_, PostDelayedTask(
-      _, GetReconnectTimeoutSeconds() * 1000)).Times(1);
+      _, _, GetReconnectTimeoutSeconds() * 1000)).Times(1);
   StartReconnectTimer();
   Mock::VerifyAndClearExpectations(&mock_dispatcher_);
   StopReconnectTimer();
 
   EXPECT_CALL(mock_dispatcher_, PostDelayedTask(
-      _, GetReconnectTimeoutSeconds() * 1000)).Times(1);
+      _, _, GetReconnectTimeoutSeconds() * 1000)).Times(1);
   StartReconnectTimer();
   Mock::VerifyAndClearExpectations(&mock_dispatcher_);
   GetReconnectTimeoutCallback().callback().Run();
 
   EXPECT_CALL(mock_dispatcher_, PostDelayedTask(
-      _, GetReconnectTimeoutSeconds() * 1000)).Times(1);
+      _, _, GetReconnectTimeoutSeconds() * 1000)).Times(1);
   StartReconnectTimer();
   Mock::VerifyAndClearExpectations(&mock_dispatcher_);
 
   EXPECT_CALL(mock_dispatcher_, PostDelayedTask(
-      _, GetReconnectTimeoutSeconds() * 1000)).Times(0);
+      _, _, GetReconnectTimeoutSeconds() * 1000)).Times(0);
   StartReconnectTimer();
 }
 
 TEST_F(WiFiTimerTest, RequestStationInfo) {
-  EXPECT_CALL(mock_dispatcher_, PostTask(_)).Times(AnyNumber());
-  EXPECT_CALL(mock_dispatcher_, PostDelayedTask(_, _)).Times(AnyNumber());
+  EXPECT_CALL(mock_dispatcher_, PostTask(_, _)).Times(AnyNumber());
+  EXPECT_CALL(mock_dispatcher_, PostDelayedTask(_, _, _)).Times(AnyNumber());
 
   // Setup a connected service here while we have the expectations above set.
   StartWiFi();
@@ -3194,7 +3194,7 @@
   Mock::VerifyAndClearExpectations(&mock_dispatcher_);
 
   EXPECT_CALL(netlink_manager_, SendNl80211Message(_, _, _, _)).Times(0);
-  EXPECT_CALL(mock_dispatcher_, PostDelayedTask(_, _)).Times(0);
+  EXPECT_CALL(mock_dispatcher_, PostDelayedTask(_, _, _)).Times(0);
   NiceScopedMockLog log;
 
   // There is no current_service_.
@@ -3222,7 +3222,7 @@
   EXPECT_CALL(netlink_manager_, SendNl80211Message(
       IsNl80211Command(kNl80211FamilyId, NL80211_CMD_GET_STATION), _, _, _));
   EXPECT_CALL(mock_dispatcher_, PostDelayedTask(
-      _, WiFi::kRequestStationInfoPeriodSeconds * 1000));
+      _, _, WiFi::kRequestStationInfoPeriodSeconds * 1000));
   SetSupplicantBSS(connected_bss);
   RequestStationInfo();
 
@@ -3378,13 +3378,14 @@
 }
 
 TEST_F(WiFiTimerTest, ResumeDispatchesConnectivityReportTask) {
-  EXPECT_CALL(mock_dispatcher_, PostTask(_)).Times(AnyNumber());
-  EXPECT_CALL(mock_dispatcher_, PostDelayedTask(_, _)).Times(AnyNumber());
+  EXPECT_CALL(mock_dispatcher_, PostTask(_, _)).Times(AnyNumber());
+  EXPECT_CALL(mock_dispatcher_, PostDelayedTask(_, _, _)).Times(AnyNumber());
   StartWiFi();
   SetupConnectedService("", nullptr, nullptr);
   EXPECT_CALL(
       mock_dispatcher_,
-      PostDelayedTask(_, WiFi::kPostWakeConnectivityReportDelayMilliseconds));
+      PostDelayedTask(_, _,
+                      WiFi::kPostWakeConnectivityReportDelayMilliseconds));
   OnAfterResume();
 }
 
@@ -3392,7 +3393,7 @@
   Error e;
   // Return immediately if scan interval is 0.
   SetScanInterval(0, &e);
-  EXPECT_CALL(mock_dispatcher_, PostDelayedTask(_, _)).Times(0);
+  EXPECT_CALL(mock_dispatcher_, PostDelayedTask(_, _, _)).Times(0);
   StartScanTimer();
 }
 
@@ -3402,7 +3403,7 @@
   SetScanInterval(scan_interval, &e);
   SetFastScansRemaining(1);
   EXPECT_CALL(mock_dispatcher_,
-              PostDelayedTask(_, WiFi::kFastScanIntervalSeconds * 1000));
+              PostDelayedTask(_, _, WiFi::kFastScanIntervalSeconds * 1000));
   StartScanTimer();
 }
 
@@ -3411,7 +3412,7 @@
   const int scan_interval = 10;
   SetScanInterval(scan_interval, &e);
   SetFastScansRemaining(0);
-  EXPECT_CALL(mock_dispatcher_, PostDelayedTask(_, scan_interval * 1000));
+  EXPECT_CALL(mock_dispatcher_, PostDelayedTask(_, _, scan_interval * 1000));
   StartScanTimer();
 }
 
@@ -3448,13 +3449,13 @@
   // Dispatch WiFi::ScanFailedTask if scan failed.
   EXPECT_TRUE(ScanFailedCallbackIsCancelled());
   EXPECT_CALL(mock_dispatcher_,
-              PostDelayedTask(_, WiFi::kPostScanFailedDelayMilliseconds));
+              PostDelayedTask(_, _, WiFi::kPostScanFailedDelayMilliseconds));
   ScanDone(false);
   EXPECT_FALSE(ScanFailedCallbackIsCancelled());
 
   // Dispatch WiFi::ScanDoneTask if scan succeeded, and cancel the scan failed
   // callback if has been dispatched.
-  EXPECT_CALL(mock_dispatcher_, PostTask(_));
+  EXPECT_CALL(mock_dispatcher_, PostTask(_, _));
   ScanDone(true);
   EXPECT_TRUE(ScanFailedCallbackIsCancelled());
 }
diff --git a/wimax/wimax.cc b/wimax/wimax.cc
index 4dc738c..524e63f 100644
--- a/wimax/wimax.cc
+++ b/wimax/wimax.cc
@@ -348,8 +348,9 @@
   }
   connect_timeout_callback_.Reset(
       Bind(&WiMax::OnConnectTimeout, weak_ptr_factory_.GetWeakPtr()));
-  dispatcher()->PostDelayedTask(
-      connect_timeout_callback_.callback(), connect_timeout_seconds_ * 1000);
+  dispatcher()->PostDelayedTask(FROM_HERE,
+                                connect_timeout_callback_.callback(),
+                                connect_timeout_seconds_ * 1000);
 }
 
 void WiMax::StopConnectTimeout() {