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

Unified Diff: net/url_request/url_request_netlog_params.cc

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_netlog_params.h ('k') | remoting/host/vlog_net_log.h » ('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.cc
===================================================================
--- net/url_request/url_request_netlog_params.cc (revision 141317)
+++ net/url_request/url_request_netlog_params.cc (working copy)
@@ -5,29 +5,32 @@
#include "net/url_request/url_request_netlog_params.h"
#include "base/values.h"
+#include "googleurl/src/gurl.h"
namespace net {
-URLRequestStartEventParameters::URLRequestStartEventParameters(
- const GURL& url,
- const std::string& method,
- int load_flags,
- RequestPriority priority)
- : url_(url),
- method_(method),
- load_flags_(load_flags),
- priority_(priority) {
-}
-
-Value* URLRequestStartEventParameters::ToValue() const {
+Value* NetLogURLRequestStartCallback(const GURL* url,
+ const std::string* method,
+ int load_flags,
+ RequestPriority priority,
+ NetLog::LogLevel /* log_level */) {
DictionaryValue* dict = new DictionaryValue();
- dict->SetString("url", url_.possibly_invalid_spec());
- dict->SetString("method", method_);
- dict->SetInteger("load_flags", load_flags_);
- dict->SetInteger("priority", static_cast<int>(priority_));
+ dict->SetString("url", url->possibly_invalid_spec());
+ dict->SetString("method", *method);
+ dict->SetInteger("load_flags", load_flags);
+ dict->SetInteger("priority", static_cast<int>(priority));
return dict;
}
-URLRequestStartEventParameters::~URLRequestStartEventParameters() {}
+bool StartEventLoadFlagsFromEventParams(const Value* event_params,
+ int* load_flags) {
+ const DictionaryValue* dict;
+ if (!event_params->GetAsDictionary(&dict) ||
+ !dict->GetInteger("load_flags", load_flags)) {
+ *load_flags = 0;
+ return false;
+ }
+ return true;
+}
} // namespace net
« no previous file with comments | « net/url_request/url_request_netlog_params.h ('k') | remoting/host/vlog_net_log.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698