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

Side by Side Diff: chrome/browser/extensions/api/socket/udp_socket.h

Issue 10919201: Make sure that a given app/extension requests only its own resources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Improve tests; fix merge conflicts. Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef CHROME_BROWSER_EXTENSIONS_API_SOCKET_UDP_SOCKET_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SOCKET_UDP_SOCKET_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_SOCKET_UDP_SOCKET_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_SOCKET_UDP_SOCKET_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "chrome/browser/extensions/api/socket/socket.h" 10 #include "chrome/browser/extensions/api/socket/socket.h"
11 #include "net/udp/udp_socket.h" 11 #include "net/udp/udp_socket.h"
12 12
13 namespace extensions { 13 namespace extensions {
14 14
15 class ApiResourceEventNotifier; 15 class ApiResourceEventNotifier;
16 16
17 class UDPSocket : public Socket { 17 class UDPSocket : public Socket {
18 public: 18 public:
19 explicit UDPSocket(ApiResourceEventNotifier* event_notifier); 19 UDPSocket(const std::string& owner_extension_id,
20 ApiResourceEventNotifier* event_notifier);
20 virtual ~UDPSocket(); 21 virtual ~UDPSocket();
21 22
22 virtual void Connect(const std::string& address, 23 virtual void Connect(const std::string& address,
23 int port, 24 int port,
24 const CompletionCallback& callback) OVERRIDE; 25 const CompletionCallback& callback) OVERRIDE;
25 virtual void Disconnect() OVERRIDE; 26 virtual void Disconnect() OVERRIDE;
26 virtual int Bind(const std::string& address, int port) OVERRIDE; 27 virtual int Bind(const std::string& address, int port) OVERRIDE;
27 virtual void Read(int count, 28 virtual void Read(int count,
28 const ReadCompletionCallback& callback) OVERRIDE; 29 const ReadCompletionCallback& callback) OVERRIDE;
29 virtual void RecvFrom(int count, 30 virtual void RecvFrom(int count,
(...skipping 28 matching lines...) Expand all
58 ReadCompletionCallback read_callback_; 59 ReadCompletionCallback read_callback_;
59 60
60 RecvFromCompletionCallback recv_from_callback_; 61 RecvFromCompletionCallback recv_from_callback_;
61 62
62 CompletionCallback send_to_callback_; 63 CompletionCallback send_to_callback_;
63 }; 64 };
64 65
65 } // namespace extensions 66 } // namespace extensions
66 67
67 #endif // CHROME_BROWSER_EXTENSIONS_API_SOCKET_UDP_SOCKET_H_ 68 #endif // CHROME_BROWSER_EXTENSIONS_API_SOCKET_UDP_SOCKET_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/socket/tcp_socket_unittest.cc ('k') | chrome/browser/extensions/api/socket/udp_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698