| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/performance_monitor/performance_monitor.h" | 5 #include "chrome/browser/performance_monitor/performance_monitor.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "net/url_request/url_request.h" | 44 #include "net/url_request/url_request.h" |
| 45 | 45 |
| 46 using content::BrowserThread; | 46 using content::BrowserThread; |
| 47 using extensions::Extension; | 47 using extensions::Extension; |
| 48 using extensions::UnloadedExtensionInfo; | 48 using extensions::UnloadedExtensionInfo; |
| 49 | 49 |
| 50 namespace performance_monitor { | 50 namespace performance_monitor { |
| 51 | 51 |
| 52 namespace { | 52 namespace { |
| 53 | 53 |
| 54 #if !defined(OS_ANDROID) |
| 54 std::string TimeToString(base::Time time) { | 55 std::string TimeToString(base::Time time) { |
| 55 int64 time_int64 = time.ToInternalValue(); | 56 int64 time_int64 = time.ToInternalValue(); |
| 56 return base::Int64ToString(time_int64); | 57 return base::Int64ToString(time_int64); |
| 57 } | 58 } |
| 59 #endif |
| 58 | 60 |
| 59 bool StringToTime(std::string time, base::Time* output) { | 61 bool StringToTime(std::string time, base::Time* output) { |
| 60 int64 time_int64 = 0; | 62 int64 time_int64 = 0; |
| 61 if (!base::StringToInt64(time, &time_int64)) | 63 if (!base::StringToInt64(time, &time_int64)) |
| 62 return false; | 64 return false; |
| 63 *output = base::Time::FromInternalValue(time_int64); | 65 *output = base::Time::FromInternalValue(time_int64); |
| 64 return true; | 66 return true; |
| 65 } | 67 } |
| 66 | 68 |
| 67 // Try to get the URL for the RenderViewHost if the host does not correspond to | 69 // Try to get the URL for the RenderViewHost if the host does not correspond to |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 if (!url_list.empty()) | 703 if (!url_list.empty()) |
| 702 url_list += ", "; | 704 url_list += ", "; |
| 703 | 705 |
| 704 url_list += url; | 706 url_list += url; |
| 705 } | 707 } |
| 706 | 708 |
| 707 AddEvent(util::CreateRendererFailureEvent(base::Time::Now(), type, url_list)); | 709 AddEvent(util::CreateRendererFailureEvent(base::Time::Now(), type, url_list)); |
| 708 } | 710 } |
| 709 | 711 |
| 710 } // namespace performance_monitor | 712 } // namespace performance_monitor |
| OLD | NEW |