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

Side by Side Diff: net/base/net_module.h

Issue 6969077: net: Add NET_API to net/base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 NET_BASE_NET_MODULE_H__ 5 #ifndef NET_BASE_NET_MODULE_H__
6 #define NET_BASE_NET_MODULE_H__ 6 #define NET_BASE_NET_MODULE_H__
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/string_piece.h" 10 #include "base/string_piece.h"
11 #include "net/base/net_api.h"
11 12
12 namespace net { 13 namespace net {
13 14
14 // Defines global initializers and associated methods for the net module. 15 // Defines global initializers and associated methods for the net module.
15 // 16 //
16 // The network module does not have direct access to the way application 17 // The network module does not have direct access to the way application
17 // resources are stored and fetched by the embedding application (e.g., it 18 // resources are stored and fetched by the embedding application (e.g., it
18 // cannot see the ResourceBundle class used by Chrome), so it uses this API to 19 // cannot see the ResourceBundle class used by Chrome), so it uses this API to
19 // get access to such resources. 20 // get access to such resources.
20 // 21 //
21 class NetModule { 22 class NET_API NetModule {
22 public: 23 public:
23 typedef base::StringPiece (*ResourceProvider)(int key); 24 typedef base::StringPiece (*ResourceProvider)(int key);
24 25
25 // Set the function to call when the net module needs resources 26 // Set the function to call when the net module needs resources
26 static void SetResourceProvider(ResourceProvider func); 27 static void SetResourceProvider(ResourceProvider func);
27 28
28 // Call the resource provider (if one exists) to get the specified resource. 29 // Call the resource provider (if one exists) to get the specified resource.
29 // Returns an empty string if the resource does not exist or if there is no 30 // Returns an empty string if the resource does not exist or if there is no
30 // resource provider. 31 // resource provider.
31 static base::StringPiece GetResource(int key); 32 static base::StringPiece GetResource(int key);
32 33
33 private: 34 private:
34 DISALLOW_IMPLICIT_CONSTRUCTORS(NetModule); 35 DISALLOW_IMPLICIT_CONSTRUCTORS(NetModule);
35 }; 36 };
36 37
37 } // namespace net 38 } // namespace net
38 39
39 #endif // NET_BASE_NET_MODULE_H__ 40 #endif // NET_BASE_NET_MODULE_H__
OLDNEW
« base/compiler_specific.h ('K') | « net/base/net_log.h ('k') | net/base/net_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698