| 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/extensions/api/messaging/native_process_launcher.h" | 5 #include "chrome/browser/extensions/api/messaging/native_process_launcher.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 // Not an allowed origin. | 153 // Not an allowed origin. |
| 154 content::BrowserThread::PostTask( | 154 content::BrowserThread::PostTask( |
| 155 content::BrowserThread::IO, FROM_HERE, | 155 content::BrowserThread::IO, FROM_HERE, |
| 156 base::Bind(&NativeProcessLauncherImpl::Core::CallCallbackOnIOThread, | 156 base::Bind(&NativeProcessLauncherImpl::Core::CallCallbackOnIOThread, |
| 157 this, callback, false, | 157 this, callback, false, |
| 158 base::kInvalidPlatformFileValue, | 158 base::kInvalidPlatformFileValue, |
| 159 base::kInvalidPlatformFileValue)); | 159 base::kInvalidPlatformFileValue)); |
| 160 return; | 160 return; |
| 161 } | 161 } |
| 162 | 162 |
| 163 CommandLine command_line(manifest->path()); |
| 164 command_line.AppendArg(origin.spec()); |
| 165 |
| 163 base::PlatformFile read_file; | 166 base::PlatformFile read_file; |
| 164 base::PlatformFile write_file; | 167 base::PlatformFile write_file; |
| 165 bool result = NativeProcessLauncher::LaunchNativeProcess( | 168 bool result = NativeProcessLauncher::LaunchNativeProcess( |
| 166 manifest->path(), &read_file, &write_file); | 169 command_line, &read_file, &write_file); |
| 167 | 170 |
| 168 content::BrowserThread::PostTask( | 171 content::BrowserThread::PostTask( |
| 169 content::BrowserThread::IO, FROM_HERE, | 172 content::BrowserThread::IO, FROM_HERE, |
| 170 base::Bind(&NativeProcessLauncherImpl::Core::CallCallbackOnIOThread, | 173 base::Bind(&NativeProcessLauncherImpl::Core::CallCallbackOnIOThread, |
| 171 this, callback, result, read_file, write_file)); | 174 this, callback, result, read_file, write_file)); |
| 172 } | 175 } |
| 173 | 176 |
| 174 void NativeProcessLauncherImpl::Core::CallCallbackOnIOThread( | 177 void NativeProcessLauncherImpl::Core::CallCallbackOnIOThread( |
| 175 LaunchedCallback callback, | 178 LaunchedCallback callback, |
| 176 bool result, | 179 bool result, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 203 } | 206 } |
| 204 | 207 |
| 205 } // namespace | 208 } // namespace |
| 206 | 209 |
| 207 // static | 210 // static |
| 208 scoped_ptr<NativeProcessLauncher> NativeProcessLauncher::CreateDefault() { | 211 scoped_ptr<NativeProcessLauncher> NativeProcessLauncher::CreateDefault() { |
| 209 return scoped_ptr<NativeProcessLauncher>(new NativeProcessLauncherImpl()); | 212 return scoped_ptr<NativeProcessLauncher>(new NativeProcessLauncherImpl()); |
| 210 } | 213 } |
| 211 | 214 |
| 212 } // namespace extensions | 215 } // namespace extensions |
| OLD | NEW |