diff options
author | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-20 01:08:17 +0000 |
---|---|---|
committer | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-20 01:08:17 +0000 |
commit | 73f5d66b06b9a02626a8addecb24986a88430176 (patch) | |
tree | d7348008e89272c3ad907c6a01b94e7e8960a0a4 /net/base/net_module.h | |
parent | b1412de10508641134801305b47c8f7255ac2280 (diff) | |
download | chromium_src-73f5d66b06b9a02626a8addecb24986a88430176.zip chromium_src-73f5d66b06b9a02626a8addecb24986a88430176.tar.gz chromium_src-73f5d66b06b9a02626a8addecb24986a88430176.tar.bz2 |
Make the net resource interface use StringPiece instead of std::string. This means we can point directly into the resource in the binary, instead of copying. This makes sense for the TLD data, which doesn't need to be copied around.
Review URL: http://codereview.chromium.org/11506
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5740 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/net_module.h')
-rw-r--r-- | net/base/net_module.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/base/net_module.h b/net/base/net_module.h index ef309ff..e527b9f 100644 --- a/net/base/net_module.h +++ b/net/base/net_module.h @@ -8,6 +8,7 @@ #include <string> #include "base/basictypes.h" +#include "base/string_piece.h" namespace net { @@ -20,7 +21,7 @@ namespace net { // class NetModule { public: - typedef std::string (*ResourceProvider)(int key); + typedef StringPiece (*ResourceProvider)(int key); // Set the function to call when the net module needs resources static void SetResourceProvider(ResourceProvider func); @@ -28,7 +29,7 @@ class NetModule { // Call the resource provider (if one exists) to get the specified resource. // Returns an empty string if the resource does not exist or if there is no // resource provider. - static std::string GetResource(int key); + static StringPiece GetResource(int key); private: DISALLOW_IMPLICIT_CONSTRUCTORS(NetModule); |