Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2155)

Unified Diff: extensions/browser/api/socket/socket_api.h

Issue 1022663003: Bind open firewall ports to visible application windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a dummy implementation of WebContentsModalDialogManager::CreateNativeWebModalManager to fix lin… Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: extensions/browser/api/socket/socket_api.h
diff --git a/extensions/browser/api/socket/socket_api.h b/extensions/browser/api/socket/socket_api.h
index 2500dd0ae64d36c0d9bdc2d5910099f13e2639a1..a3e4e0ead7872f5f4a7cdf7c22ec19c06e96fc36 100644
--- a/extensions/browser/api/socket/socket_api.h
+++ b/extensions/browser/api/socket/socket_api.h
@@ -17,9 +17,9 @@
#include "net/dns/host_resolver.h"
#include "net/socket/tcp_client_socket.h"
-namespace chromeos {
-class FirewallHole;
-}
+#if defined(OS_CHROMEOS)
+#include "extensions/browser/api/socket/app_firewall_hole_manager.h"
+#endif // OS_CHROMEOS
namespace content {
class BrowserContext;
@@ -33,8 +33,8 @@ class SSLClientSocket;
}
namespace extensions {
-class TLSSocket;
class Socket;
+class TLSSocket;
// A simple interface to ApiResourceManager<Socket> or derived class. The goal
// of this interface is to allow Socket API functions to use distinct instances
@@ -122,17 +122,20 @@ class SocketAsyncApiFunction : public AsyncApiFunction {
void RemoveSocket(int api_resource_id);
base::hash_set<int>* GetSocketIds();
- // Only implemented on Chrome OS.
+ // A no-op outside of Chrome OS.
void OpenFirewallHole(const std::string& address,
int socket_id,
Socket* socket);
private:
#if defined(OS_CHROMEOS)
- void OnFirewallHoleOpenedOnUIThread(int socket_id,
- scoped_ptr<chromeos::FirewallHole> hole);
- void OnFirewallHoleOpened(int socket_id,
- scoped_ptr<chromeos::FirewallHole> hole);
+ void OpenFirewallHoleOnUIThread(AppFirewallHole::PortType type,
+ uint16_t port,
+ int socket_id);
+ void OnFirewallHoleOpened(
+ int socket_id,
+ scoped_ptr<AppFirewallHole, content::BrowserThread::DeleteOnUIThread>
+ hole);
#endif // OS_CHROMEOS
scoped_ptr<SocketResourceManagerInterface> manager_;

Powered by Google App Engine
This is Rietveld 408576698