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

Side by Side Diff: chrome/common/child_thread.h

Issue 126070: Make XHR work in Workers. Creates a 'shadow page' in a worker process to prox... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/renderer/renderer_glue.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 CHROME_COMMON_CHILD_THREAD_H_ 5 #ifndef CHROME_COMMON_CHILD_THREAD_H_
6 #define CHROME_COMMON_CHILD_THREAD_H_ 6 #define CHROME_COMMON_CHILD_THREAD_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/scoped_ptr.h" 9 #include "base/scoped_ptr.h"
10 #include "base/thread.h" 10 #include "base/thread.h"
(...skipping 16 matching lines...) Expand all
27 // See documentation on MessageRouter for AddRoute and RemoveRoute 27 // See documentation on MessageRouter for AddRoute and RemoveRoute
28 void AddRoute(int32 routing_id, IPC::Channel::Listener* listener); 28 void AddRoute(int32 routing_id, IPC::Channel::Listener* listener);
29 void RemoveRoute(int32 routing_id); 29 void RemoveRoute(int32 routing_id);
30 30
31 MessageLoop* owner_loop() { return owner_loop_; } 31 MessageLoop* owner_loop() { return owner_loop_; }
32 32
33 ResourceDispatcher* resource_dispatcher() { 33 ResourceDispatcher* resource_dispatcher() {
34 return resource_dispatcher_.get(); 34 return resource_dispatcher_.get();
35 } 35 }
36 36
37 // Returns the one child thread.
38 static ChildThread* current();
39
37 protected: 40 protected:
38 friend class ChildProcess; 41 friend class ChildProcess;
39 42
40 // Starts the thread. 43 // Starts the thread.
41 bool Run(); 44 bool Run();
42 45
43 // Overrides the channel name. Used for --single-process mode. 46 // Overrides the channel name. Used for --single-process mode.
44 void SetChannelName(const std::string& name) { channel_name_ = name; } 47 void SetChannelName(const std::string& name) { channel_name_ = name; }
45 48
46 // Called when the process refcount is 0. 49 // Called when the process refcount is 0.
47 void OnProcessFinalRelease(); 50 void OnProcessFinalRelease();
48 51
49 protected: 52 protected:
50 // The required stack size if V8 runs on a thread. 53 // The required stack size if V8 runs on a thread.
51 static const size_t kV8StackSize; 54 static const size_t kV8StackSize;
52 55
53 virtual void OnControlMessageReceived(const IPC::Message& msg) { } 56 virtual void OnControlMessageReceived(const IPC::Message& msg) { }
54 57
55 // Returns the one child thread.
56 static ChildThread* current();
57
58 IPC::SyncChannel* channel() { return channel_.get(); } 58 IPC::SyncChannel* channel() { return channel_.get(); }
59 59
60 // Thread implementation. 60 // Thread implementation.
61 virtual void Init(); 61 virtual void Init();
62 virtual void CleanUp(); 62 virtual void CleanUp();
63 63
64 private: 64 private:
65 // IPC::Channel::Listener implementation: 65 // IPC::Channel::Listener implementation:
66 virtual void OnMessageReceived(const IPC::Message& msg); 66 virtual void OnMessageReceived(const IPC::Message& msg);
67 virtual void OnChannelError(); 67 virtual void OnChannelError();
(...skipping 16 matching lines...) Expand all
84 84
85 // If true, checks with the browser process before shutdown. This avoids race 85 // If true, checks with the browser process before shutdown. This avoids race
86 // conditions if the process refcount is 0 but there's an IPC message inflight 86 // conditions if the process refcount is 0 but there's an IPC message inflight
87 // that would addref it. 87 // that would addref it.
88 bool check_with_browser_before_shutdown_; 88 bool check_with_browser_before_shutdown_;
89 89
90 DISALLOW_COPY_AND_ASSIGN(ChildThread); 90 DISALLOW_COPY_AND_ASSIGN(ChildThread);
91 }; 91 };
92 92
93 #endif // CHROME_COMMON_CHILD_THREAD_H_ 93 #endif // CHROME_COMMON_CHILD_THREAD_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/renderer_glue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698