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

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

Issue 8176001: Warn user in case extension delays network traffic too much. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merged with ToT Created 9 years, 2 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
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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 GURL* new_url) { 479 GURL* new_url) {
480 // TODO(jochen): Figure out what to do with events from the system context. 480 // TODO(jochen): Figure out what to do with events from the system context.
481 if (!profile) 481 if (!profile)
482 return net::OK; 482 return net::OK;
483 483
484 if (!HasWebRequestScheme(request->url())) 484 if (!HasWebRequestScheme(request->url()))
485 return net::OK; 485 return net::OK;
486 486
487 request_time_tracker_->LogRequestStartTime(request->identifier(), 487 request_time_tracker_->LogRequestStartTime(request->identifier(),
488 base::Time::Now(), 488 base::Time::Now(),
489 request->url()); 489 request->url(),
490 profile);
490 491
491 int extra_info_spec = 0; 492 int extra_info_spec = 0;
492 std::vector<const EventListener*> listeners = 493 std::vector<const EventListener*> listeners =
493 GetMatchingListeners(profile, extension_info_map, keys::kOnBeforeRequest, 494 GetMatchingListeners(profile, extension_info_map, keys::kOnBeforeRequest,
494 request, &extra_info_spec); 495 request, &extra_info_spec);
495 if (listeners.empty()) 496 if (listeners.empty())
496 return net::OK; 497 return net::OK;
497 498
498 if (GetAndSetSignaled(request->identifier(), kOnBeforeRequest)) 499 if (GetAndSetSignaled(request->identifier(), kOnBeforeRequest))
499 return net::OK; 500 return net::OK;
(...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after
1581 profile_id(), extension_id(), event_name, sub_event_name, request_id, 1582 profile_id(), extension_id(), event_name, sub_event_name, request_id,
1582 response.release()); 1583 response.release());
1583 1584
1584 return true; 1585 return true;
1585 } 1586 }
1586 1587
1587 bool WebRequestHandlerBehaviorChanged::RunImpl() { 1588 bool WebRequestHandlerBehaviorChanged::RunImpl() {
1588 WebCacheManager::GetInstance()->ClearCacheOnNavigation(); 1589 WebCacheManager::GetInstance()->ClearCacheOnNavigation();
1589 return true; 1590 return true;
1590 } 1591 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698