| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_URL_REQUEST_URL_REQUEST_NETLOG_PARAMS_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_NETLOG_PARAMS_H_ |
| 6 #define NET_URL_REQUEST_URL_REQUEST_NETLOG_PARAMS_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_NETLOG_PARAMS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 13 #include "net/base/net_export.h" | 13 #include "net/base/net_export.h" |
| 14 #include "net/base/net_log.h" | 14 #include "net/base/net_log.h" |
| 15 #include "net/base/request_priority.h" | 15 #include "net/base/request_priority.h" |
| 16 | 16 |
| 17 namespace net { | 17 namespace net { |
| 18 | 18 |
| 19 // Holds the parameters to emit to the NetLog when starting a URLRequest. | 19 // Holds the parameters to emit to the NetLog when starting a URLRequest. |
| 20 class NET_EXPORT URLRequestStartEventParameters | 20 class NET_EXPORT URLRequestStartEventParameters |
| 21 : public NetLog::EventParameters { | 21 : public NetLog::EventParameters { |
| 22 public: | 22 public: |
| 23 URLRequestStartEventParameters(const GURL& url, | 23 URLRequestStartEventParameters(const GURL& url, |
| 24 const std::string& method, | 24 const std::string& method, |
| 25 int load_flags, | 25 int load_flags, |
| 26 RequestPriority priority); | 26 RequestPriority priority); |
| 27 | 27 |
| 28 const GURL& url() const { | |
| 29 return url_; | |
| 30 } | |
| 31 | |
| 32 int load_flags() const { | |
| 33 return load_flags_; | |
| 34 } | |
| 35 | |
| 36 virtual base::Value* ToValue() const OVERRIDE; | 28 virtual base::Value* ToValue() const OVERRIDE; |
| 37 | 29 |
| 38 protected: | 30 protected: |
| 39 virtual ~URLRequestStartEventParameters(); | 31 virtual ~URLRequestStartEventParameters(); |
| 40 | 32 |
| 41 private: | 33 private: |
| 42 const GURL url_; | 34 const GURL url_; |
| 43 const std::string method_; | 35 const std::string method_; |
| 44 const int load_flags_; | 36 const int load_flags_; |
| 45 const RequestPriority priority_; | 37 const RequestPriority priority_; |
| 46 | 38 |
| 47 DISALLOW_COPY_AND_ASSIGN(URLRequestStartEventParameters); | 39 DISALLOW_COPY_AND_ASSIGN(URLRequestStartEventParameters); |
| 48 }; | 40 }; |
| 49 | 41 |
| 42 bool NET_EXPORT StartEventLoadFlagsFromEventParameters( |
| 43 base::Value* event_params, |
| 44 int* load_flags); |
| 45 |
| 50 } // namespace net | 46 } // namespace net |
| 51 | 47 |
| 52 #endif // NET_URL_REQUEST_URL_REQUEST_NETLOG_PARAMS_H_ | 48 #endif // NET_URL_REQUEST_URL_REQUEST_NETLOG_PARAMS_H_ |
| OLD | NEW |