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

Side by Side Diff: content/browser/streams/stream_context.h

Issue 12335087: Implement the Stream registry in content (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix unittests Created 7 years, 9 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
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_STREAMS_STREAM_CONTEXT_H_
6 #define CONTENT_BROWSER_STREAMS_STREAM_CONTEXT_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/sequenced_task_runner_helpers.h"
11 #include "content/public/browser/browser_thread.h"
12
13 namespace content {
14 class BrowserContext;
15 class StreamRegistry;
16
17 // A context class that keeps track of StreamRegistry used by the chrome.
18 // There is an instance associated with each BrowserContext. There could be
19 // multiple URLRequestContexts in the same browser context that refers to the
20 // same instance.
21 //
22 // All methods, except the ctor, are expected to be called on
23 // the IO thread (unless specifically called out in doc comments).
24 class StreamContext
25 : public base::RefCountedThreadSafe<StreamContext,
26 BrowserThread::DeleteOnIOThread> {
27 public:
28 StreamContext();
29
30 static StreamContext* GetFor(BrowserContext* browser_context);
31
32 void InitializeOnIOThread();
33
34 StreamRegistry* registry() const { return registry_.get(); }
35
36 protected:
37 virtual ~StreamContext();
38
39 private:
40 friend class base::DeleteHelper<StreamContext>;
41 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>;
42
43 scoped_ptr<StreamRegistry> registry_;
44 };
45
46 } // namespace content
47
48 #endif // CONTENT_BROWSER_STREAMS_STREAM_CONTEXT_H_
49
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698