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

Unified Diff: chrome/browser/conflicts/module_event_sink_impl_win.cc

Issue 2613803005: [win] Enable ModuleDatabase behind a flag. (Closed)
Patch Set: Rebase. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/conflicts/module_event_sink_impl_win.h ('k') | chrome/common/chrome_features.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/conflicts/module_event_sink_impl_win.cc
diff --git a/chrome/browser/conflicts/module_event_sink_impl_win.cc b/chrome/browser/conflicts/module_event_sink_impl_win.cc
index 428b3824e4eeda44530e9e78f0ff149ae6cfbffe..808940332b0fbb6de9756415beeacd54b48726bc 100644
--- a/chrome/browser/conflicts/module_event_sink_impl_win.cc
+++ b/chrome/browser/conflicts/module_event_sink_impl_win.cc
@@ -22,22 +22,6 @@
namespace {
-// Gets the process creation time associated with the given process.
-bool GetProcessCreationTime(base::ProcessHandle process,
- uint64_t* creation_time) {
- FILETIME creation_ft = {};
- FILETIME exit_ft = {};
- FILETIME kernel_ft = {};
- FILETIME user_ft = {};
- if (!::GetProcessTimes(process, &creation_ft, &exit_ft, &kernel_ft,
- &user_ft)) {
- return false;
- }
- *creation_time = (static_cast<uint64_t>(creation_ft.dwHighDateTime) << 32) |
- static_cast<uint64_t>(creation_ft.dwLowDateTime);
- return true;
-}
-
// Gets the path of the module in the provided remote process. Returns true on
// success, false otherwise.
bool GetModulePath(base::ProcessHandle process,
@@ -132,11 +116,12 @@ ModuleEventSinkImpl::ModuleEventSinkImpl(base::ProcessHandle process,
ModuleEventSinkImpl::~ModuleEventSinkImpl() = default;
// static
-void ModuleEventSinkImpl::Create(base::ProcessHandle process,
+void ModuleEventSinkImpl::Create(GetProcessHandleCallback get_process_handle,
content::ProcessType process_type,
ModuleDatabase* module_database,
mojom::ModuleEventSinkRequest request) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ base::ProcessHandle process = get_process_handle.Run();
auto module_event_sink_impl = base::MakeUnique<ModuleEventSinkImpl>(
process, process_type, module_database);
base::Closure error_handler = base::Bind(
@@ -169,6 +154,22 @@ void ModuleEventSinkImpl::OnModuleEvent(mojom::ModuleEventType event_type,
}
}
+// static
+bool ModuleEventSinkImpl::GetProcessCreationTime(base::ProcessHandle process,
+ uint64_t* creation_time) {
+ FILETIME creation_ft = {};
+ FILETIME exit_ft = {};
+ FILETIME kernel_ft = {};
+ FILETIME user_ft = {};
+ if (!::GetProcessTimes(process, &creation_ft, &exit_ft, &kernel_ft,
+ &user_ft)) {
+ return false;
+ }
+ *creation_time = (static_cast<uint64_t>(creation_ft.dwHighDateTime) << 32) |
+ static_cast<uint64_t>(creation_ft.dwLowDateTime);
+ return true;
+}
+
void ModuleEventSinkImpl::OnModuleLoad(uint64_t load_address) {
if (in_error_)
return;
« no previous file with comments | « chrome/browser/conflicts/module_event_sink_impl_win.h ('k') | chrome/common/chrome_features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698