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

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

Issue 8548003: Some easy NewRunnableMethod conversions in safe_browsing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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
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/protocol_manager.h" 5 #include "chrome/browser/safe_browsing/protocol_manager.h"
6 6
7 #ifndef NDEBUG 7 #ifndef NDEBUG
8 #include "base/base64.h" 8 #include "base/base64.h"
9 #endif 9 #endif
10 #include "base/bind.h"
10 #include "base/environment.h" 11 #include "base/environment.h"
11 #include "base/logging.h" 12 #include "base/logging.h"
12 #include "base/metrics/histogram.h" 13 #include "base/metrics/histogram.h"
13 #include "base/rand_util.h" 14 #include "base/rand_util.h"
14 #include "base/stl_util.h" 15 #include "base/stl_util.h"
15 #include "base/string_util.h" 16 #include "base/string_util.h"
16 #include "base/stringprintf.h" 17 #include "base/stringprintf.h"
17 #include "base/task.h" 18 #include "base/task.h"
18 #include "base/timer.h" 19 #include "base/timer.h"
19 #include "chrome/browser/safe_browsing/protocol_parser.h" 20 #include "chrome/browser/safe_browsing/protocol_parser.h"
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 } 458 }
458 case GETKEY_REQUEST: { 459 case GETKEY_REQUEST: {
459 std::string client_key, wrapped_key; 460 std::string client_key, wrapped_key;
460 if (!parser.ParseNewKey(data, length, &client_key, &wrapped_key)) 461 if (!parser.ParseNewKey(data, length, &client_key, &wrapped_key))
461 return false; 462 return false;
462 463
463 client_key_ = client_key; 464 client_key_ = client_key;
464 wrapped_key_ = wrapped_key; 465 wrapped_key_ = wrapped_key;
465 BrowserThread::PostTask( 466 BrowserThread::PostTask(
466 BrowserThread::UI, FROM_HERE, 467 BrowserThread::UI, FROM_HERE,
467 NewRunnableMethod( 468 base::Bind(&SafeBrowsingService::OnNewMacKeys,
468 sb_service_, &SafeBrowsingService::OnNewMacKeys, client_key_, 469 sb_service_, client_key_, wrapped_key_));
469 wrapped_key_));
470 break; 470 break;
471 } 471 }
472 472
473 default: 473 default:
474 return false; 474 return false;
475 } 475 }
476 476
477 return true; 477 return true;
478 } 478 }
479 479
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 if (!additional_query_.empty()) { 833 if (!additional_query_.empty()) {
834 if (next_url.find("?") != std::string::npos) { 834 if (next_url.find("?") != std::string::npos) {
835 next_url.append("&"); 835 next_url.append("&");
836 } else { 836 } else {
837 next_url.append("?"); 837 next_url.append("?");
838 } 838 }
839 next_url.append(additional_query_); 839 next_url.append(additional_query_);
840 } 840 }
841 return GURL(next_url); 841 return GURL(next_url);
842 } 842 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698