Chromium Code Reviews| Index: chrome/renderer/searchbox/searchbox.cc |
| diff --git a/chrome/renderer/searchbox/searchbox.cc b/chrome/renderer/searchbox/searchbox.cc |
| index 9adce8536714bf97658937ee385048a46db5c780..87084c720bb7b6ee0a2fd792b5ed5c06f396990c 100644 |
| --- a/chrome/renderer/searchbox/searchbox.cc |
| +++ b/chrome/renderer/searchbox/searchbox.cc |
| @@ -9,6 +9,7 @@ |
| #include "base/strings/string_number_conversions.h" |
| #include "base/strings/string_util.h" |
| #include "base/strings/utf_string_conversions.h" |
| +#include "base/time/time.h" |
| #include "chrome/common/chrome_switches.h" |
| #include "chrome/common/favicon/favicon_url_parser.h" |
| #include "chrome/common/omnibox_focus_state.h" |
| @@ -16,10 +17,13 @@ |
| #include "chrome/common/url_constants.h" |
| #include "chrome/renderer/searchbox/searchbox_extension.h" |
| #include "components/favicon_base/favicon_types.h" |
| +#include "content/public/renderer/render_frame.h" |
| #include "content/public/renderer/render_view.h" |
| #include "net/base/escape.h" |
| #include "third_party/WebKit/public/web/WebDocument.h" |
| #include "third_party/WebKit/public/web/WebFrame.h" |
| +#include "third_party/WebKit/public/web/WebLocalFrame.h" |
| +#include "third_party/WebKit/public/web/WebPerformance.h" |
| #include "third_party/WebKit/public/web/WebView.h" |
| #include "url/gurl.h" |
| @@ -156,8 +160,19 @@ SearchBox::~SearchBox() { |
| } |
| void SearchBox::LogEvent(NTPLoggingEventType event) { |
| + // navigation_start in ms. |
| + uint64 start = 1000 * |
| + render_view() |
| + ->GetMainRenderFrame() |
| + ->GetWebFrame() |
| + ->performance() |
| + .navigationStart(); |
|
kmadhusu
2015/03/16 21:35:30
style nit: Can you rewrite this line as follows:
u
fserb
2015/03/16 21:45:49
I can, but it doesn't fit in 80chars and the "git
kmadhusu
2015/03/16 21:58:48
You can break the line. I prefer to see 2 lines in
fserb
2015/03/16 22:05:32
I changed it a bit, but if I run "git cl format" i
kmadhusu
2015/03/17 00:10:40
I generally don't run "git cl format".
Try this a
|
| + uint64 now = |
| + (base::TimeTicks::Now() - base::TimeTicks::UnixEpoch()).InMilliseconds(); |
|
kmadhusu
2015/03/16 21:35:30
Is there any specific reason to use base::TimeTick
fserb
2015/03/16 21:45:49
Done.
|
| + DCHECK(now >= start); |
| + uint64 delta = now - start; |
| render_view()->Send(new ChromeViewHostMsg_LogEvent( |
| - render_view()->GetRoutingID(), page_seq_no_, event)); |
| + render_view()->GetRoutingID(), page_seq_no_, event, delta)); |
| } |
| void SearchBox::LogMostVisitedImpression(int position, |