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

Side by Side Diff: chrome/browser/extensions/api/socket/socket_api.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_SOCKET_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SOCKET_SOCKET_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_SOCKET_SOCKET_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_SOCKET_SOCKET_API_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "chrome/browser/extensions/api/api_function.h" 9 #include "chrome/browser/extensions/api/api_function.h"
10 #include "chrome/browser/extensions/api/api_resource_manager.h" 10 #include "chrome/browser/extensions/api/api_resource_manager.h"
(...skipping 19 matching lines...) Expand all
30 public: 30 public:
31 SocketAsyncApiFunction(); 31 SocketAsyncApiFunction();
32 32
33 protected: 33 protected:
34 virtual ~SocketAsyncApiFunction(); 34 virtual ~SocketAsyncApiFunction();
35 35
36 // AsyncApiFunction: 36 // AsyncApiFunction:
37 virtual bool PrePrepare() OVERRIDE; 37 virtual bool PrePrepare() OVERRIDE;
38 virtual bool Respond() OVERRIDE; 38 virtual bool Respond() OVERRIDE;
39 39
40 Socket* GetSocket(int api_resource_id);
41 void RemoveSocket(int api_resource_id);
42
40 ApiResourceManager<Socket>* manager_; 43 ApiResourceManager<Socket>* manager_;
41 }; 44 };
42 45
43 class SocketExtensionWithDnsLookupFunction : public SocketAsyncApiFunction { 46 class SocketExtensionWithDnsLookupFunction : public SocketAsyncApiFunction {
44 protected: 47 protected:
45 SocketExtensionWithDnsLookupFunction(); 48 SocketExtensionWithDnsLookupFunction();
46 virtual ~SocketExtensionWithDnsLookupFunction(); 49 virtual ~SocketExtensionWithDnsLookupFunction();
47 50
48 void StartDnsLookup(const std::string& hostname); 51 void StartDnsLookup(const std::string& hostname);
49 virtual void AfterDnsLookup(int lookup_result) = 0; 52 virtual void AfterDnsLookup(int lookup_result) = 0;
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 312
310 private: 313 private:
311 void GetNetworkListOnFileThread(); 314 void GetNetworkListOnFileThread();
312 void HandleGetNetworkListError(); 315 void HandleGetNetworkListError();
313 void SendResponseOnUIThread(const net::NetworkInterfaceList& interface_list); 316 void SendResponseOnUIThread(const net::NetworkInterfaceList& interface_list);
314 }; 317 };
315 318
316 } // namespace extensions 319 } // namespace extensions
317 320
318 #endif // CHROME_BROWSER_EXTENSIONS_API_SOCKET_SOCKET_API_H_ 321 #endif // CHROME_BROWSER_EXTENSIONS_API_SOCKET_SOCKET_API_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/socket/socket.cc ('k') | chrome/browser/extensions/api/socket/socket_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698