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

Side by Side Diff: chrome/browser/dom_ui/net_internals_ui.cc

Issue 6461024: Revert 74292 - Splits ChromeURLDataManager into 2 chunks:... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 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
« no previous file with comments | « chrome/browser/dom_ui/most_visited_handler.cc ('k') | chrome/browser/dom_ui/new_tab_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/dom_ui/net_internals_ui.h" 5 #include "chrome/browser/dom_ui/net_internals_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 : public base::RefCountedThreadSafe< 203 : public base::RefCountedThreadSafe<
204 NetInternalsMessageHandler::IOThreadImpl, 204 NetInternalsMessageHandler::IOThreadImpl,
205 BrowserThread::DeleteOnUIThread>, 205 BrowserThread::DeleteOnUIThread>,
206 public ChromeNetLog::ThreadSafeObserver, 206 public ChromeNetLog::ThreadSafeObserver,
207 public ConnectionTester::Delegate { 207 public ConnectionTester::Delegate {
208 public: 208 public:
209 // Type for methods that can be used as MessageHandler callbacks. 209 // Type for methods that can be used as MessageHandler callbacks.
210 typedef void (IOThreadImpl::*MessageHandler)(const ListValue*); 210 typedef void (IOThreadImpl::*MessageHandler)(const ListValue*);
211 211
212 // Creates a proxy for |handler| that will live on the IO thread. 212 // Creates a proxy for |handler| that will live on the IO thread.
213 // |handler| is a weak pointer, since it is possible for the 213 // |handler| is a weak pointer, since it is possible for the WebUIMessageHandl er
214 // WebUIMessageHandler to be deleted on the UI thread while we were executing 214 // to be deleted on the UI thread while we were executing on the IO thread.
215 // on the IO thread. |io_thread| is the global IOThread (it is passed in as 215 // |io_thread| is the global IOThread (it is passed in as an argument since
216 // an argument since we need to grab it from the UI thread). 216 // we need to grab it from the UI thread).
217 IOThreadImpl( 217 IOThreadImpl(
218 const base::WeakPtr<NetInternalsMessageHandler>& handler, 218 const base::WeakPtr<NetInternalsMessageHandler>& handler,
219 IOThread* io_thread, 219 IOThread* io_thread,
220 URLRequestContextGetter* context_getter); 220 URLRequestContextGetter* context_getter);
221 221
222 ~IOThreadImpl(); 222 ~IOThreadImpl();
223 223
224 // Creates a callback that will run |method| on the IO thread. 224 // Creates a callback that will run |method| on the IO thread.
225 // 225 //
226 // This can be used with DOMUI::RegisterMessageCallback() to bind to a method 226 // This can be used with DOMUI::RegisterMessageCallback() to bind to a method
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 // NetInternalsUI 1155 // NetInternalsUI
1156 // 1156 //
1157 //////////////////////////////////////////////////////////////////////////////// 1157 ////////////////////////////////////////////////////////////////////////////////
1158 1158
1159 NetInternalsUI::NetInternalsUI(TabContents* contents) : DOMUI(contents) { 1159 NetInternalsUI::NetInternalsUI(TabContents* contents) : DOMUI(contents) {
1160 AddMessageHandler((new NetInternalsMessageHandler())->Attach(this)); 1160 AddMessageHandler((new NetInternalsMessageHandler())->Attach(this));
1161 1161
1162 NetInternalsHTMLSource* html_source = new NetInternalsHTMLSource(); 1162 NetInternalsHTMLSource* html_source = new NetInternalsHTMLSource();
1163 1163
1164 // Set up the chrome://net-internals/ source. 1164 // Set up the chrome://net-internals/ source.
1165 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); 1165 BrowserThread::PostTask(
1166 BrowserThread::IO, FROM_HERE,
1167 NewRunnableMethod(
1168 ChromeURLDataManager::GetInstance(),
1169 &ChromeURLDataManager::AddDataSource,
1170 make_scoped_refptr(html_source)));
1166 } 1171 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/most_visited_handler.cc ('k') | chrome/browser/dom_ui/new_tab_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698