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

Side by Side Diff: extensions/browser/api/web_request/web_request_api.cc

Issue 1468803002: Switch to static_assert. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@assert1
Patch Set: message cleanup Created 5 years 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
OLDNEW
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 #include "extensions/browser/api/web_request/web_request_api.h" 5 #include "extensions/browser/api/web_request/web_request_api.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 web_request::OnBeforeRequest::kEventName}, 406 web_request::OnBeforeRequest::kEventName},
407 {events::WEB_REQUEST_ON_BEFORE_SEND_HEADERS, 407 {events::WEB_REQUEST_ON_BEFORE_SEND_HEADERS,
408 keys::kOnBeforeSendHeadersEvent}, 408 keys::kOnBeforeSendHeadersEvent},
409 {events::WEB_REQUEST_ON_COMPLETED, keys::kOnCompletedEvent}, 409 {events::WEB_REQUEST_ON_COMPLETED, keys::kOnCompletedEvent},
410 {events::WEB_REQUEST_ON_ERROR_OCCURRED, 410 {events::WEB_REQUEST_ON_ERROR_OCCURRED,
411 web_request::OnErrorOccurred::kEventName}, 411 web_request::OnErrorOccurred::kEventName},
412 {events::WEB_REQUEST_ON_SEND_HEADERS, keys::kOnSendHeadersEvent}, 412 {events::WEB_REQUEST_ON_SEND_HEADERS, keys::kOnSendHeadersEvent},
413 {events::WEB_REQUEST_ON_AUTH_REQUIRED, keys::kOnAuthRequiredEvent}, 413 {events::WEB_REQUEST_ON_AUTH_REQUIRED, keys::kOnAuthRequiredEvent},
414 {events::WEB_REQUEST_ON_RESPONSE_STARTED, keys::kOnResponseStartedEvent}, 414 {events::WEB_REQUEST_ON_RESPONSE_STARTED, keys::kOnResponseStartedEvent},
415 {events::WEB_REQUEST_ON_HEADERS_RECEIVED, keys::kOnHeadersReceivedEvent}}; 415 {events::WEB_REQUEST_ON_HEADERS_RECEIVED, keys::kOnHeadersReceivedEvent}};
416 COMPILE_ASSERT(arraysize(kWebRequestEvents) == arraysize(values_and_names), 416 static_assert(arraysize(kWebRequestEvents) == arraysize(values_and_names),
417 "kWebRequestEvents and values_and_names must be the same"); 417 "kWebRequestEvents and values_and_names must be the same");
418 for (const ValueAndName& value_and_name : values_and_names) { 418 for (const ValueAndName& value_and_name : values_and_names) {
419 if (value_and_name.event_name == event_name) 419 if (value_and_name.event_name == event_name)
420 return value_and_name.histogram_value; 420 return value_and_name.histogram_value;
421 } 421 }
422 422
423 // If there is no webRequest event, it might be a guest view webRequest event. 423 // If there is no webRequest event, it might be a guest view webRequest event.
424 events::HistogramValue guest_view_histogram_value = 424 events::HistogramValue guest_view_histogram_value =
425 guest_view_events::GetEventHistogramValue(event_name); 425 guest_view_events::GetEventHistogramValue(event_name);
426 if (guest_view_histogram_value != events::UNKNOWN) 426 if (guest_view_histogram_value != events::UNKNOWN)
427 return guest_view_histogram_value; 427 return guest_view_histogram_value;
(...skipping 2054 matching lines...) Expand 10 before | Expand all | Expand 10 after
2482 // Continue gracefully. 2482 // Continue gracefully.
2483 RunSync(); 2483 RunSync();
2484 } 2484 }
2485 2485
2486 bool WebRequestHandlerBehaviorChangedFunction::RunSync() { 2486 bool WebRequestHandlerBehaviorChangedFunction::RunSync() {
2487 helpers::ClearCacheOnNavigation(); 2487 helpers::ClearCacheOnNavigation();
2488 return true; 2488 return true;
2489 } 2489 }
2490 2490
2491 } // namespace extensions 2491 } // namespace extensions
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_websocket_host.cc ('k') | gpu/command_buffer/common/id_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698