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

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

Issue 23729005: Enable Activity Logging by default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added definition of 'active' Created 7 years, 3 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) 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 "chrome/browser/extensions/api/web_request/web_request_api.h" 5 #include "chrome/browser/extensions/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 1658 matching lines...) Expand 10 before | Expand all | Expand 10 after
1669 return; 1669 return;
1670 1670
1671 BlockedRequest& blocked_request = blocked_requests_[request_id]; 1671 BlockedRequest& blocked_request = blocked_requests_[request_id];
1672 int num_handlers_blocking = --blocked_request.num_handlers_blocking; 1672 int num_handlers_blocking = --blocked_request.num_handlers_blocking;
1673 CHECK_GE(num_handlers_blocking, 0); 1673 CHECK_GE(num_handlers_blocking, 0);
1674 1674
1675 if (response) { 1675 if (response) {
1676 helpers::EventResponseDelta* delta = 1676 helpers::EventResponseDelta* delta =
1677 CalculateDelta(&blocked_request, response); 1677 CalculateDelta(&blocked_request, response);
1678 1678
1679 if (extensions::ActivityLog::IsLogEnabledOnAnyProfile()) { 1679 LogExtensionActivity(profile,
Matt Perry 2013/08/30 20:49:20 Actually, I just realized that LogAction is not th
1680 LogExtensionActivity(profile, 1680 blocked_request.is_incognito,
1681 blocked_request.is_incognito, 1681 extension_id,
1682 extension_id, 1682 blocked_request.request->url(),
1683 blocked_request.request->url(), 1683 event_name,
1684 event_name, 1684 SummarizeResponseDelta(event_name, *delta));
1685 SummarizeResponseDelta(event_name, *delta));
1686 }
1687 1685
1688 blocked_request.response_deltas.push_back( 1686 blocked_request.response_deltas.push_back(
1689 linked_ptr<helpers::EventResponseDelta>(delta)); 1687 linked_ptr<helpers::EventResponseDelta>(delta));
1690 } 1688 }
1691 1689
1692 base::TimeDelta block_time = 1690 base::TimeDelta block_time =
1693 base::Time::Now() - blocked_request.blocking_time; 1691 base::Time::Now() - blocked_request.blocking_time;
1694 if (!extension_id.empty()) { 1692 if (!extension_id.empty()) {
1695 request_time_tracker_->IncrementExtensionBlockTime( 1693 request_time_tracker_->IncrementExtensionBlockTime(
1696 extension_id, request_id, block_time); 1694 extension_id, request_id, block_time);
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
2298 } else if ((*it)->name().find("AdBlock") != std::string::npos) { 2296 } else if ((*it)->name().find("AdBlock") != std::string::npos) {
2299 adblock = true; 2297 adblock = true;
2300 } else { 2298 } else {
2301 other = true; 2299 other = true;
2302 } 2300 }
2303 } 2301 }
2304 } 2302 }
2305 2303
2306 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); 2304 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other));
2307 } 2305 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698