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

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

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: thakis comment, renamed LAZY_INSTANCE_INITIALIZER Created 9 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 (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/safe_browsing/safe_browsing_service.h" 5 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.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/path_service.h" 10 #include "base/path_service.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 private: 95 private:
96 friend struct base::DefaultLazyInstanceTraits<SafeBrowsingServiceFactoryImpl>; 96 friend struct base::DefaultLazyInstanceTraits<SafeBrowsingServiceFactoryImpl>;
97 97
98 SafeBrowsingServiceFactoryImpl() { } 98 SafeBrowsingServiceFactoryImpl() { }
99 99
100 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactoryImpl); 100 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactoryImpl);
101 }; 101 };
102 102
103 static base::LazyInstance<SafeBrowsingServiceFactoryImpl> 103 static base::LazyInstance<SafeBrowsingServiceFactoryImpl>
104 g_safe_browsing_service_factory_impl(base::LINKER_INITIALIZED); 104 g_safe_browsing_service_factory_impl = LAZY_INSTANCE_INITIALIZER;
105 105
106 struct SafeBrowsingService::WhiteListedEntry { 106 struct SafeBrowsingService::WhiteListedEntry {
107 int render_process_host_id; 107 int render_process_host_id;
108 int render_view_id; 108 int render_view_id;
109 std::string domain; 109 std::string domain;
110 UrlCheckResult result; 110 UrlCheckResult result;
111 }; 111 };
112 112
113 SafeBrowsingService::UnsafeResource::UnsafeResource() 113 SafeBrowsingService::UnsafeResource::UnsafeResource()
114 : is_subresource(false), 114 : is_subresource(false),
(...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 Stop(); 1361 Stop();
1362 1362
1363 if (csd_service_.get()) 1363 if (csd_service_.get())
1364 csd_service_->SetEnabledAndRefreshState(enable); 1364 csd_service_->SetEnabledAndRefreshState(enable);
1365 if (download_service_.get()) { 1365 if (download_service_.get()) {
1366 download_service_->SetEnabled( 1366 download_service_->SetEnabled(
1367 enable && CommandLine::ForCurrentProcess()->HasSwitch( 1367 enable && CommandLine::ForCurrentProcess()->HasSwitch(
1368 switches::kEnableImprovedDownloadProtection)); 1368 switches::kEnableImprovedDownloadProtection));
1369 } 1369 }
1370 } 1370 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698