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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 void HostGlobals::PreCacheFontForFlash(const void* logfontw) { | 141 void HostGlobals::PreCacheFontForFlash(const void* logfontw) { |
142 // Not implemented in-process. | 142 // Not implemented in-process. |
143 } | 143 } |
144 | 144 |
145 void HostGlobals::LogWithSource(PP_Instance instance, | 145 void HostGlobals::LogWithSource(PP_Instance instance, |
146 PP_LogLevel level, | 146 PP_LogLevel level, |
147 const std::string& source, | 147 const std::string& source, |
148 const std::string& value) { | 148 const std::string& value) { |
149 PepperPluginInstanceImpl* instance_object = | 149 PepperPluginInstanceImpl* instance_object = |
150 HostGlobals::Get()->GetInstance(instance); | 150 HostGlobals::Get()->GetInstance(instance); |
151 // It's possible to process this message in a nested message loop while | 151 // It's possible to process this message in a nested run loop while |
152 // detaching a Document… | 152 // detaching a Document… |
153 // TODO(dcheng): Make it so this can't happen. https://crbug.com/561683 | 153 // TODO(dcheng): Make it so this can't happen. https://crbug.com/561683 |
154 if (instance_object && | 154 if (instance_object && |
155 instance_object->container()->GetDocument().GetFrame()) { | 155 instance_object->container()->GetDocument().GetFrame()) { |
156 instance_object->container()->GetDocument().GetFrame()->AddMessageToConsole( | 156 instance_object->container()->GetDocument().GetFrame()->AddMessageToConsole( |
157 MakeLogMessage(level, source, value)); | 157 MakeLogMessage(level, source, value)); |
158 } else { | 158 } else { |
159 BroadcastLogWithSource(0, level, source, value); | 159 BroadcastLogWithSource(0, level, source, value); |
160 } | 160 } |
161 } | 161 } |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 << instance << " is not a PP_Instance."; | 271 << instance << " is not a PP_Instance."; |
272 InstanceMap::iterator found = instance_map_.find(instance); | 272 InstanceMap::iterator found = instance_map_.find(instance); |
273 if (found == instance_map_.end()) | 273 if (found == instance_map_.end()) |
274 return NULL; | 274 return NULL; |
275 return found->second; | 275 return found->second; |
276 } | 276 } |
277 | 277 |
278 bool HostGlobals::IsHostGlobals() const { return true; } | 278 bool HostGlobals::IsHostGlobals() const { return true; } |
279 | 279 |
280 } // namespace content | 280 } // namespace content |
OLD | NEW |