Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
Make task_tracker an instance var on atom_api_session
Browse files Browse the repository at this point in the history
  • Loading branch information
diracdeltas authored and bridiver committed Jun 17, 2017
1 parent 255401b commit 38d8bc1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 1 addition & 2 deletions atom/browser/api/atom_api_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -426,12 +426,11 @@ void Session::ClearHistory(mate::Arguments* args) {
Profile::FromBrowserContext(browser_context()),
ServiceAccessType::EXPLICIT_ACCESS);

base::CancelableTaskTracker task_tracker;
history_service->ExpireHistoryBetween(std::set<GURL>(),
base::Time(),
base::Time::Max(),
callback,
&task_tracker);
&task_tracker_);
}

void Session::FlushStorageData() {
Expand Down
4 changes: 4 additions & 0 deletions atom/browser/api/atom_api_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <string>

#include "atom/browser/api/trackable_object.h"
#include "base/task/cancelable_task_tracker.h"
#include "base/values.h"
#include "content/public/browser/download_manager.h"
#include "native_mate/handle.h"
Expand Down Expand Up @@ -107,6 +108,9 @@ class Session: public mate::TrackableObject<Session>,
// The X-DevTools-Emulate-Network-Conditions-Client-Id.
std::string devtools_network_emulation_client_id_;

// The task tracker for the HistoryService callbacks.
base::CancelableTaskTracker task_tracker_;

AtomBrowserContext* browser_context_;

DISALLOW_COPY_AND_ASSIGN(Session);
Expand Down

0 comments on commit 38d8bc1

Please sign in to comment.