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

Side by Side Diff: webkit/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, 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef WEBKIT_CHILD_WEBTHREAD_IMPL_H_ 4 #ifndef WEBKIT_CHILD_WEBTHREAD_IMPL_H_
5 #define WEBKIT_CHILD_WEBTHREAD_IMPL_H_ 5 #define WEBKIT_CHILD_WEBTHREAD_IMPL_H_
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
11 #include "third_party/WebKit/public/platform/WebThread.h" 11 #include "third_party/WebKit/public/platform/WebThread.h"
12 #include "webkit/child/webkit_child_export.h" 12 #include "webkit/child/webkit_child_export.h"
13 13
14 namespace webkit_glue { 14 namespace webkit_glue {
15 15
16 class WebThreadBase : public blink::WebThread { 16 class WEBKIT_CHILD_EXPORT WebThreadBase : public blink::WebThread {
17 public: 17 public:
18 virtual ~WebThreadBase(); 18 virtual ~WebThreadBase();
19 19
20 virtual void addTaskObserver(TaskObserver* observer); 20 virtual void addTaskObserver(TaskObserver* observer);
21 virtual void removeTaskObserver(TaskObserver* observer); 21 virtual void removeTaskObserver(TaskObserver* observer);
22 22
23 virtual bool isCurrentThread() const = 0; 23 virtual bool isCurrentThread() const = 0;
24 24
25 protected: 25 protected:
26 WebThreadBase(); 26 WebThreadBase();
27 27
28 private: 28 private:
29 class TaskObserverAdapter; 29 class TaskObserverAdapter;
30 30
31 typedef std::map<TaskObserver*, TaskObserverAdapter*> TaskObserverMap; 31 typedef std::map<TaskObserver*, TaskObserverAdapter*> TaskObserverMap;
32 TaskObserverMap task_observer_map_; 32 TaskObserverMap task_observer_map_;
33 }; 33 };
34 34
35 class WebThreadImpl : public WebThreadBase { 35 class WEBKIT_CHILD_EXPORT WebThreadImpl : public WebThreadBase {
36 public: 36 public:
37 WEBKIT_CHILD_EXPORT explicit WebThreadImpl(const char* name); 37 explicit WebThreadImpl(const char* name);
38 WEBKIT_CHILD_EXPORT virtual ~WebThreadImpl(); 38 virtual ~WebThreadImpl();
39 39
40 virtual void postTask(Task* task); 40 virtual void postTask(Task* task);
41 virtual void postDelayedTask(Task* task, long long delay_ms); 41 virtual void postDelayedTask(Task* task, long long delay_ms);
42 42
43 virtual void enterRunLoop(); 43 virtual void enterRunLoop();
44 virtual void exitRunLoop(); 44 virtual void exitRunLoop();
45 45
46 base::MessageLoop* message_loop() const { return thread_->message_loop(); } 46 base::MessageLoop* message_loop() const { return thread_->message_loop(); }
47 47
48 virtual bool isCurrentThread() const OVERRIDE;
49
48 private: 50 private:
49 virtual bool isCurrentThread() const OVERRIDE;
50 scoped_ptr<base::Thread> thread_; 51 scoped_ptr<base::Thread> thread_;
51 }; 52 };
52 53
53 class WebThreadImplForMessageLoop : public WebThreadBase { 54 class WebThreadImplForMessageLoop : public WebThreadBase {
54 public: 55 public:
55 WEBKIT_CHILD_EXPORT explicit WebThreadImplForMessageLoop( 56 WEBKIT_CHILD_EXPORT explicit WebThreadImplForMessageLoop(
56 base::MessageLoopProxy* message_loop); 57 base::MessageLoopProxy* message_loop);
57 WEBKIT_CHILD_EXPORT virtual ~WebThreadImplForMessageLoop(); 58 WEBKIT_CHILD_EXPORT virtual ~WebThreadImplForMessageLoop();
58 59
59 virtual void postTask(Task* task); 60 virtual void postTask(Task* task) OVERRIDE;
60 virtual void postDelayedTask(Task* task, long long delay_ms); 61 virtual void postDelayedTask(Task* task, long long delay_ms) OVERRIDE;
61 62
62 virtual void enterRunLoop(); 63 virtual void enterRunLoop() OVERRIDE;
63 virtual void exitRunLoop(); 64 virtual void exitRunLoop() OVERRIDE;
64 65
65 private: 66 private:
66 virtual bool isCurrentThread() const OVERRIDE; 67 virtual bool isCurrentThread() const OVERRIDE;
67 scoped_refptr<base::MessageLoopProxy> message_loop_; 68 scoped_refptr<base::MessageLoopProxy> message_loop_;
68 }; 69 };
69 70
70 } // namespace webkit_glue 71 } // namespace webkit_glue
71 72
72 #endif // WEBKIT_CHILD_WEBTHREAD_IMPL_H_ 73 #endif // WEBKIT_CHILD_WEBTHREAD_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698