| 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 "ppapi/nacl_irt/ppapi_dispatcher.h" | 5 #include "ppapi/nacl_irt/ppapi_dispatcher.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 void PpapiDispatcher::OnMsgInitializeNaClDispatcher( | 159 void PpapiDispatcher::OnMsgInitializeNaClDispatcher( |
| 160 const PpapiNaClPluginArgs& args) { | 160 const PpapiNaClPluginArgs& args) { |
| 161 static bool command_line_and_logging_initialized = false; | 161 static bool command_line_and_logging_initialized = false; |
| 162 if (command_line_and_logging_initialized) { | 162 if (command_line_and_logging_initialized) { |
| 163 LOG(FATAL) << "InitializeNaClDispatcher must be called once per plugin."; | 163 LOG(FATAL) << "InitializeNaClDispatcher must be called once per plugin."; |
| 164 return; | 164 return; |
| 165 } | 165 } |
| 166 | 166 |
| 167 command_line_and_logging_initialized = true; | 167 command_line_and_logging_initialized = true; |
| 168 CommandLine::Init(0, NULL); | 168 base::CommandLine::Init(0, NULL); |
| 169 for (size_t i = 0; i < args.switch_names.size(); ++i) { | 169 for (size_t i = 0; i < args.switch_names.size(); ++i) { |
| 170 DCHECK(i < args.switch_values.size()); | 170 DCHECK(i < args.switch_values.size()); |
| 171 CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 171 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
| 172 args.switch_names[i], args.switch_values[i]); | 172 args.switch_names[i], args.switch_values[i]); |
| 173 } | 173 } |
| 174 logging::LoggingSettings settings; | 174 logging::LoggingSettings settings; |
| 175 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; | 175 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
| 176 logging::InitLogging(settings); | 176 logging::InitLogging(settings); |
| 177 | 177 |
| 178 proxy::PluginGlobals::Get()->set_keepalive_throttle_interval_milliseconds( | 178 proxy::PluginGlobals::Get()->set_keepalive_throttle_interval_milliseconds( |
| 179 args.keepalive_throttle_interval_milliseconds); | 179 args.keepalive_throttle_interval_milliseconds); |
| 180 | 180 |
| 181 // Tell the process-global GetInterface which interfaces it can return to the | 181 // Tell the process-global GetInterface which interfaces it can return to the |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 NOTREACHED(); | 217 NOTREACHED(); |
| 218 return; | 218 return; |
| 219 } | 219 } |
| 220 std::map<uint32, proxy::PluginDispatcher*>::iterator dispatcher = | 220 std::map<uint32, proxy::PluginDispatcher*>::iterator dispatcher = |
| 221 plugin_dispatchers_.find(id); | 221 plugin_dispatchers_.find(id); |
| 222 if (dispatcher != plugin_dispatchers_.end()) | 222 if (dispatcher != plugin_dispatchers_.end()) |
| 223 dispatcher->second->OnMessageReceived(msg); | 223 dispatcher->second->OnMessageReceived(msg); |
| 224 } | 224 } |
| 225 | 225 |
| 226 } // namespace ppapi | 226 } // namespace ppapi |
| OLD | NEW |