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

Side by Side Diff: chrome/browser/safe_browsing/ui_manager.cc

Issue 1370603002: Make some global pointers const void* const. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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/safe_browsing/ui_manager.h" 5 #include "chrome/browser/safe_browsing/ui_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/debug/leak_tracker.h" 10 #include "base/debug/leak_tracker.h"
(...skipping 19 matching lines...) Expand all
30 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" 30 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
31 #include "net/ssl/ssl_info.h" 31 #include "net/ssl/ssl_info.h"
32 #include "net/url_request/url_request_context.h" 32 #include "net/url_request/url_request_context.h"
33 #include "net/url_request/url_request_context_getter.h" 33 #include "net/url_request/url_request_context_getter.h"
34 34
35 using content::BrowserThread; 35 using content::BrowserThread;
36 using content::NavigationEntry; 36 using content::NavigationEntry;
37 using content::WebContents; 37 using content::WebContents;
38 38
39 namespace { 39 namespace {
40 const void* kWhitelistKey = &kWhitelistKey; 40
41 const void* const kWhitelistKey = &kWhitelistKey;
41 42
42 class WhitelistUrlSet : public base::SupportsUserData::Data { 43 class WhitelistUrlSet : public base::SupportsUserData::Data {
43 public: 44 public:
44 WhitelistUrlSet() {} 45 WhitelistUrlSet() {}
45 46
46 bool Contains(const GURL url) { 47 bool Contains(const GURL url) {
47 auto iter = set_.find(url.GetWithEmptyPath()); 48 auto iter = set_.find(url.GetWithEmptyPath());
48 return iter != set_.end(); 49 return iter != set_.end();
49 } 50 }
50 51
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 resource.render_process_host_id, resource.render_view_id); 330 resource.render_process_host_id, resource.render_view_id);
330 331
331 GURL maybe_whitelisted_url( 332 GURL maybe_whitelisted_url(
332 resource.is_subresource ? web_contents->GetVisibleURL() : resource.url); 333 resource.is_subresource ? web_contents->GetVisibleURL() : resource.url);
333 WhitelistUrlSet* site_list = 334 WhitelistUrlSet* site_list =
334 static_cast<WhitelistUrlSet*>(web_contents->GetUserData(kWhitelistKey)); 335 static_cast<WhitelistUrlSet*>(web_contents->GetUserData(kWhitelistKey));
335 if (!site_list) 336 if (!site_list)
336 return false; 337 return false;
337 return site_list->Contains(maybe_whitelisted_url); 338 return site_list->Contains(maybe_whitelisted_url);
338 } 339 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698