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

Side by Side Diff: chrome/browser/search/iframe_source.h

Issue 2634413002: Faster Reload: Specify AllowCaching = false for some URLDataSources that need it (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/search/iframe_source.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 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 4
5 #ifndef CHROME_BROWSER_SEARCH_IFRAME_SOURCE_H_ 5 #ifndef CHROME_BROWSER_SEARCH_IFRAME_SOURCE_H_
6 #define CHROME_BROWSER_SEARCH_IFRAME_SOURCE_H_ 6 #define CHROME_BROWSER_SEARCH_IFRAME_SOURCE_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "content/public/browser/url_data_source.h" 10 #include "content/public/browser/url_data_source.h"
11 11
12 // Base class for URL data sources for chrome-search:// iframed content. 12 // Base class for URL data sources for chrome-search:// iframed content.
13 class IframeSource : public content::URLDataSource { 13 class IframeSource : public content::URLDataSource {
14 public: 14 public:
15 IframeSource(); 15 IframeSource();
16 ~IframeSource() override; 16 ~IframeSource() override;
17 17
18 protected: 18 protected:
19 // Overridden from content::URLDataSource: 19 // Overridden from content::URLDataSource:
20 std::string GetMimeType(const std::string& path_and_query) const override; 20 std::string GetMimeType(const std::string& path_and_query) const override;
21 bool AllowCaching() const override;
21 bool ShouldDenyXFrameOptions() const override; 22 bool ShouldDenyXFrameOptions() const override;
22 bool ShouldServiceRequest(const net::URLRequest* request) const override; 23 bool ShouldServiceRequest(const net::URLRequest* request) const override;
23 24
24 // Returns whether this source should serve data for a particular path. 25 // Returns whether this source should serve data for a particular path.
25 virtual bool ServesPath(const std::string& path) const = 0; 26 virtual bool ServesPath(const std::string& path) const = 0;
26 27
27 // Sends unmodified resource bytes. 28 // Sends unmodified resource bytes.
28 void SendResource( 29 void SendResource(
29 int resource_id, 30 int resource_id,
30 const content::URLDataSource::GotDataCallback& callback); 31 const content::URLDataSource::GotDataCallback& callback);
31 32
32 // Sends Javascript with an expected postMessage origin interpolated. 33 // Sends Javascript with an expected postMessage origin interpolated.
33 void SendJSWithOrigin( 34 void SendJSWithOrigin(
34 int resource_id, 35 int resource_id,
35 const content::ResourceRequestInfo::WebContentsGetter& wc_getter, 36 const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
36 const content::URLDataSource::GotDataCallback& callback); 37 const content::URLDataSource::GotDataCallback& callback);
37 38
38 // This is exposed for testing and should not be overridden. 39 // This is exposed for testing and should not be overridden.
39 // Sets |origin| to the URL of the WebContents identified by |wc_getter|. 40 // Sets |origin| to the URL of the WebContents identified by |wc_getter|.
40 // Returns true if successful and false if not, for example if the WebContents 41 // Returns true if successful and false if not, for example if the WebContents
41 // does not exist 42 // does not exist
42 virtual bool GetOrigin( 43 virtual bool GetOrigin(
43 const content::ResourceRequestInfo::WebContentsGetter& wc_getter, 44 const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
44 std::string* origin) const; 45 std::string* origin) const;
45 46
46 DISALLOW_COPY_AND_ASSIGN(IframeSource); 47 DISALLOW_COPY_AND_ASSIGN(IframeSource);
47 }; 48 };
48 49
49 #endif // CHROME_BROWSER_SEARCH_IFRAME_SOURCE_H_ 50 #endif // CHROME_BROWSER_SEARCH_IFRAME_SOURCE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/search/iframe_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698