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

Side by Side Diff: ios/web_view/internal/app/application_context.h

Issue 2894483003: Initialize ios/web_view translate with a system-wide URLRequestContext. (Closed)
Patch Set: Created 3 years, 7 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 2017 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 IOS_WEB_VIEW_INTERNAL_APP_APPLICATION_CONTEXT_H_
6 #define IOS_WEB_VIEW_INTERNAL_APP_APPLICATION_CONTEXT_H_
7
8 #include <string>
9
10 #include "base/macros.h"
11
12 namespace net {
13 class URLRequestContextGetter;
14 }
15
16 namespace net_log {
17 class ChromeNetLog;
18 }
19
20 class ApplicationContext;
21 class PrefService;
22 class WebViewIOThread;
23
24 // Gets the global application context. Cannot return null.
25 ApplicationContext* GetApplicationContext();
Eugene But (OOO till 7-30) 2017/05/18 23:54:54 Should this be a singleton from base/memory/single
michaeldo 2017/05/19 22:02:35 This is not a singleton in chrome/browser/io_threa
Eugene But (OOO till 7-30) 2017/05/19 23:32:05 If this interface should not be singleton, then ma
michaeldo 2017/05/23 22:38:36 I took another look at this and was able to make i
26
27 class ApplicationContext {
Eugene But (OOO till 7-30) 2017/05/18 23:54:54 Please add comments
Hiroshi Ichikawa 2017/05/19 02:37:51 Shouldn't this class be inside a namespace?
michaeldo 2017/05/19 22:02:35 I think so? While many other classes are namespace
michaeldo 2017/05/19 22:02:35 Done.
28 public:
29 ApplicationContext();
Eugene But (OOO till 7-30) 2017/05/18 23:54:54 Should constructor/destructor be protected?
michaeldo 2017/05/19 22:02:35 Makes sense, Done.
30 virtual ~ApplicationContext();
31
32 // Gets the local state associated with this application.
33 virtual PrefService* GetLocalState() = 0;
34
35 // Gets the URL request context associated with this application.
36 virtual net::URLRequestContextGetter* GetSystemURLRequestContext() = 0;
37
38 // Gets the locale used by the application.
39 virtual const std::string& GetApplicationLocale() = 0;
40
41 protected:
42 // Sets the global ApplicationContext instance.
43 static void SetApplicationContext(ApplicationContext* context);
44
45 // Gets the ChromeNetLog.
46 virtual net_log::ChromeNetLog* GetNetLog() = 0;
47
48 // Gets the WebViewIOThread.
49 virtual WebViewIOThread* GetWebViewIOThread() = 0;
50
51 private:
52 DISALLOW_COPY_AND_ASSIGN(ApplicationContext);
53 };
54
55 #endif // IOS_WEB_VIEW_INTERNAL_APP_APPLICATION_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698