| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "content/public/browser/web_contents.h" | 43 #include "content/public/browser/web_contents.h" |
| 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 | 48 |
| 49 namespace performance_monitor { | 49 namespace performance_monitor { |
| 50 | 50 |
| 51 namespace { | 51 namespace { |
| 52 | 52 |
| 53 const uint32 kAccessFlags = base::kProcessAccessDuplicateHandle | | |
| 54 base::kProcessAccessQueryInformation | | |
| 55 base::kProcessAccessTerminate | | |
| 56 base::kProcessAccessWaitForTermination; | |
| 57 | |
| 58 std::string TimeToString(base::Time time) { | 53 std::string TimeToString(base::Time time) { |
| 59 int64 time_int64 = time.ToInternalValue(); | 54 int64 time_int64 = time.ToInternalValue(); |
| 60 return base::Int64ToString(time_int64); | 55 return base::Int64ToString(time_int64); |
| 61 } | 56 } |
| 62 | 57 |
| 63 bool StringToTime(std::string time, base::Time* output) { | 58 bool StringToTime(std::string time, base::Time* output) { |
| 64 int64 time_int64 = 0; | 59 int64 time_int64 = 0; |
| 65 if (!base::StringToInt64(time, &time_int64)) | 60 if (!base::StringToInt64(time, &time_int64)) |
| 66 return false; | 61 return false; |
| 67 *output = base::Time::FromInternalValue(time_int64); | 62 *output = base::Time::FromInternalValue(time_int64); |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 if (!url_list.empty()) | 710 if (!url_list.empty()) |
| 716 url_list += ", "; | 711 url_list += ", "; |
| 717 | 712 |
| 718 url_list += url; | 713 url_list += url; |
| 719 } | 714 } |
| 720 | 715 |
| 721 AddEvent(util::CreateRendererFailureEvent(base::Time::Now(), type, url_list)); | 716 AddEvent(util::CreateRendererFailureEvent(base::Time::Now(), type, url_list)); |
| 722 } | 717 } |
| 723 | 718 |
| 724 } // namespace performance_monitor | 719 } // namespace performance_monitor |
| OLD | NEW |