| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/extensions/extension_webrequest_api.h" | 5 #include "chrome/browser/extensions/extension_webrequest_api.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 108 |
| 109 // NetLog parameter to indicate that an extension modified a request. | 109 // NetLog parameter to indicate that an extension modified a request. |
| 110 class NetLogModificationParameter : public NetLogExtensionIdParameter { | 110 class NetLogModificationParameter : public NetLogExtensionIdParameter { |
| 111 public: | 111 public: |
| 112 explicit NetLogModificationParameter(const std::string& extension_id) | 112 explicit NetLogModificationParameter(const std::string& extension_id) |
| 113 : NetLogExtensionIdParameter(extension_id) {} | 113 : NetLogExtensionIdParameter(extension_id) {} |
| 114 virtual ~NetLogModificationParameter() {} | 114 virtual ~NetLogModificationParameter() {} |
| 115 | 115 |
| 116 virtual base::Value* ToValue() const OVERRIDE { | 116 virtual base::Value* ToValue() const OVERRIDE { |
| 117 Value* parent = NetLogExtensionIdParameter::ToValue(); | 117 Value* parent = NetLogExtensionIdParameter::ToValue(); |
| 118 DCHECK(parent->IsType(Value::TYPE_DICTIONARY)); | 118 DCHECK(parent->IsDictionary()); |
| 119 DictionaryValue* dict = static_cast<DictionaryValue*>(parent); | 119 DictionaryValue* dict = static_cast<DictionaryValue*>(parent); |
| 120 dict->Set("modified_headers", modified_headers_.DeepCopy()); | 120 dict->Set("modified_headers", modified_headers_.DeepCopy()); |
| 121 dict->Set("deleted_headers", deleted_headers_.DeepCopy()); | 121 dict->Set("deleted_headers", deleted_headers_.DeepCopy()); |
| 122 return dict; | 122 return dict; |
| 123 } | 123 } |
| 124 | 124 |
| 125 void DeletedHeader(const std::string& key) { | 125 void DeletedHeader(const std::string& key) { |
| 126 deleted_headers_.Append(Value::CreateStringValue(key)); | 126 deleted_headers_.Append(Value::CreateStringValue(key)); |
| 127 } | 127 } |
| 128 | 128 |
| (...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1461 } | 1461 } |
| 1462 } | 1462 } |
| 1463 } | 1463 } |
| 1464 | 1464 |
| 1465 ExtensionWebRequestEventRouter::GetInstance()->OnEventHandled( | 1465 ExtensionWebRequestEventRouter::GetInstance()->OnEventHandled( |
| 1466 profile(), extension_id(), event_name, sub_event_name, request_id, | 1466 profile(), extension_id(), event_name, sub_event_name, request_id, |
| 1467 response.release()); | 1467 response.release()); |
| 1468 | 1468 |
| 1469 return true; | 1469 return true; |
| 1470 } | 1470 } |
| OLD | NEW |