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

Side by Side Diff: chrome/browser/extensions/extension_webrequest_api.cc

Issue 7661009: base: Add Is* functions to Value class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tony review Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_tabs_module.cc ('k') | chrome/browser/extensions/extension_webrequest_api_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698