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

Unified Diff: net/url_request/url_request_netlog_params.h

Issue 10399083: Make NetLog take in callbacks that return Values (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix merge error Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/url_request/url_request.cc ('k') | net/url_request/url_request_netlog_params.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_netlog_params.h
===================================================================
--- net/url_request/url_request_netlog_params.h (revision 141317)
+++ net/url_request/url_request_netlog_params.h (working copy)
@@ -8,45 +8,33 @@
#include <string>
-#include "base/basictypes.h"
-#include "googleurl/src/gurl.h"
#include "net/base/net_export.h"
#include "net/base/net_log.h"
#include "net/base/request_priority.h"
-namespace net {
+class GURL;
-// Holds the parameters to emit to the NetLog when starting a URLRequest.
-class NET_EXPORT URLRequestStartEventParameters
- : public NetLog::EventParameters {
- public:
- URLRequestStartEventParameters(const GURL& url,
- const std::string& method,
- int load_flags,
- RequestPriority priority);
+namespace base {
+class Value;
+}
- const GURL& url() const {
- return url_;
- }
+namespace net {
- int load_flags() const {
- return load_flags_;
- }
+// Returns a Value containing NetLog parameters for starting a URLRequest.
+NET_EXPORT base::Value* NetLogURLRequestStartCallback(
+ const GURL* url,
+ const std::string* method,
+ int load_flags,
+ RequestPriority priority,
+ NetLog::LogLevel /* log_level */);
- virtual base::Value* ToValue() const OVERRIDE;
+// Attempts to extract the load flags from a Value created by the above
+// function. On success, sets |load_flags| accordingly and returns true.
+// On failure, sets |load_flags| to 0.
+NET_EXPORT bool StartEventLoadFlagsFromEventParams(
+ const base::Value* event_params,
+ int* load_flags);
- protected:
- virtual ~URLRequestStartEventParameters();
-
- private:
- const GURL url_;
- const std::string method_;
- const int load_flags_;
- const RequestPriority priority_;
-
- DISALLOW_COPY_AND_ASSIGN(URLRequestStartEventParameters);
-};
-
} // namespace net
#endif // NET_URL_REQUEST_URL_REQUEST_NETLOG_PARAMS_H_
« no previous file with comments | « net/url_request/url_request.cc ('k') | net/url_request/url_request_netlog_params.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698