| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/nacl/renderer/nexe_load_manager.h" | 5 #include "components/nacl/renderer/nexe_load_manager.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/strings/string_tokenizer.h" | 10 #include "base/strings/string_tokenizer.h" |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 uint32_t argc, const char* argn[], const char* argv[]) { | 336 uint32_t argc, const char* argn[], const char* argv[]) { |
| 337 init_time_ = base::Time::Now(); | 337 init_time_ = base::Time::Now(); |
| 338 | 338 |
| 339 for (size_t i = 0; i < argc; ++i) { | 339 for (size_t i = 0; i < argc; ++i) { |
| 340 std::string name(argn[i]); | 340 std::string name(argn[i]); |
| 341 std::string value(argv[i]); | 341 std::string value(argv[i]); |
| 342 args_[name] = value; | 342 args_[name] = value; |
| 343 } | 343 } |
| 344 | 344 |
| 345 // Store mime_type_ at initialization time since we make it lowercase. | 345 // Store mime_type_ at initialization time since we make it lowercase. |
| 346 mime_type_ = base::StringToLowerASCII(LookupAttribute(args_, kTypeAttribute)); | 346 mime_type_ = base::ToLowerASCII(LookupAttribute(args_, kTypeAttribute)); |
| 347 } | 347 } |
| 348 | 348 |
| 349 void NexeLoadManager::ReportStartupOverhead() const { | 349 void NexeLoadManager::ReportStartupOverhead() const { |
| 350 base::TimeDelta overhead = base::Time::Now() - init_time_; | 350 base::TimeDelta overhead = base::Time::Now() - init_time_; |
| 351 HistogramStartupTimeMedium( | 351 HistogramStartupTimeMedium( |
| 352 "NaCl.Perf.StartupTime.NaClOverhead", overhead, nexe_size_); | 352 "NaCl.Perf.StartupTime.NaClOverhead", overhead, nexe_size_); |
| 353 } | 353 } |
| 354 | 354 |
| 355 bool NexeLoadManager::RequestNaClManifest(const std::string& url) { | 355 bool NexeLoadManager::RequestNaClManifest(const std::string& url) { |
| 356 if (plugin_base_url_.is_valid()) { | 356 if (plugin_base_url_.is_valid()) { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 // to provide error handling. | 438 // to provide error handling. |
| 439 } | 439 } |
| 440 | 440 |
| 441 void NexeLoadManager::CopyCrashLogToJsConsole(const std::string& crash_log) { | 441 void NexeLoadManager::CopyCrashLogToJsConsole(const std::string& crash_log) { |
| 442 base::StringTokenizer t(crash_log, "\n"); | 442 base::StringTokenizer t(crash_log, "\n"); |
| 443 while (t.GetNext()) | 443 while (t.GetNext()) |
| 444 LogToConsole(t.token()); | 444 LogToConsole(t.token()); |
| 445 } | 445 } |
| 446 | 446 |
| 447 } // namespace nacl | 447 } // namespace nacl |
| OLD | NEW |