| 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 "xhr", |
| 60 "other", | 61 "other", |
| 61 }; | 62 }; |
| 62 | 63 |
| 63 static ResourceType::Type kResourceTypeValues[] = { | 64 static ResourceType::Type kResourceTypeValues[] = { |
| 64 ResourceType::MAIN_FRAME, | 65 ResourceType::MAIN_FRAME, |
| 65 ResourceType::SUB_FRAME, | 66 ResourceType::SUB_FRAME, |
| 66 ResourceType::STYLESHEET, | 67 ResourceType::STYLESHEET, |
| 67 ResourceType::SCRIPT, | 68 ResourceType::SCRIPT, |
| 68 ResourceType::IMAGE, | 69 ResourceType::IMAGE, |
| 69 ResourceType::OBJECT, | 70 ResourceType::OBJECT, |
| 71 ResourceType::XHR, |
| 70 ResourceType::LAST_TYPE, // represents "other" | 72 ResourceType::LAST_TYPE, // represents "other" |
| 71 }; | 73 }; |
| 72 | 74 |
| 73 COMPILE_ASSERT( | 75 COMPILE_ASSERT( |
| 74 arraysize(kResourceTypeStrings) == arraysize(kResourceTypeValues), | 76 arraysize(kResourceTypeStrings) == arraysize(kResourceTypeValues), |
| 75 keep_resource_types_in_sync); | 77 keep_resource_types_in_sync); |
| 76 | 78 |
| 77 #define ARRAYEND(array) (array + arraysize(array)) | 79 #define ARRAYEND(array) (array + arraysize(array)) |
| 78 | 80 |
| 79 // NetLog parameter to indicate the ID of the extension that caused an event. | 81 // 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 } | 1419 } |
| 1418 } | 1420 } |
| 1419 } | 1421 } |
| 1420 | 1422 |
| 1421 ExtensionWebRequestEventRouter::GetInstance()->OnEventHandled( | 1423 ExtensionWebRequestEventRouter::GetInstance()->OnEventHandled( |
| 1422 profile(), extension_id(), event_name, sub_event_name, request_id, | 1424 profile(), extension_id(), event_name, sub_event_name, request_id, |
| 1423 response.release()); | 1425 response.release()); |
| 1424 | 1426 |
| 1425 return true; | 1427 return true; |
| 1426 } | 1428 } |
| OLD | NEW |