| 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/browser/plugin_process_host.h" | 5 #include "content/browser/plugin_process_host.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
| 10 #include <utility> // for pair<> | 10 #include <utility> // for pair<> |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 {} | 105 {} |
| 106 | 106 |
| 107 virtual ~PluginSandboxedProcessLauncherDelegate() {} | 107 virtual ~PluginSandboxedProcessLauncherDelegate() {} |
| 108 | 108 |
| 109 #if defined(OS_WIN) | 109 #if defined(OS_WIN) |
| 110 virtual bool ShouldSandbox() override { | 110 virtual bool ShouldSandbox() override { |
| 111 return false; | 111 return false; |
| 112 } | 112 } |
| 113 | 113 |
| 114 #elif defined(OS_POSIX) | 114 #elif defined(OS_POSIX) |
| 115 virtual int GetIpcFd() override { | 115 virtual base::ScopedFD TakeIpcFd() override { |
| 116 return ipc_fd_; | 116 return ipc_fd_.Pass(); |
| 117 } | 117 } |
| 118 #endif // OS_WIN | 118 #endif // OS_WIN |
| 119 | 119 |
| 120 private: | 120 private: |
| 121 #if defined(OS_POSIX) | 121 #if defined(OS_POSIX) |
| 122 int ipc_fd_; | 122 base::ScopedFD ipc_fd_; |
| 123 #endif // OS_POSIX | 123 #endif // OS_POSIX |
| 124 | 124 |
| 125 DISALLOW_COPY_AND_ASSIGN(PluginSandboxedProcessLauncherDelegate); | 125 DISALLOW_COPY_AND_ASSIGN(PluginSandboxedProcessLauncherDelegate); |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 PluginProcessHost::PluginProcessHost() | 128 PluginProcessHost::PluginProcessHost() |
| 129 : pid_(base::kNullProcessId) | 129 : pid_(base::kNullProcessId) |
| 130 #if defined(OS_MACOSX) | 130 #if defined(OS_MACOSX) |
| 131 , plugin_cursor_visible_(true) | 131 , plugin_cursor_visible_(true) |
| 132 #endif | 132 #endif |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 | 429 |
| 430 void PluginProcessHost::GetContexts(const ResourceHostMsg_Request& request, | 430 void PluginProcessHost::GetContexts(const ResourceHostMsg_Request& request, |
| 431 ResourceContext** resource_context, | 431 ResourceContext** resource_context, |
| 432 net::URLRequestContext** request_context) { | 432 net::URLRequestContext** request_context) { |
| 433 *resource_context = | 433 *resource_context = |
| 434 resource_context_map_[request.origin_pid].resource_context; | 434 resource_context_map_[request.origin_pid].resource_context; |
| 435 *request_context = (*resource_context)->GetRequestContext(); | 435 *request_context = (*resource_context)->GetRequestContext(); |
| 436 } | 436 } |
| 437 | 437 |
| 438 } // namespace content | 438 } // namespace content |
| OLD | NEW |