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

Side by Side Diff: content/child/webthread_impl.h

Issue 109283006: Redirect HTML resource bytes directly to parser thread (Chrome side CL) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | content/content_child.gypi » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 CONTENT_CHILD_WEBTHREAD_IMPL_H_ 5 #ifndef CONTENT_CHILD_WEBTHREAD_IMPL_H_
6 #define CONTENT_CHILD_WEBTHREAD_IMPL_H_ 6 #define CONTENT_CHILD_WEBTHREAD_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/threading/thread.h" 11 #include "base/threading/thread.h"
12 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
13 #include "third_party/WebKit/public/platform/WebThread.h" 13 #include "third_party/WebKit/public/platform/WebThread.h"
14 14
15 namespace content { 15 namespace content {
16 16
17 class WebThreadBase : public blink::WebThread { 17 class CONTENT_EXPORT WebThreadBase : public blink::WebThread {
18 public: 18 public:
19 virtual ~WebThreadBase(); 19 virtual ~WebThreadBase();
20 20
21 virtual void addTaskObserver(TaskObserver* observer); 21 virtual void addTaskObserver(TaskObserver* observer);
22 virtual void removeTaskObserver(TaskObserver* observer); 22 virtual void removeTaskObserver(TaskObserver* observer);
23 23
24 virtual bool isCurrentThread() const = 0; 24 virtual bool isCurrentThread() const = 0;
25 25
26 protected: 26 protected:
27 WebThreadBase(); 27 WebThreadBase();
28 28
29 private: 29 private:
30 class TaskObserverAdapter; 30 class TaskObserverAdapter;
31 31
32 typedef std::map<TaskObserver*, TaskObserverAdapter*> TaskObserverMap; 32 typedef std::map<TaskObserver*, TaskObserverAdapter*> TaskObserverMap;
33 TaskObserverMap task_observer_map_; 33 TaskObserverMap task_observer_map_;
34 }; 34 };
35 35
36 class WebThreadImpl : public WebThreadBase { 36 class CONTENT_EXPORT WebThreadImpl : public WebThreadBase {
37 public: 37 public:
38 CONTENT_EXPORT explicit WebThreadImpl(const char* name); 38 explicit WebThreadImpl(const char* name);
39 CONTENT_EXPORT virtual ~WebThreadImpl(); 39 virtual ~WebThreadImpl();
40 40
41 virtual void postTask(Task* task); 41 virtual void postTask(Task* task);
42 virtual void postDelayedTask(Task* task, long long delay_ms); 42 virtual void postDelayedTask(Task* task, long long delay_ms);
43 43
44 virtual void enterRunLoop(); 44 virtual void enterRunLoop();
45 virtual void exitRunLoop(); 45 virtual void exitRunLoop();
46 46
47 base::MessageLoop* message_loop() const { return thread_->message_loop(); } 47 base::MessageLoop* message_loop() const { return thread_->message_loop(); }
48 48
49 virtual bool isCurrentThread() const OVERRIDE;
50
49 private: 51 private:
50 virtual bool isCurrentThread() const OVERRIDE;
51 scoped_ptr<base::Thread> thread_; 52 scoped_ptr<base::Thread> thread_;
52 }; 53 };
53 54
54 class WebThreadImplForMessageLoop : public WebThreadBase { 55 class WebThreadImplForMessageLoop : public WebThreadBase {
55 public: 56 public:
56 CONTENT_EXPORT explicit WebThreadImplForMessageLoop( 57 CONTENT_EXPORT explicit WebThreadImplForMessageLoop(
57 base::MessageLoopProxy* message_loop); 58 base::MessageLoopProxy* message_loop);
58 CONTENT_EXPORT virtual ~WebThreadImplForMessageLoop(); 59 CONTENT_EXPORT virtual ~WebThreadImplForMessageLoop();
59 60
60 virtual void postTask(Task* task); 61 virtual void postTask(Task* task) OVERRIDE;
61 virtual void postDelayedTask(Task* task, long long delay_ms); 62 virtual void postDelayedTask(Task* task, long long delay_ms) OVERRIDE;
62 63
63 virtual void enterRunLoop(); 64 virtual void enterRunLoop() OVERRIDE;
64 virtual void exitRunLoop(); 65 virtual void exitRunLoop() OVERRIDE;
65 66
66 private: 67 private:
67 virtual bool isCurrentThread() const OVERRIDE; 68 virtual bool isCurrentThread() const OVERRIDE;
68 scoped_refptr<base::MessageLoopProxy> message_loop_; 69 scoped_refptr<base::MessageLoopProxy> message_loop_;
69 }; 70 };
70 71
71 } // namespace content 72 } // namespace content
72 73
73 #endif // CONTENT_CHILD_WEBTHREAD_IMPL_H_ 74 #endif // CONTENT_CHILD_WEBTHREAD_IMPL_H_
OLDNEW
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | content/content_child.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698