Add traces for main omnibox providers

Add trace events for main omnibox providers. They are useful when
analyzing problems with omnibox slow response and lagginess while
typing, like issue 178705.

Committed: https://crrev.com/46959e833a3bfedbd783f829094a0824e756ee65
Cr-Commit-Position: refs/heads/master@{#381913}

Review URL: https://codereview.chromium.org/1805363002

Cr-Commit-Position: refs/heads/master@{#383360}
diff --git a/components/omnibox/browser/search_provider.cc b/components/omnibox/browser/search_provider.cc
index 465cd65..ab12904 100644
--- a/components/omnibox/browser/search_provider.cc
+++ b/components/omnibox/browser/search_provider.cc
@@ -20,6 +20,7 @@
 #include "base/rand_util.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
+#include "base/trace_event/trace_event.h"
 #include "components/data_use_measurement/core/data_use_user_data.h"
 #include "components/history/core/browser/in_memory_database.h"
 #include "components/history/core/browser/keyword_search_term.h"
@@ -220,6 +221,7 @@
 
 void SearchProvider::Start(const AutocompleteInput& input,
                            bool minimal_changes) {
+  TRACE_EVENT0("omnibox", "SearchProvider::Start");
   // Do our best to load the model as early as possible.  This will reduce
   // odds of having the model not ready when really needed (a non-empty input).
   TemplateURLService* model = client()->GetTemplateURLService();
@@ -388,6 +390,7 @@
 }
 
 void SearchProvider::OnURLFetchComplete(const net::URLFetcher* source) {
+  TRACE_EVENT0("omnibox", "SearchProvider::OnURLFetchComplete");
   DCHECK(!done_);
   const bool is_keyword = source == keyword_fetcher_.get();