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

Side by Side Diff: base/message_loop.h

Issue 10546083: Convert ProtocolHandlerRegistry to be a ProfileKeyedService. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merge in MessageLoop conflict from upstream. Created 8 years, 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef BASE_MESSAGE_LOOP_H_ 5 #ifndef BASE_MESSAGE_LOOP_H_
6 #define BASE_MESSAGE_LOOP_H_ 6 #define BASE_MESSAGE_LOOP_H_
7 #pragma once 7 #pragma once
8 8
9 #include <queue> 9 #include <queue>
10 #include <string> 10 #include <string>
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 void QuitNow(); 252 void QuitNow();
253 253
254 // TODO(jbates) remove this. crbug.com/131220. See QuitWhenIdleClosure(). 254 // TODO(jbates) remove this. crbug.com/131220. See QuitWhenIdleClosure().
255 static base::Closure QuitClosure() { return QuitWhenIdleClosure(); } 255 static base::Closure QuitClosure() { return QuitWhenIdleClosure(); }
256 256
257 // Deprecated: use RunLoop instead. 257 // Deprecated: use RunLoop instead.
258 // Construct a Closure that will call QuitWhenIdle(). Useful to schedule an 258 // Construct a Closure that will call QuitWhenIdle(). Useful to schedule an
259 // arbitrary MessageLoop to QuitWhenIdle. 259 // arbitrary MessageLoop to QuitWhenIdle.
260 static base::Closure QuitWhenIdleClosure(); 260 static base::Closure QuitWhenIdleClosure();
261 261
262 // Returns true if this loop is |type|. This allows subclasses (especially
263 // those in tests) to specialize how they are identified.
264 virtual bool IsType(Type type) const;
265
262 // Returns the type passed to the constructor. 266 // Returns the type passed to the constructor.
263 Type type() const { return type_; } 267 Type type() const { return type_; }
264 268
265 // Optional call to connect the thread name with this loop. 269 // Optional call to connect the thread name with this loop.
266 void set_thread_name(const std::string& thread_name) { 270 void set_thread_name(const std::string& thread_name) {
267 DCHECK(thread_name_.empty()) << "Should not rename this thread!"; 271 DCHECK(thread_name_.empty()) << "Should not rename this thread!";
268 thread_name_ = thread_name; 272 thread_name_ = thread_name;
269 } 273 }
270 const std::string& thread_name() const { return thread_name_; } 274 const std::string& thread_name() const { return thread_name_; }
271 275
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 #endif // defined(OS_POSIX) 649 #endif // defined(OS_POSIX)
646 }; 650 };
647 651
648 // Do not add any member variables to MessageLoopForIO! This is important b/c 652 // Do not add any member variables to MessageLoopForIO! This is important b/c
649 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra 653 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra
650 // data that you need should be stored on the MessageLoop's pump_ instance. 654 // data that you need should be stored on the MessageLoop's pump_ instance.
651 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), 655 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO),
652 MessageLoopForIO_should_not_have_extra_member_variables); 656 MessageLoopForIO_should_not_have_extra_member_variables);
653 657
654 #endif // BASE_MESSAGE_LOOP_H_ 658 #endif // BASE_MESSAGE_LOOP_H_
OLDNEW
« no previous file with comments | « no previous file | base/message_loop.cc » ('j') | chrome/browser/custom_handlers/protocol_handler_registry.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698