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

Side by Side Diff: chrome/browser/ui/webui/chrome_url_data_manager.cc

Issue 8113025: base::Bind: More converts, mostly in WebUI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes. Created 9 years, 2 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 | 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/ui/webui/chrome_url_data_manager.h" 5 #include "chrome/browser/ui/webui/chrome_url_data_manager.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h"
9 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
10 #include "base/memory/ref_counted_memory.h" 11 #include "base/memory/ref_counted_memory.h"
11 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
12 #include "base/message_loop.h" 13 #include "base/message_loop.h"
13 #include "base/string_util.h" 14 #include "base/string_util.h"
14 #include "base/synchronization/lock.h" 15 #include "base/synchronization/lock.h"
15 #include "base/values.h" 16 #include "base/values.h"
16 #include "chrome/browser/net/chrome_url_request_context.h" 17 #include "chrome/browser/net/chrome_url_request_context.h"
17 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" 19 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h"
(...skipping 24 matching lines...) Expand all
43 : backend_(backend) { 44 : backend_(backend) {
44 } 45 }
45 46
46 ChromeURLDataManager::~ChromeURLDataManager() { 47 ChromeURLDataManager::~ChromeURLDataManager() {
47 } 48 }
48 49
49 void ChromeURLDataManager::AddDataSource(DataSource* source) { 50 void ChromeURLDataManager::AddDataSource(DataSource* source) {
50 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 51 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
51 BrowserThread::PostTask( 52 BrowserThread::PostTask(
52 BrowserThread::IO, FROM_HERE, 53 BrowserThread::IO, FROM_HERE,
53 NewRunnableFunction(AddDataSourceOnIOThread, 54 base::Bind(&AddDataSourceOnIOThread,
54 backend_, 55 backend_, make_scoped_refptr(source)));
55 make_scoped_refptr(source)));
56 } 56 }
57 57
58 // static 58 // static
59 void ChromeURLDataManager::DeleteDataSources() { 59 void ChromeURLDataManager::DeleteDataSources() {
60 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 60 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
61 DataSources sources; 61 DataSources sources;
62 { 62 {
63 base::AutoLock lock(delete_lock_); 63 base::AutoLock lock(delete_lock_);
64 if (!data_sources_) 64 if (!data_sources_)
65 return; 65 return;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 base::i18n::IsRTL() ? "rtl" : "ltr"); 170 base::i18n::IsRTL() ? "rtl" : "ltr");
171 } 171 }
172 172
173 void ChromeURLDataManager::DataSource::SendResponseOnIOThread( 173 void ChromeURLDataManager::DataSource::SendResponseOnIOThread(
174 int request_id, 174 int request_id,
175 scoped_refptr<RefCountedMemory> bytes) { 175 scoped_refptr<RefCountedMemory> bytes) {
176 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 176 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
177 if (backend_) 177 if (backend_)
178 backend_->DataAvailable(request_id, bytes); 178 backend_->DataAvailable(request_id, bytes);
179 } 179 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/bug_report_ui.cc ('k') | chrome/browser/ui/webui/chrome_url_data_manager_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698