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

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

Issue 1420053005: Move code in components/safe_browsing_db and chrome/browser/s_b/ under the safe_browsing namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@02_components_move
Patch Set: Remove '// namespace safe_browsing' for a small fwd decl block. Created 5 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
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 "chrome/browser/extensions/blacklist_state_fetcher.h" 5 #include "chrome/browser/extensions/blacklist_state_fetcher.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 net::URLFetcher::Create(url_fetcher_id_++, request_url, 73 net::URLFetcher::Create(url_fetcher_id_++, request_url,
74 net::URLFetcher::POST, this).release(); 74 net::URLFetcher::POST, this).release();
75 requests_[fetcher] = id; 75 requests_[fetcher] = id;
76 fetcher->SetAutomaticallyRetryOn5xx(false); // Don't retry on error. 76 fetcher->SetAutomaticallyRetryOn5xx(false); // Don't retry on error.
77 fetcher->SetRequestContext(url_request_context_getter_.get()); 77 fetcher->SetRequestContext(url_request_context_getter_.get());
78 fetcher->SetUploadData("application/octet-stream", request_str); 78 fetcher->SetUploadData("application/octet-stream", request_str);
79 fetcher->Start(); 79 fetcher->Start();
80 } 80 }
81 81
82 void BlacklistStateFetcher::SetSafeBrowsingConfig( 82 void BlacklistStateFetcher::SetSafeBrowsingConfig(
83 const SafeBrowsingProtocolConfig& config) { 83 const safe_browsing::SafeBrowsingProtocolConfig& config) {
84 safe_browsing_config_.reset(new SafeBrowsingProtocolConfig(config)); 84 safe_browsing_config_.reset(
85 new safe_browsing::SafeBrowsingProtocolConfig(config));
85 } 86 }
86 87
87 void BlacklistStateFetcher::SetURLRequestContextForTest( 88 void BlacklistStateFetcher::SetURLRequestContextForTest(
88 net::URLRequestContextGetter* request_context) { 89 net::URLRequestContextGetter* request_context) {
89 url_request_context_getter_ = request_context; 90 url_request_context_getter_ = request_context;
90 } 91 }
91 92
92 GURL BlacklistStateFetcher::RequestUrl() const { 93 GURL BlacklistStateFetcher::RequestUrl() const {
93 std::string url = base::StringPrintf( 94 std::string url = base::StringPrintf(
94 "%s/%s?client=%s&appver=%s&pver=2.2", 95 "%s/%s?client=%s&appver=%s&pver=2.2",
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 for (CallbackMultiMap::const_iterator callback_it = range.first; 149 for (CallbackMultiMap::const_iterator callback_it = range.first;
149 callback_it != range.second; 150 callback_it != range.second;
150 ++callback_it) { 151 ++callback_it) {
151 callback_it->second.Run(state); 152 callback_it->second.Run(state);
152 } 153 }
153 154
154 callbacks_.erase(range.first, range.second); 155 callbacks_.erase(range.first, range.second);
155 } 156 }
156 157
157 } // namespace extensions 158 } // namespace extensions
158
OLDNEW
« no previous file with comments | « chrome/browser/extensions/blacklist_state_fetcher.h ('k') | chrome/browser/extensions/fake_safe_browsing_database_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698