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

Side by Side Diff: content/browser/webui/url_data_manager_backend.h

Issue 11896113: Add chrome-search: access from Instant overlay (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Yet another rebase 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_BROWSER_WEBUI_URL_DATA_MANAGER_BACKEND_H_ 5 #ifndef CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_BACKEND_H_
6 #define CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_BACKEND_H_ 6 #define CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_BACKEND_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/supports_user_data.h" 14 #include "base/supports_user_data.h"
15 #include "content/browser/webui/url_data_manager.h" 15 #include "content/browser/webui/url_data_manager.h"
16 #include "net/url_request/url_request_job_factory.h" 16 #include "net/url_request/url_request_job_factory.h"
17 17
18 class GURL; 18 class GURL;
19 19
20 namespace appcache {
21 class AppCacheService;
22 }
23
20 namespace base { 24 namespace base {
21 class RefCountedMemory; 25 class RefCountedMemory;
22 } 26 }
23 27
24 namespace content { 28 namespace content {
29 class ChromeBlobStorageContext;
25 class ResourceContext; 30 class ResourceContext;
26 class URLDataManagerBackend; 31 class URLDataManagerBackend;
27 class URLDataSourceImpl; 32 class URLDataSourceImpl;
28 class URLRequestChromeJob; 33 class URLRequestChromeJob;
29 34
30 // URLDataManagerBackend is used internally by ChromeURLDataManager on the IO 35 // URLDataManagerBackend is used internally by ChromeURLDataManager on the IO
31 // thread. In most cases you can use the API in ChromeURLDataManager and ignore 36 // thread. In most cases you can use the API in ChromeURLDataManager and ignore
32 // this class. URLDataManagerBackend is owned by ResourceContext. 37 // this class. URLDataManagerBackend is owned by ResourceContext.
33 class URLDataManagerBackend : public base::SupportsUserData::Data { 38 class URLDataManagerBackend : public base::SupportsUserData::Data {
34 public: 39 public:
35 typedef int RequestID; 40 typedef int RequestID;
36 41
37 URLDataManagerBackend(); 42 URLDataManagerBackend();
38 virtual ~URLDataManagerBackend(); 43 virtual ~URLDataManagerBackend();
39 44
40 // Invoked to create the protocol handler for chrome://. |is_incognito| should 45 // Invoked to create the protocol handler for chrome://. |is_incognito| should
41 // be set for incognito profiles. Called on the UI thread. 46 // be set for incognito profiles. Called on the UI thread.
42 static net::URLRequestJobFactory::ProtocolHandler* CreateProtocolHandler( 47 static net::URLRequestJobFactory::ProtocolHandler* CreateProtocolHandler(
43 content::ResourceContext* resource_context, 48 content::ResourceContext* resource_context,
44 bool is_incognito); 49 bool is_incognito,
50 appcache::AppCacheService* appcache_service,
51 ChromeBlobStorageContext* blob_storage_context);
45 52
46 // Adds a DataSource to the collection of data sources. 53 // Adds a DataSource to the collection of data sources.
47 void AddDataSource(URLDataSourceImpl* source); 54 void AddDataSource(URLDataSourceImpl* source);
48 55
49 // DataSource invokes this. Sends the data to the URLRequest. 56 // DataSource invokes this. Sends the data to the URLRequest.
50 void DataAvailable(RequestID request_id, base::RefCountedMemory* bytes); 57 void DataAvailable(RequestID request_id, base::RefCountedMemory* bytes);
51 58
52 static net::URLRequestJob* Factory(net::URLRequest* request, 59 static net::URLRequestJob* Factory(net::URLRequest* request,
53 const std::string& scheme); 60 const std::string& scheme);
54 61
55 private: 62 private:
56 friend class URLRequestChromeJob; 63 friend class URLRequestChromeJob;
57 64
58 typedef std::map<std::string, 65 typedef std::map<std::string,
59 scoped_refptr<URLDataSourceImpl> > DataSourceMap; 66 scoped_refptr<URLDataSourceImpl> > DataSourceMap;
60 typedef std::map<RequestID, URLRequestChromeJob*> PendingRequestMap; 67 typedef std::map<RequestID, URLRequestChromeJob*> PendingRequestMap;
61 68
62 // Called by the job when it's starting up. 69 // Called by the job when it's starting up.
63 // Returns false if |url| is not a URL managed by this object. 70 // Returns false if |url| is not a URL managed by this object.
64 bool StartRequest(const GURL& url, URLRequestChromeJob* job); 71 bool StartRequest(const net::URLRequest* request, URLRequestChromeJob* job);
65 72
66 // Helper function to call StartDataRequest on |source|'s delegate. This is 73 // Helper function to call StartDataRequest on |source|'s delegate. This is
67 // needed because while we want to call URLDataSourceDelegate's method, we 74 // needed because while we want to call URLDataSourceDelegate's method, we
68 // need to add a refcount on the source. 75 // need to add a refcount on the source.
69 static void CallStartRequest(scoped_refptr<URLDataSourceImpl> source, 76 static void CallStartRequest(scoped_refptr<URLDataSourceImpl> source,
70 const std::string& path, 77 const std::string& path,
71 bool is_incognito, 78 bool is_incognito,
72 int request_id); 79 int request_id);
73 80
74 // Remove a request from the list of pending requests. 81 // Remove a request from the list of pending requests.
(...skipping 20 matching lines...) Expand all
95 102
96 // Creates protocol handler for chrome-devtools://. |is_incognito| should be 103 // Creates protocol handler for chrome-devtools://. |is_incognito| should be
97 // set for incognito profiles. 104 // set for incognito profiles.
98 net::URLRequestJobFactory::ProtocolHandler* 105 net::URLRequestJobFactory::ProtocolHandler*
99 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, 106 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context,
100 bool is_incognito); 107 bool is_incognito);
101 108
102 } // namespace content 109 } // namespace content
103 110
104 #endif // CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_BACKEND_H_ 111 #endif // CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_BACKEND_H_
OLDNEW
« no previous file with comments | « content/browser/storage_partition_impl_map.cc ('k') | content/browser/webui/url_data_manager_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698