forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a net::HttpNetworkDelegate and a ChromeNetworkDelegate.
net::HttpNetworkDelegate is an interface for providing hooks into http network activity. ChromeNetworkDelgate implements this interface in chrome/ code. In the future, it might also implement other interfaces. My only current intended consumer for this would be extensions. There's no actual behavior change, this is all just plumbing for now. BUG=29314 Review URL: http://codereview.chromium.org/2749015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49804 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
willchan@chromium.org
committed
Jun 15, 2010
1 parent
7c186b1
commit ac03952
Showing
28 changed files
with
156 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) 2010 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "chrome/browser/net/chrome_network_delegate.h" | ||
|
||
#include "base/logging.h" | ||
#include "net/http/http_request_headers.h" | ||
|
||
ChromeNetworkDelegate::ChromeNetworkDelegate() {} | ||
ChromeNetworkDelegate::~ChromeNetworkDelegate() {} | ||
|
||
void ChromeNetworkDelegate::OnSendHttpRequest( | ||
net::HttpRequestHeaders* headers) { | ||
DCHECK(headers); | ||
|
||
// TODO(willchan): Add Chrome-side hooks to listen / mutate requests here. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) 2010 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | ||
#define CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | ||
|
||
#include "base/basictypes.h" | ||
#include "net/http/http_network_delegate.h" | ||
|
||
// ChromeNetworkDelegate is the central point from within the chrome code to | ||
// add hooks into the network stack. In the future, we can use this for | ||
// extensions to register hooks for the network stack. | ||
class ChromeNetworkDelegate : public net::HttpNetworkDelegate { | ||
public: | ||
ChromeNetworkDelegate(); | ||
~ChromeNetworkDelegate(); | ||
|
||
// net::HttpNetworkDelegate methods: | ||
|
||
virtual void OnSendHttpRequest(net::HttpRequestHeaders* headers); | ||
|
||
// TODO(willchan): Add functions for consumers to register ways to | ||
// access/modify the request. | ||
|
||
private: | ||
DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); | ||
}; | ||
|
||
#endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) 2010 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef NET_HTTP_HTTP_NETWORK_DELEGATE_H_ | ||
#define NET_HTTP_HTTP_NETWORK_DELEGATE_H_ | ||
|
||
namespace net { | ||
|
||
class HttpRequestHeaders; | ||
|
||
class HttpNetworkDelegate { | ||
public: | ||
// Called right before the HTTP headers are sent. Allows the delegate to | ||
// read/write |headers| before they get sent out. | ||
virtual void OnSendHttpRequest(HttpRequestHeaders* headers) = 0; | ||
|
||
protected: | ||
virtual ~HttpNetworkDelegate() {} | ||
}; | ||
|
||
} // namespace net | ||
|
||
#endif // NET_HTTP_HTTP_NETWORK_DELEGATE_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.