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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 keys::kOnResponseStarted, | 50 keys::kOnResponseStarted, |
51 }; | 51 }; |
52 | 52 |
53 static const char* kResourceTypeStrings[] = { | 53 static const char* kResourceTypeStrings[] = { |
54 "main_frame", | 54 "main_frame", |
55 "sub_frame", | 55 "sub_frame", |
56 "stylesheet", | 56 "stylesheet", |
57 "script", | 57 "script", |
58 "image", | 58 "image", |
59 "object", | 59 "object", |
60 "xmlhttprequest", | |
61 "other", | |
60 "other", | 62 "other", |
61 }; | 63 }; |
62 | 64 |
63 static ResourceType::Type kResourceTypeValues[] = { | 65 static ResourceType::Type kResourceTypeValues[] = { |
64 ResourceType::MAIN_FRAME, | 66 ResourceType::MAIN_FRAME, |
65 ResourceType::SUB_FRAME, | 67 ResourceType::SUB_FRAME, |
66 ResourceType::STYLESHEET, | 68 ResourceType::STYLESHEET, |
67 ResourceType::SCRIPT, | 69 ResourceType::SCRIPT, |
68 ResourceType::IMAGE, | 70 ResourceType::IMAGE, |
69 ResourceType::OBJECT, | 71 ResourceType::OBJECT, |
72 ResourceType::XHR, | |
73 ResourceType::SUB_RESOURCE, | |
Matt Perry
2011/08/09 16:58:42
this needs to be LAST_TYPE since we look up type b
| |
70 ResourceType::LAST_TYPE, // represents "other" | 74 ResourceType::LAST_TYPE, // represents "other" |
71 }; | 75 }; |
72 | 76 |
73 COMPILE_ASSERT( | 77 COMPILE_ASSERT( |
74 arraysize(kResourceTypeStrings) == arraysize(kResourceTypeValues), | 78 arraysize(kResourceTypeStrings) == arraysize(kResourceTypeValues), |
75 keep_resource_types_in_sync); | 79 keep_resource_types_in_sync); |
76 | 80 |
77 #define ARRAYEND(array) (array + arraysize(array)) | 81 #define ARRAYEND(array) (array + arraysize(array)) |
78 | 82 |
79 // NetLog parameter to indicate the ID of the extension that caused an event. | 83 // NetLog parameter to indicate the ID of the extension that caused an event. |
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1417 } | 1421 } |
1418 } | 1422 } |
1419 } | 1423 } |
1420 | 1424 |
1421 ExtensionWebRequestEventRouter::GetInstance()->OnEventHandled( | 1425 ExtensionWebRequestEventRouter::GetInstance()->OnEventHandled( |
1422 profile(), extension_id(), event_name, sub_event_name, request_id, | 1426 profile(), extension_id(), event_name, sub_event_name, request_id, |
1423 response.release()); | 1427 response.release()); |
1424 | 1428 |
1425 return true; | 1429 return true; |
1426 } | 1430 } |
OLD | NEW |