| 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 "content/renderer/pepper/host_globals.h" | 5 #include "content/renderer/pepper/host_globals.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 } | 69 } |
| 70 | 70 |
| 71 WebConsoleMessage MakeLogMessage(PP_LogLevel level, | 71 WebConsoleMessage MakeLogMessage(PP_LogLevel level, |
| 72 const std::string& source, | 72 const std::string& source, |
| 73 const std::string& message) { | 73 const std::string& message) { |
| 74 std::string result = source; | 74 std::string result = source; |
| 75 if (!result.empty()) | 75 if (!result.empty()) |
| 76 result.append(": "); | 76 result.append(": "); |
| 77 result.append(message); | 77 result.append(message); |
| 78 return WebConsoleMessage(LogLevelToWebLogLevel(level), | 78 return WebConsoleMessage(LogLevelToWebLogLevel(level), |
| 79 WebString(base::UTF8ToUTF16(result))); | 79 WebString::fromUTF8(result)); |
| 80 } | 80 } |
| 81 | 81 |
| 82 } // namespace | 82 } // namespace |
| 83 | 83 |
| 84 HostGlobals* HostGlobals::host_globals_ = NULL; | 84 HostGlobals* HostGlobals::host_globals_ = NULL; |
| 85 | 85 |
| 86 HostGlobals::HostGlobals() | 86 HostGlobals::HostGlobals() |
| 87 : ppapi::PpapiGlobals(), | 87 : ppapi::PpapiGlobals(), |
| 88 resource_tracker_(ResourceTracker::SINGLE_THREADED) { | 88 resource_tracker_(ResourceTracker::SINGLE_THREADED) { |
| 89 DCHECK(!host_globals_); | 89 DCHECK(!host_globals_); |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 << instance << " is not a PP_Instance."; | 273 << instance << " is not a PP_Instance."; |
| 274 InstanceMap::iterator found = instance_map_.find(instance); | 274 InstanceMap::iterator found = instance_map_.find(instance); |
| 275 if (found == instance_map_.end()) | 275 if (found == instance_map_.end()) |
| 276 return NULL; | 276 return NULL; |
| 277 return found->second; | 277 return found->second; |
| 278 } | 278 } |
| 279 | 279 |
| 280 bool HostGlobals::IsHostGlobals() const { return true; } | 280 bool HostGlobals::IsHostGlobals() const { return true; } |
| 281 | 281 |
| 282 } // namespace content | 282 } // namespace content |
| OLD | NEW |