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

Side by Side Diff: content/child/site_isolation_policy.cc

Issue 63153003: mac: Prepare for -Wunused-functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/child/site_isolation_policy.h" 5 #include "content/child/site_isolation_policy.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } 151 }
152 } 152 }
153 153
154 void HistogramCountNotBlockedResponse(const std::string& bucket_prefix, 154 void HistogramCountNotBlockedResponse(const std::string& bucket_prefix,
155 bool sniffed_as_js) { 155 bool sniffed_as_js) {
156 IncrementHistogramCount(bucket_prefix + ".NotBlocked"); 156 IncrementHistogramCount(bucket_prefix + ".NotBlocked");
157 if (sniffed_as_js) 157 if (sniffed_as_js)
158 IncrementHistogramCount(bucket_prefix + ".NotBlocked.MaybeJS"); 158 IncrementHistogramCount(bucket_prefix + ".NotBlocked.MaybeJS");
159 } 159 }
160 160
161 void HistogramCountPolicyDecision(
162 const std::string& bucket_prefix,
163 bool sniffed_as_document,
164 bool sniffed_as_js,
165 const SiteIsolationPolicy::ResponseMetaData& resp_data) {
166 if (sniffed_as_document) {
167 HistogramCountBlockedResponse(bucket_prefix, resp_data, false);
168 } else {
169 if (resp_data.no_sniff)
170 HistogramCountBlockedResponse(bucket_prefix, resp_data, true);
171 else
172 HistogramCountNotBlockedResponse(bucket_prefix, sniffed_as_js);
173 }
174 }
175
176 } // namespace 161 } // namespace
177 162
178 SiteIsolationPolicy::ResponseMetaData::ResponseMetaData() {} 163 SiteIsolationPolicy::ResponseMetaData::ResponseMetaData() {}
179 164
180 void SiteIsolationPolicy::SetPolicyEnabled(bool enabled) { 165 void SiteIsolationPolicy::SetPolicyEnabled(bool enabled) {
181 g_policy_enabled = enabled; 166 g_policy_enabled = enabled;
182 } 167 }
183 168
184 void SiteIsolationPolicy::OnReceivedResponse( 169 void SiteIsolationPolicy::OnReceivedResponse(
185 int request_id, 170 int request_id,
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 // TODO(dsjang): This is a real hack. The only purpose of this function is to 569 // TODO(dsjang): This is a real hack. The only purpose of this function is to
585 // try to see if there's any possibility that this data can be JavaScript 570 // try to see if there's any possibility that this data can be JavaScript
586 // (superset of JS). This function will be removed once UMA stats are 571 // (superset of JS). This function will be removed once UMA stats are
587 // gathered. 572 // gathered.
588 573
589 // Search for "var " for JS detection. 574 // Search for "var " for JS detection.
590 return data.find("var ") != base::StringPiece::npos; 575 return data.find("var ") != base::StringPiece::npos;
591 } 576 }
592 577
593 } // namespace content 578 } // namespace content
OLDNEW
« no previous file with comments | « content/child/npapi/plugin_instance_mac.mm ('k') | content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698